Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jan 2021 14:48:07 GMT
From:      Andrew Gallatin <gallatin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0c864213ef1e - main - iflib: Fix a NULL pointer deref
Message-ID:  <202101211448.10LEm79w096514@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by gallatin:

URL: https://cgit.FreeBSD.org/src/commit/?id=0c864213ef1ee440411e3bb6437ecc04273db86b

commit 0c864213ef1ee440411e3bb6437ecc04273db86b
Author:     Andrew Gallatin <gallatin@FreeBSD.org>
AuthorDate: 2021-01-21 14:45:15 +0000
Commit:     Andrew Gallatin <gallatin@FreeBSD.org>
CommitDate: 2021-01-21 14:47:06 +0000

    iflib: Fix a NULL pointer deref
    
    rxd_frag_to_sd() have pf_rv parameter as NULL with the current
    code. This patch fixes the NULL pointer dereference in that
    case thus avoiding a possible panic.
    
    Submitted by: rajesh1.kumar at amd.com
    Reviewed by: gallatin
    Differential Revision: https://reviews.freebsd.org/D28115
---
 sys/net/iflib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index 4b4952122d1e..ea2c5789a7b5 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -2654,7 +2654,8 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, bool unload, if_rxsd_t sd,
 		}
 	} else {
 		fl->ifl_sds.ifsd_m[cidx] = NULL;
-		*pf_rv = PFIL_PASS;
+		if (pf_rv != NULL)
+			*pf_rv = PFIL_PASS;
 	}
 
 	if (unload && irf->irf_len != 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101211448.10LEm79w096514>