diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2022-02-25 23:51:05 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2022-02-25 23:51:05 +0000 |
commit | 35d935e7af10bc634f79c37722158ba200732393 (patch) | |
tree | 204598a1369d152503cd594dbe6d3ad5b7dd1630 /sys/net/pfkeyv2.c | |
parent | 4f8344a22bf26c93d3595f04fc892a8bb47e268a (diff) |
Reported-by: syzbot+1b5b209ce506db4d411d@syzkaller.appspotmail.com
Revert the pr_usrreqs move: syzkaller found a NULL pointer deref
and I won't be available to monitor for followup issues for a bit
Diffstat (limited to 'sys/net/pfkeyv2.c')
-rw-r--r-- | sys/net/pfkeyv2.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c index fc08630cfb6..f89f1449f1f 100644 --- a/sys/net/pfkeyv2.c +++ b/sys/net/pfkeyv2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2.c,v 1.230 2022/02/25 08:36:01 guenther Exp $ */ +/* $OpenBSD: pfkeyv2.c,v 1.231 2022/02/25 23:51:03 guenther Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 @@ -199,11 +199,6 @@ pfdatatopacket(void *data, int len, struct mbuf **packet) return (0); } -const struct pr_usrreqs pfkeyv2_usrreqs = { - .pru_attach = pfkeyv2_attach, - .pru_detach = pfkeyv2_detach, -}; - const struct protosw pfkeysw[] = { { .pr_type = SOCK_RAW, @@ -212,7 +207,8 @@ const struct protosw pfkeysw[] = { .pr_flags = PR_ATOMIC | PR_ADDR, .pr_output = pfkeyv2_output, .pr_usrreq = pfkeyv2_usrreq, - .pr_usrreqs = &pfkeyv2_usrreqs, + .pr_attach = pfkeyv2_attach, + .pr_detach = pfkeyv2_detach, .pr_sysctl = pfkeyv2_sysctl, } }; @@ -339,6 +335,9 @@ pfkeyv2_usrreq(struct socket *so, int req, struct mbuf *m, struct pkpcb *kp; int error = 0; + if (req == PRU_CONTROL) + return (EOPNOTSUPP); + soassertlocked(so); if (control && control->m_len) { |