svn commit: r342305 - stable/12/sys/dev/sfxge/common

Andrew Rybchenko arybchik at FreeBSD.org
Fri Dec 21 14:53:51 UTC 2018


Author: arybchik
Date: Fri Dec 21 14:53:50 2018
New Revision: 342305
URL: https://svnweb.freebsd.org/changeset/base/342305

Log:
  MFC r340797
  
  sfxge(4): fix potential buffer overflow in Tx queue init
  
  Improve error checking to avoid a caller overflowing the MCDI
  request buffer if the requested TXQ size was excessively large.
  
  Submitted by:   Andy Moreton <amoreton at solarflare.com>
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18067

Modified:
  stable/12/sys/dev/sfxge/common/ef10_tx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c
==============================================================================
--- stable/12/sys/dev/sfxge/common/ef10_tx.c	Fri Dec 21 14:52:46 2018	(r342304)
+++ stable/12/sys/dev/sfxge/common/ef10_tx.c	Fri Dec 21 14:53:50 2018	(r342305)
@@ -70,7 +70,7 @@ efx_mcdi_init_txq(
 	    EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs));
 
 	npages = EFX_TXQ_NBUFS(size);
-	if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) {
+	if (MC_CMD_INIT_TXQ_IN_LEN(npages) > sizeof (payload)) {
 		rc = EINVAL;
 		goto fail1;
 	}


More information about the svn-src-stable mailing list