Bug 8891 - mdev creates /dev/root symlink to incorrect device, because it doesn't check device type (block/char)
Summary: mdev creates /dev/root symlink to incorrect device, because it doesn't check ...
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.24.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-25 13:40 UTC by Jakub Jirutka
Modified: 2016-04-25 13:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jirutka 2016-04-25 13:40:05 UTC
When there are two device nodes, block and character, with the same major:minor numbers*, then mdev may create /dev/root symlink to the character device instead the block device.

lrwxrwxrwx  1 root root        4 Apr 25 12:50 root -> rtc0
crw-------  1 root root 254,   0 Apr 25  2016 rtc0
brw-rw----  1 root disk 254,   0 Apr 25 12:39 vda
brw-rw----  1 root disk 254,  16 Apr 25  2016 vdb

I think that this bug was introduced in commit a7e3d052 (https://github.com/mirror/busybox/commit/a7e3d052).

* At any point in time on one system the major:minor numbers **for each type of device** are unique, i.e. major:minor is not unique across various device types.