From c47b65840024153f6a1c931d6c7c772b3482a0a4 Mon Sep 17 00:00:00 2001 From: Tóth János Date: Thu, 6 Jul 2023 15:42:47 +0200 Subject: security: smack: smackfs: fix typo (lables->labels) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a spelling error in smakcfs. Signed-off-by: Tóth János Signed-off-by: Casey Schaufler --- security/smack/smackfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'security/smack') diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 5590eaad241b..2b79c30d4bb6 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -114,7 +114,7 @@ struct smack_known *smack_syslog_label; * SMACK_PTRACE_DEFAULT regular smack ptrace rules (/proc based) * SMACK_PTRACE_EXACT labels must match, but can be overriden with * CAP_SYS_PTRACE - * SMACK_PTRACE_DRACONIAN lables must match, CAP_SYS_PTRACE has no effect + * SMACK_PTRACE_DRACONIAN labels must match, CAP_SYS_PTRACE has no effect */ int smack_ptrace_rule = SMACK_PTRACE_DEFAULT; -- cgit From 3ad49d37cf5759c3b8b68d02e3563f633d9c1aee Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 6 Jul 2023 08:52:39 +0300 Subject: smackfs: Prevent underflow in smk_set_cipso() There is a upper bound to "catlen" but no lower bound to prevent negatives. I don't see that this necessarily causes a problem but we may as well be safe. Fixes: e114e473771c ("Smack: Simplified Mandatory Access Control Kernel") Signed-off-by: Dan Carpenter Signed-off-by: Casey Schaufler --- security/smack/smackfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'security/smack') diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 2b79c30d4bb6..e22aad7604e8 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -896,7 +896,7 @@ static ssize_t smk_set_cipso(struct file *file, const char __user *buf, } ret = sscanf(rule, "%d", &catlen); - if (ret != 1 || catlen > SMACK_CIPSO_MAXCATNUM) + if (ret != 1 || catlen < 0 || catlen > SMACK_CIPSO_MAXCATNUM) goto out; if (format == SMK_FIXED24_FMT && -- cgit