From: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
To: john.johansen@canonical.com, apparmor@lists.ubuntu.com
Cc: paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org,
Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Subject: [PATCH security] apparmor: fix logical error in signal range validation
Date: Tue, 21 Jan 2025 15:41:38 +0530 [thread overview]
Message-ID: <20250121101138.116675-1-dheeraj.linuxdev@gmail.com> (raw)
Fix logically impossible condition in unpack_profile() that made the
signal validation code unreachable. The function was using && instead
of || when checking if the signal value is outside the valid range,
making it impossible for both conditions to be true simultaneously.
Update the condition to ensure proper range validation.
Fixes: 84c455decf27 ("apparmor: add support for profiles to define the kill signal")
Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@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.34.1
reply other threads:[~2025-01-21 10:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250121101138.116675-1-dheeraj.linuxdev@gmail.com \
--to=dheeraj.linuxdev@gmail.com \
--cc=apparmor@lists.ubuntu.com \
--cc=jmorris@namei.org \
--cc=john.johansen@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.