mdev: device node changes parent dir permissions to 777.

Piotr Karbowski piotr.karbowski at gmail.com
Tue Dec 18 09:41:46 UTC 2012


On 12/18/2012 10:11 AM, Piotr Karbowski wrote:
> Hi,
>
> For some reason when i do move /dev/msr[0-9]+ nodes to /dev/cpu the
> /dev/cpu is getting 777 permissions. The very rule that affect it:
>
> msr([0-9]+)        root:root 600 =cpu/%1/msr
>
> Testcase:
>
> ### mdev.conf without msr:
> microcode       root:root 600 =cpu/
> cpu([0-9]+)     root:root 600 =cpu/%1/cpuid
>
> # rm /dev/cpu -rf; mdev -s; ls -ld /dev/cpu
> drwxr-xr-x 6 root root 140 Dec 18 10:07 /dev/cpu/
>
> Good so far.
>
> ### mdev.conf with msr:
> microcode       root:root 600 =cpu/
> cpu([0-9]+)     root:root 600 =cpu/%1/cpuid
> msr([0-9]+)     root:root 600 =cpu/%1/msr
>
> # rm /dev/cpu -rf; mdev -s; ls -ld /dev/cpu
> drwxrwxrwx 6 root root 140 Dec 18 10:08 /dev/cpu/
>
> And the /dev/cpu is 777, whatever is the order of msr, or even with
> there is only rule for msr, the /dev/cpu become 777, the /dev/cpu/0/ is
> 755 as it should be.
>
> Busybox mdev 1.20.2

A bit more debuging, the rule:

    msr0 root:root 600 =cpu/msr0

Does work, but if I add / at the end, like:

    msr0 root:root 600 =cpu/msr0/msr

it does alter /dev/cpu permissions.

-- Piotr.



More information about the busybox mailing list