thunderbolt: Add authorized value to the KOBJ_CHANGE uevent
authorRajat Jain <rajatja@google.com>
Fri, 30 Jul 2021 23:53:04 +0000 (16:53 -0700)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 2 Aug 2021 15:03:36 +0000 (18:03 +0300)
commit1651d9e7810e79500b4940122e192b8aaeb2d63c
treecd68a3f9bcf5e765b0ab6d2ad38f6482b8cf7c5e
parentc500bee1c5b2f1d59b1081ac879d73268ab0ff17
thunderbolt: Add authorized value to the KOBJ_CHANGE uevent

For security reasons, we would like to monitor and track when the
Thunderbolt devices are authorized and deauthorized (i.e. when the
Thunderbolt sysfs "authorized" attribute changes). Currently the
userspace gets a udev change notification when there is a change, but
the state may have changed (again) by the time we look at the authorized
attribute in sysfs. So an authorization event may go unnoticed. Thus
make it easier by informing the actual change (new value of authorized
attribute) in the udev change notification.

The change is included as a key value "authorized=<val>" where <val>
is the new value of sysfs attribute "authorized", and is described at
Documentation/ABI/testing/sysfs-bus-thunderbolt under
/sys/bus/thunderbolt/devices/.../authorized.

Signed-off-by: Rajat Jain <rajatja@google.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/switch.c