Date: Wed, 8 Jun 2016 12:45:22 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301605 - head/usr.sbin/rpcbind Message-ID: <201606081245.u58CjMPh021630@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Wed Jun 8 12:45:22 2016 New Revision: 301605 URL: https://svnweb.freebsd.org/changeset/base/301605 Log: Bounds check rpcbs_rmtcall(..) to ensure rtype is less than RPCBVERS_STAT Not returning if rtype == RPCBVERS_STAT will cause us to overrun the inf array, as it's defined to be exactly RPCBVERS_STAT elements in rpcb_prot.x: > include/rpc/rpcb_prot.x:typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT]; The proposed change also matches the rest of the rtype upper bound checks in the file, so the original change was likely a typo. MFC after: 2 weeks Reported by: Coverity CID: 1007567 Reviewed by: truckman Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/rpcb_stat.c Modified: head/usr.sbin/rpcbind/rpcb_stat.c ============================================================================== --- head/usr.sbin/rpcbind/rpcb_stat.c Wed Jun 8 12:40:21 2016 (r301604) +++ head/usr.sbin/rpcbind/rpcb_stat.c Wed Jun 8 12:45:22 2016 (r301605) @@ -151,7 +151,7 @@ rpcbs_rmtcall(rpcvers_t rtype, rpcproc_t rpcbs_rmtcalllist *rl; struct netconfig *nconf; - if (rtype > RPCBVERS_STAT) + if (rtype >= RPCBVERS_STAT) return; for (rl = inf[rtype].rmtinfo; rl; rl = rl->next) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606081245.u58CjMPh021630>