On Wed, Nov 9, 2022 at 5:02 AM Paul Moore <paul@xxxxxxxxxxxxxx> wrote: > The sidtab conversion code has support for multiple context > conversion routines through the use of function pointers and > indirect calls. However, the reality is that all current users rely > on the same conversion routine: convert_context(). This patch does > away with this extra complexity and replaces the indirect calls > with direct function calls; allowing us to remove a layer of > obfuscation and create cleaner, more maintainable code. > > Signed-off-by: Paul Moore <paul@xxxxxxxxxxxxxx> > --- > security/selinux/ss/services.c | 51 ++++++++++++++-------------------- > security/selinux/ss/services.h | 14 ++++++++-- > security/selinux/ss/sidtab.c | 21 ++++++++------ > security/selinux/ss/sidtab.h | 3 +- > 4 files changed, 45 insertions(+), 44 deletions(-) The goal of the callback abstraction was to avoid the awkward coupling between services.c and sidtab.c, but both ways are ugly in some way, so I consider it a matter of maintainer preference. So if you prefer this version, feel free to go with it :) Reviewed-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx> -- Ondrej Mosnacek Senior Software Engineer, Linux Security - SELinux kernel Red Hat, Inc.