Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jul 2016 20:39:37 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r302453 - stable/10/usr.sbin/rpcbind
Message-ID:  <201607082039.u68Kdb7R053948@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Fri Jul  8 20:39:37 2016
New Revision: 302453
URL: https://svnweb.freebsd.org/changeset/base/302453

Log:
  MFC r301605:
  
  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.
  
  CID: 1007567

Modified:
  stable/10/usr.sbin/rpcbind/rpcb_stat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/rpcbind/rpcb_stat.c
==============================================================================
--- stable/10/usr.sbin/rpcbind/rpcb_stat.c	Fri Jul  8 20:33:20 2016	(r302452)
+++ stable/10/usr.sbin/rpcbind/rpcb_stat.c	Fri Jul  8 20:39:37 2016	(r302453)
@@ -152,7 +152,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?201607082039.u68Kdb7R053948>