KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
81 stars 5 forks source link

Ensure major/minor number combinations are never reused #195

Open DemiMarie opened 2 years ago

DemiMarie commented 2 years ago

To avoid race conditions in userspace, major/minor device combinations for hot-pluggable devices should never be reused.

kees commented 1 year ago

Doesn't this pose a denial of service risk once the device number range is exhausted?

DemiMarie commented 1 year ago

The full range (major + minor) is 64 bits, so I don’t think we need to worry about it running out. That said, an even nicer approach would be to use something other than major and minor numbers to identify a device. Perhaps have a /dev/disk/by-diskseq filesystem maintained in the kernel, and something similar for character devices?