[PATCH][next] apparmor: Fix incorrect profile->signal range check
John Johansen
john.johansen at canonical.com
Sat May 17 08:44:13 UTC 2025
On 5/6/25 10:07, Ryan Lee wrote:
> On Tue, May 6, 2025 at 10:04 AM Colin Ian King <colin.i.king at 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 at 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 at canonical.com>
>
Acked-by: John Johansen <john.johansen at canonical.com>
I have pulled this into my tree
More information about the Linux-security-module-archive
mailing list