Closed WOnder93 closed 6 years ago
I submitted patches for this issue here: https://www.redhat.com/archives/linux-audit/2018-May/msg00095.html https://www.redhat.com/archives/linux-audit/2018-May/msg00096.html
In the end I just replaced the in_[e]group_p
functions with search_groups
calls as this is the only part of the in_[e]group_p
implementations that wasn't already covered by the main comparison. For more details please see the related discussion in the mailing list.
Fixed upstream in 5b71388663c0920848c0ee7de946970a2692b76d and af85d1772e31fed34165a1b3decef340cf4080c0.
The function
audit_filter_rules
accepts astruct task_struct *tsk
parameter, which can be different fromcurrent
(representing the currently executing task). However, in some placescurrent
is used instead oftsk
.s/current/tsk/:
These two comparisons call the
in_group_p
/in_egroup_p
functions which implicitly use thecurrent
variable:They should be replaced by functions that use the
struct cred
data fromtsk
. Since the kernel currently doesn't provide a function that would accept a user providedstruct cred *
, they either need to be added toinclude/linux/cred.h
andkernel/groups.c
or open coded in the audit code (it's just a few lines of code... still it is probably better to add them globally).Original ML discussion: https://www.redhat.com/archives/linux-audit/2018-May/msg00084.html Quick link to
in_group_p
implementation: https://elixir.bootlin.com/linux/v4.17-rc5/source/kernel/groups.c#L219