The current session_access_ok logic disallows the access to a session when:
uid != session->uid && gid != session->gid && uid != 0
This means that any user that is part of the same primary group as the session's
owner can access the session. The primary group is not necessarily (and most
likely) not the `tracing` group.
For instance:
- the session has uid = 1000, gid = 100
- the current user has uid = 1001, gid = 100
access to the session is granted.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I2e9208286e5508315dae90cb25d34133ca5edcc0
{
assert(session);
- if (uid != session->uid && gid != session->gid && uid != 0) {
+ if (uid == 0) {
+ return 1;
+ }
+
+ return uid == session->uid && gid == session->gid;
+
+ if ((uid != session->uid || gid != session->gid) && uid != 0) {
return 0;
} else {
return 1;