From: Paul Moore <paul@paul-moore.com>
To: Ondrej Mosnacek <omosnace@redhat.com>
Cc: selinux@vger.kernel.org, Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH] selinux: clarify return code in filename_trans_read_helper_compat()
Date: Thu, 04 Apr 2024 16:38:35 -0400 [thread overview]
Message-ID: <1bf08f31513935dc011115e0ab912818@paul-moore.com> (raw)
In-Reply-To: <20240404151619.868283-1-omosnace@redhat.com>
On Apr 4, 2024 Ondrej Mosnacek <omosnace@redhat.com> wrote:
>
> For the "conflicting/duplicate rules" branch in
> filename_trans_read_helper_compat() the Smatch static checker reports:
>
> security/selinux/ss/policydb.c:1953 filename_trans_read_helper_compat()
> warn: missing error code 'rc'
>
> While the value of rc will already always be zero here, it is not
> obvious that it's the case and that it's the intended return value
> (Smatch expects rc to be assigned within 5 lines from the goto).
> Therefore, add an explicit assignment just before the goto to make the
> intent more clear and the code less error-prone.
>
> Fixes: c3a276111ea2 ("selinux: optimize storage of filename transitions")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Link: https://lore.kernel.org/selinux/722b90c4-1f4b-42ff-a6c2-108ea262bd10@moroto.mountain/
> Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
> ---
> security/selinux/ss/policydb.c | 1 +
> 1 file changed, 1 insertion(+)
As this really only impacts static analysis I don't think this rises to
the level of warranting a stable tag so I'm going to merge this via the
selinux/dev branch. Thanks everyone!
--
paul-moore.com
prev parent reply other threads:[~2024-04-04 20:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-04 15:16 [PATCH] selinux: clarify return code in filename_trans_read_helper_compat() Ondrej Mosnacek
2024-04-04 20:38 ` 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=1bf08f31513935dc011115e0ab912818@paul-moore.com \
--to=paul@paul-moore.com \
--cc=dan.carpenter@linaro.org \
--cc=omosnace@redhat.com \
--cc=selinux@vger.kernel.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).