On 06/21/2018 01:33 AM, Ondrej Mosnacek wrote:
The groups-related functions declared in include/linux/cred.h are
defined in kernel/groups.c, which is compiled only when
CONFIG_MULTIUSER=y. Move all these function declarations under #ifdef
CONFIG_MULTIUSER to help avoid accidental usage in contexts where
CONFIG_MULTIUSER might be disabled.
This patch also adds a fallback for groups_search(). Currently this
function is only called from kernel/groups.c itself and
keys/permissions.c, which depends on CONFIG_MULTIUSER. However, the
audit subsystem (which does not depend on CONFIG_MULTIUSER) calls this
function in -next, so the fallback will be needed to avoid compilation
errors or ugly workarounds.
See also:
https://lkml.org/lkml/2018/6/20/670
https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git/commit/...
Reported-by: Randy Dunlap <rdunlap(a)infradead.org>
Signed-off-by: Ondrej Mosnacek <omosnace(a)redhat.com>
Tested-by: Randy Dunlap <rdunlap(a)infradead.org>
Thanks.
---
include/linux/cred.h | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
--
~Randy