lkml.org 
[lkml]   [2022]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] selinux: declare read-only parameters const
On Tue, Aug 30, 2022 at 11:53 AM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
> Declare ebitmap, mls_level and mls_context parameters const where they
> are only read from. This allows callers to supply pointers to const
> as arguments and increases readability.
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
> ---
> This patch is similar to userspace commits ("libsepol: mark read-only
> parameters of ebitmap interfaces const") [1] and ("libsepol: mark
> immutable mls and context parameter const") [2].
> Pointers to const are for example used in the (for now userspace only)
> policy validation code.
>
> [1]: https://github.com/SELinuxProject/selinux/commit/390ec54d278a14d9c29b80cc4fc5cb9ba504ed13
> [2]: https://github.com/SELinuxProject/selinux/commit/6359946633507db1d98b24638cf22eb5afdcd272
> ---
> security/selinux/ss/context.h | 17 +++++++++--------
> security/selinux/ss/ebitmap.c | 21 +++++++++++----------
> security/selinux/ss/ebitmap.h | 18 +++++++++---------
> security/selinux/ss/mls_types.h | 4 ++--
> 4 files changed, 31 insertions(+), 29 deletions(-)

Merged into selinux/next, thanks!

--
paul-moore.com

\
 
 \ /
  Last update: 2022-08-30 23:17    [W:0.037 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site