Security/Tizen 2.X udev(device-node)

From Tizen Wiki
Jump to: navigation, search


Udev is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the /dev directory.At the same time, udev also handles all user space events raised while hardware devices are added into the system or removed from it, including firmware loading as required by certain devices. In Tizen 2.3, the udev is integrated into Systemd.

Smack in udev

  • The udev uses xxx.rules file for giving information to made device nodes when they are making.
  • You can also give Smack label at same time by using the following option:
    • SECLABEL{smack}="label"
    • RUN+="/usr/bin/chsmack -a [label] [path]"
  • Example
KERNEL=="log_main", OWNER="developer", MODE="0620", GROUP="app_logging", SECLABEL{smack}="device::app_logging"
KERNEL=="log_radio", MODE="0620", GROUP="sys_logging", SECLABEL{smack}="device::sys_logging"
KERNEL=="log_system", MODE="0620", GROUP="sys_logging", SECLABEL{smack}="device::sys_logging"
DRIVER=="mdnie", RUN+="/bin/chmod 0660 %S/%p/mode", RUN+="/usr/bin/chsmack -a device::mdnie %S/%p/mode"
DRIVER=="mdnie", RUN+="/bin/chmod 0660 %S/%p/scenario", RUN+="/usr/bin/chsmack -a device::mdnie %S/%p/scenario"
DRIVER=="mdnie", RUN+="/bin/chmod 0660 %S/%p/tone", RUN+="/usr/bin/chsmack -a device::mdnie %S/%p/tone"