Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

When updated device resource entries, agent doesn't check device type (character vs. block) #835

Closed
dgibson opened this issue Sep 10, 2020 · 3 comments · Fixed by #836
Closed
Assignees
Labels
bug Incorrect behaviour needs-review Needs to be assessed by the team.

Comments

@dgibson
Copy link
Contributor

dgibson commented Sep 10, 2020

Description of problem

This bug was seen by code inspection, I haven't reproduced it.

The problem arises when:

  • A block device /dev/b appears in the container's OCI specification
  • A character device /dev/c appears in the container's OCI specification
  • /dev/b and /dev/c coincidentally have the same major:minor numbers in the host
  • At least one of the devices is listed by major:minor in the device resources list

Expected result

Each resource entry is updated with the guest major:minor numbers corresponding to its device.

Actual result

Resources for both /dev/b and /dev/c will be updated with the guest major:minor for whichever device is processed second.

@dgibson dgibson added bug Incorrect behaviour needs-review Needs to be assessed by the team. labels Sep 10, 2020
@dgibson dgibson self-assigned this Sep 18, 2020
@dgibson dgibson linked a pull request Sep 18, 2020 that will close this issue
@bergwolf
Copy link
Member

@dgibson How it is possible that two devices on the host have the same major:minor numbers?

/dev/b and /dev/c coincidentally have the same major:minor numbers in the host

@dgibson
Copy link
Contributor Author

dgibson commented Oct 11, 2020

@dgibson How it is possible that two devices on the host have the same major:minor numbers?

/dev/b and /dev/c coincidentally have the same major:minor numbers in the host

Because one is a character device and one is a block device. The major:minor numbers for block and character devices are in different address spaces.

@bergwolf
Copy link
Member

Ah, good point Thanks @dgibson

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Incorrect behaviour needs-review Needs to be assessed by the team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants