git: 0c864213ef1e - main - iflib: Fix a NULL pointer deref
Andrew Gallatin
gallatin at FreeBSD.org
Thu Jan 21 14:48:08 UTC 2021
The branch main has been updated by gallatin:
URL: https://cgit.FreeBSD.org/src/commit/?id=0c864213ef1ee440411e3bb6437ecc04273db86b
commit 0c864213ef1ee440411e3bb6437ecc04273db86b
Author: Andrew Gallatin <gallatin at FreeBSD.org>
AuthorDate: 2021-01-21 14:45:15 +0000
Commit: Andrew Gallatin <gallatin at 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)
More information about the dev-commits-src-main
mailing list