2019-07-24 02:38:51 +02:00
|
|
|
type hal_can_socketcan, domain;
|
|
|
|
hal_server_domain(hal_can_socketcan, hal_can_controller)
|
|
|
|
hal_server_domain(hal_can_socketcan, hal_can_bus)
|
|
|
|
|
|
|
|
type hal_can_socketcan_exec, exec_type, vendor_file_type, file_type;
|
|
|
|
init_daemon_domain(hal_can_socketcan)
|
|
|
|
|
|
|
|
# Managing SocketCAN interfaces
|
|
|
|
allow hal_can_socketcan self:capability net_admin;
|
|
|
|
allow hal_can_socketcan self:netlink_route_socket { create bind write nlmsg_write read };
|
|
|
|
|
2022-12-09 20:35:48 +01:00
|
|
|
# See man page for netdevice(7) for more info on ioctls
|
2019-07-24 02:38:51 +02:00
|
|
|
allow hal_can_socketcan self:udp_socket { create ioctl };
|
|
|
|
allowxperm hal_can_socketcan self:udp_socket ioctl {
|
|
|
|
SIOCGIFINDEX
|
2022-12-09 20:35:48 +01:00
|
|
|
SIOCGIFFLAGS
|
|
|
|
SIOCSIFFLAGS
|
2019-07-24 02:38:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# Communicating with SocketCAN interfaces and bringing them up/down
|
2019-11-14 18:32:32 +01:00
|
|
|
allow hal_can_socketcan self:can_socket { bind create read write ioctl setopt };
|
2019-07-24 02:38:51 +02:00
|
|
|
allowxperm hal_can_socketcan self:can_socket ioctl {
|
|
|
|
SIOCGIFFLAGS
|
|
|
|
SIOCSIFFLAGS
|
|
|
|
};
|
|
|
|
|
|
|
|
# Un-publishing ICanBus interfaces
|
|
|
|
allow hal_can_socketcan hidl_manager_hwservice:hwservice_manager find;
|
2019-11-14 18:32:32 +01:00
|
|
|
|
2020-03-11 20:51:22 +01:00
|
|
|
allow hal_can_socketcan sysfs:dir r_dir_perms;
|
|
|
|
|
2019-11-14 18:32:32 +01:00
|
|
|
allow hal_can_socketcan usb_serial_device:chr_file { ioctl read write open };
|
|
|
|
allowxperm hal_can_socketcan usb_serial_device:chr_file ioctl {
|
|
|
|
TCGETS
|
|
|
|
TCSETSW
|
|
|
|
TIOCGSERIAL
|
|
|
|
TIOCSSERIAL
|
|
|
|
TIOCSETD
|
|
|
|
SIOCGIFNAME
|
|
|
|
};
|