From 3fd53c22727dccc51ed47e3617c5114ef9e67a6d Mon Sep 17 00:00:00 2001 From: cperciva Date: Wed, 20 Apr 2011 21:00:24 +0000 Subject: [PATCH] Fix CIDR parsing bug in mountd ACLs. Approved by: so (cperciva) Security: FreeBSD-SA-11:01.mountd git-svn-id: svn://svn.freebsd.org/base/releng/8.2@220901 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- UPDATING | 3 +++ sys/conf/newvers.sh | 2 +- usr.sbin/mountd/mountd.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/UPDATING b/UPDATING index 1e95278f..198fee4e 100644 --- a/UPDATING +++ b/UPDATING @@ -15,6 +15,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW ON IA64 OR SUN4V: debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20110420: p1 FreeBSD-SA-11:01.mountd + Fix CIDR parsing bug in mountd ACLs. + 20110221: 8.2-RELEASE. diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index d9301866..91070a13 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.2" -BRANCH="RELEASE" +BRANCH="RELEASE-p1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 41a845f5..f858a05f 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -2937,7 +2937,7 @@ makemask(struct sockaddr_storage *ssp, int bitlen) for (i = 0; i < len; i++) { bits = (bitlen > CHAR_BIT) ? CHAR_BIT : bitlen; - *p++ = (1 << bits) - 1; + *p++ = (u_char)~0 << (CHAR_BIT - bits); bitlen -= bits; } return 0; -- 2.42.0