Author: kp
Date: Tue Nov 24 17:32:49 2020
New Revision: 367990
URL: https://svnweb.freebsd.org/changeset/base/367990

Log:
  pf tests: provoke tag hashing panic
  
  Attempt to provoke the panic fixed in r367987.
  
  MFC after:    1 week
  Differential Revision:        https://reviews.freebsd.org/D27350

Modified:
  head/tests/sys/netpfil/pf/ioctl/validation.c

Modified: head/tests/sys/netpfil/pf/ioctl/validation.c
==============================================================================
--- head/tests/sys/netpfil/pf/ioctl/validation.c        Tue Nov 24 17:13:08 
2020        (r367989)
+++ head/tests/sys/netpfil/pf/ioctl/validation.c        Tue Nov 24 17:32:49 
2020        (r367990)
@@ -790,6 +790,43 @@ ATF_TC_CLEANUP(getsrcnodes, tc)
        COMMON_CLEANUP();
 }
 
+ATF_TC_WITH_CLEANUP(tag);
+ATF_TC_HEAD(tag, tc)
+{
+       atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(tag, tc)
+{
+       struct pfioc_rule rule;
+
+       COMMON_HEAD();
+
+       memset(&rule, 0x42, sizeof(rule));
+
+       rule.ticket = 0;
+       rule.pool_ticket = 0;
+       rule.anchor[0] = 0;
+
+       rule.rule.return_icmp = 0;
+       bzero(&rule.rule.src, sizeof(rule.rule.src));
+       bzero(&rule.rule.dst, sizeof(rule.rule.dst));
+
+       rule.rule.ifname[0] = 0;
+       rule.rule.action = 0;
+       rule.rule.rtableid = 0;
+
+       rule.rule.tagname[0] = 0;
+
+       for (int i = 0; i < 10; i++)
+               ioctl(dev, DIOCADDRULE, &rule);
+}
+
+ATF_TC_CLEANUP(tag, tc)
+{
+       COMMON_CLEANUP();
+}
+
 ATF_TP_ADD_TCS(tp)
 {
        ATF_TP_ADD_TC(tp, addtables);
@@ -811,6 +848,7 @@ ATF_TP_ADD_TCS(tp)
        ATF_TP_ADD_TC(tp, cxrollback);
        ATF_TP_ADD_TC(tp, commit);
        ATF_TP_ADD_TC(tp, getsrcnodes);
+       ATF_TP_ADD_TC(tp, tag);
 
        return (atf_no_error());
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to