Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jan 2021 16:24:35 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2cc2177bca0e - stable/12 - pf tests: pass NULL buffer to DIOCRCLRTSTATS
Message-ID:  <202101201624.10KGOZaD049786@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=2cc2177bca0eb84a268c9ce36427537dc3c76822

commit 2cc2177bca0eb84a268c9ce36427537dc3c76822
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2021-01-13 18:41:07 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2021-01-20 14:46:00 +0000

    pf tests: pass NULL buffer to DIOCRCLRTSTATS
    
    As discovered by syzcaller this used to provoke panics.
    
    MFC after:      1 week
    
    (cherry picked from commit 44117554b1ee8edd66d7383c17802d5799fd18f2)
---
 tests/sys/netpfil/pf/ioctl/validation.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/sys/netpfil/pf/ioctl/validation.c b/tests/sys/netpfil/pf/ioctl/validation.c
index 5b1f61720f66..0d7f7631e91b 100644
--- a/tests/sys/netpfil/pf/ioctl/validation.c
+++ b/tests/sys/netpfil/pf/ioctl/validation.c
@@ -265,6 +265,11 @@ ATF_TC_BODY(clrtstats, tc)
 	io.pfrio_size = 1 << 24;
 	if (ioctl(dev, DIOCRCLRTSTATS, &io) != 0)
 		atf_tc_fail("Request with size 1 << 24 failed");
+
+	io.pfrio_size = sizeof(tbl);
+	io.pfrio_buffer = NULL;
+	if (ioctl(dev, DIOCRCLRTSTATS, &io) == 0)
+		atf_tc_fail("Request with NULL buffer succeeded");
 }
 
 ATF_TC_CLEANUP(clrtstats, tc)



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