Bug 8891

Summary: mdev creates /dev/root symlink to incorrect device, because it doesn't check device type (block/char)
Product: Busybox Reporter: Jakub Jirutka <jakub>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.24.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

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.