lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  4 Feb 2011 22:38:55 +0200
From:	Lucian Adrian Grijincu <lucian.grijincu@...il.com>
To:	linux-kernel@...r.kernel.org,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	Lucian Adrian Grijincu <lucian.grijincu@...il.com>
Subject: [PATCH] sysctl: fix binary sysctl overflow

We allocated a vector of CTL_MAXNAME elements and considered
[0, CTL_MAXNAME] as valid indexes in the vector.

This fixes valid index range to be [0, CTL_MAXNAME).

I guess this should be backported to stable trees too.

Signed-off-by: Lucian Adrian Grijincu <lucian.grijincu@...il.com>
---
 kernel/sysctl_binary.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c
index b875bed..e2f377c 100644
--- a/kernel/sysctl_binary.c
+++ b/kernel/sysctl_binary.c
@@ -1446,7 +1446,7 @@ static ssize_t do_sysctl(int __user *args_name, int nlen,
 	int i;
 
 	/* Check args->nlen. */
-	if (nlen < 0 || nlen > CTL_MAXNAME)
+	if (nlen < 0 || nlen >= CTL_MAXNAME)
 		return -ENOTDIR;
 	/* Read in the sysctl name for simplicity */
 	for (i = 0; i < nlen; i++)
-- 
1.7.4.rc1.7.g2cf08.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists