From: Paul Moore <paul@paul-moore.com>
To: Zhen Lei <thunder.leizhen@huawei.com>,
Stephen Smalley <stephen.smalley.work@gmail.com>,
Ondrej Mosnacek <omosnace@redhat.com>, <selinux@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: Zhen Lei <thunder.leizhen@huawei.com>
Subject: Re: [PATCH 1/1] selinux: simplify avc_xperms_audit_required()
Date: Wed, 28 Aug 2024 13:42:09 -0400 [thread overview]
Message-ID: <f3e7f421323bb99c12507299a658d572@paul-moore.com> (raw)
In-Reply-To: <20240822140858.1998-1-thunder.leizhen@huawei.com>
On Aug 22, 2024 Zhen Lei <thunder.leizhen@huawei.com> wrote:
>
> By associative and commutative laws, the result of the two 'audited' is
> zero. Take the second 'audited' as an example:
> 1) audited = requested & avd->auditallow;
> 2) audited &= ~requested;
> ==> audited = ~requested & (requested & avd->auditallow);
> ==> audited = (~requested & requested) & avd->auditallow;
> ==> audited = 0 & avd->auditallow;
> ==> audited = 0;
>
> In fact, it is more readable to directly write zero. The value of the
> first 'audited' is 0 because AUDIT is not allowed. The second 'audited'
> is zero because there is no AUDITALLOW permission.
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
> security/selinux/avc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Looks good to me, merged into selinux/dev, thanks!
--
paul-moore.com
prev parent reply other threads:[~2024-08-28 17:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 14:08 Zhen Lei
2024-08-28 17:42 ` Paul Moore [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f3e7f421323bb99c12507299a658d572@paul-moore.com \
--to=paul@paul-moore.com \
--cc=linux-kernel@vger.kernel.org \
--cc=omosnace@redhat.com \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.com \
--cc=thunder.leizhen@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®