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) {
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to