Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Apr 2019 15:03:00 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r346638 - stable/12/tests/sys/netpfil/pf/ioctl
Message-ID:  <201904241503.x3OF30MB096939@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Wed Apr 24 15:02:59 2019
New Revision: 346638
URL: https://svnweb.freebsd.org/changeset/base/346638

Log:
  MFC r346320:
  
  pf tests: Try to provoke the panic with invalid DIOCRSETTFLAGS
  
  There was an issue with copyin() on DIOCRSETTFLAGS, which would panic if
  pfrio_buffer was NULL.
  Test for the issue fixed in r346319.

Modified:
  stable/12/tests/sys/netpfil/pf/ioctl/validation.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/netpfil/pf/ioctl/validation.c
==============================================================================
--- stable/12/tests/sys/netpfil/pf/ioctl/validation.c	Wed Apr 24 14:25:35 2019	(r346637)
+++ stable/12/tests/sys/netpfil/pf/ioctl/validation.c	Wed Apr 24 15:02:59 2019	(r346638)
@@ -305,6 +305,11 @@ ATF_TC_BODY(settflags, tc)
 	io.pfrio_size = 1 << 28;
 	if (ioctl(dev, DIOCRSETTFLAGS, &io) != 0)
 		atf_tc_fail("Request with size 1 << 24 failed");
+
+	/* NULL buffer */
+	io.pfrio_buffer = NULL;
+	if (ioctl(dev, DIOCRSETTFLAGS, &io) != -1)
+		atf_tc_fail("Request with NULL buffer succeeded");
 }
 
 ATF_TC_CLEANUP(settflags, tc)



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