Skip to contentSkip to conversation

firmware: dmi-sysfs: why is the access mode of dmi sysfs entries restricted to 0400?

DISCUSSION Guoheyi 2 participants 5 messages Dec 4, 2019 – Dec 6, 2019

lore
Share & tools
lore

Guoheyi

author
#0 lore raw

Hi,

Why is the access mode of dmi sysfs entries restricted to 0400? Is it for security concern? If it is, which information do we consider as privacy?

We would like to fetch CPU information from non-root application, is there feasible way to do that?

Any advice is appreciated.

Thanks,

Heyi

#1 lore raw
Quoted 4 lines · Guoheyi

Hi,

Why is the access mode of dmi sysfs entries restricted to 0400? Is it for security concern? If it is, which information do we consider as privacy?

There's lots of "interesting" information in dmi entries that you probably do not want all processes reading, which is why they are restricted.

Quoted 2 lines

We would like to fetch CPU information from non-root application, is there feasible way to do that?

What specific CPU information is not currently exported in /proc/cpuinfo that only shows up in DMI entries that you are interested in?

You can always have root change the permissions of a sysfs file if you have a service that wants to allow non-root programs to read specific entries.

thanks,

greg k-h

author
#2 lore raw
Quoted 5 lines · Greg Kroah-Hartman
Quoted 4 lines · Guoheyi

Hi,

Why is the access mode of dmi sysfs entries restricted to 0400? Is it for security concern? If it is, which information do we consider as privacy?

Quoted 8 lines

There's lots of "interesting" information in dmi entries that you probably do not want all processes reading, which is why they are restricted.

Quoted 2 lines

We would like to fetch CPU information from non-root application, is there feasible way to do that?

What specific CPU information is not currently exported in /proc/cpuinfo that only shows up in DMI entries that you are interested in?

We'd like to get processor manufacturer, speed and version, and pass the information to qemu virtual machine, for users of VM might be happy to see this instead of "unknown xxx", while qemu may run as non-root.

Quoted 4 lines

You can always have root change the permissions of a sysfs file if you have a service that wants to allow non-root programs to read specific entries.

Thanks; we'll try it.

Heyi

Quoted 6 lines

thanks,

greg k-h

.

#3 lore raw
Quoted 11 lines · Guoheyi
Quoted 9 lines · Greg Kroah-Hartman
Quoted 4 lines · Guoheyi

Hi,

Why is the access mode of dmi sysfs entries restricted to 0400? Is it for security concern? If it is, which information do we consider as privacy?

There's lots of "interesting" information in dmi entries that you probably do not want all processes reading, which is why they are restricted.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

We would like to fetch CPU information from non-root application, is there feasible way to do that?

What specific CPU information is not currently exported in /proc/cpuinfo that only shows up in DMI entries that you are interested in?

We'd like to get processor manufacturer, speed and version, and pass the information to qemu virtual machine, for users of VM might be happy to see this instead of "unknown xxx", while qemu may run as non-root.

Careful about this as if you move that virtual machine around, those values will change and if userspace was depending on them being static (set up at program start time), then you might have problems.

good luck!

greg k-h

author
#4 lore raw
Quoted 15 lines · Greg Kroah-Hartman
Quoted 14 lines · Guoheyi
Quoted 13 lines · Greg Kroah-Hartman
Quoted 4 lines · Guoheyi

Hi,

Why is the access mode of dmi sysfs entries restricted to 0400? Is it for security concern? If it is, which information do we consider as privacy?

There's lots of "interesting" information in dmi entries that you probably do not want all processes reading, which is why they are restricted.

Quoted 2 lines

We would like to fetch CPU information from non-root application, is there feasible way to do that?

What specific CPU information is not currently exported in /proc/cpuinfo that only shows up in DMI entries that you are interested in?

Quoted 8 lines
Quoted 3 lines

We'd like to get processor manufacturer, speed and version, and pass the information to qemu virtual machine, for users of VM might be happy to see this instead of "unknown xxx", while qemu may run as non-root.

Careful about this as if you move that virtual machine around, those values will change and if userspace was depending on them being static (set up at program start time), then you might have problems.

good luck!

The information will be used as VM DMI/SMBIOS as well, so it will be read only once during VM boot. I guess we will be OK :)

Thanks a lot.

Heyi

Quoted 4 lines

greg k-h

.