From: John Johansen <john.johansen@canonical.com>
To: Ryan Lee <ryan.lee@canonical.com>,
Colin Ian King <colin.i.king@gmail.com>
Cc: Paul Moore <paul@paul-moore.com>,
James Morris <jmorris@namei.org>,
"Serge E . Hallyn" <serge@hallyn.com>,
apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] apparmor: Fix incorrect profile->signal range check
Date: Sat, 17 May 2025 01:44:13 -0700 [thread overview]
Message-ID: <68375b67-3930-4f54-8a66-e0b071a90110@canonical.com> (raw)
In-Reply-To: <CAKCV-6uAdn9SvUFrYqGo0ZzJUtPAYgRFcfHPgmrG_GDt2Ob6Hg@mail.gmail.com>
On 5/6/25 10:07, Ryan Lee wrote:
> On Tue, May 6, 2025 at 10:04 AM Colin Ian King <colin.i.king@gmail.com> wrote:
>>
>> The check on profile->signal is always false, the value can never be
>> less than 1 *and* greater than MAXMAPPED_SIG. Fix this by replacing
>> the logical operator && with ||.
>>
>> Fixes: 84c455decf27 ("apparmor: add support for profiles to define the kill signal")
>> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>> ---
>> security/apparmor/policy_unpack.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
>> index 73139189df0f..e643514a3d92 100644
>> --- a/security/apparmor/policy_unpack.c
>> +++ b/security/apparmor/policy_unpack.c
>> @@ -919,7 +919,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)
>>
>> /* optional */
>> (void) aa_unpack_u32(e, &profile->signal, "kill");
>> - if (profile->signal < 1 && profile->signal > MAXMAPPED_SIG) {
>> + if (profile->signal < 1 || profile->signal > MAXMAPPED_SIG) {
>> info = "profile kill.signal invalid value";
>> goto fail;
>> }
>> --
>> 2.49.0
> Reviewed-by: Ryan Lee <ryan.lee@canonical.com>
>
Acked-by: John Johansen <john.johansen@canonical.com>
I have pulled this into my tree
prev parent reply other threads:[~2025-05-17 8:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 17:04 Colin Ian King
2025-05-06 17:07 ` Ryan Lee
2025-05-17 8:44 ` John Johansen [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=68375b67-3930-4f54-8a66-e0b071a90110@canonical.com \
--to=john.johansen@canonical.com \
--cc=apparmor@lists.ubuntu.com \
--cc=colin.i.king@gmail.com \
--cc=jmorris@namei.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=ryan.lee@canonical.com \
--cc=serge@hallyn.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®