Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 pr_send can be given a NULL lwp. It looks like the



details:   https://anonhg.NetBSD.org/src/rev/8e932e0be006
branches:  trunk
changeset: 359380:8e932e0be006
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Feb 08 11:49:37 2018 +0000

description:
pr_send can be given a NULL lwp. It looks like the

        control != NULL && lwp == NULL

condition is never supposed to happen, but add a panic for safety.

diffstat:

 sys/netinet6/udp6_usrreq.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r bffd29928aef -r 8e932e0be006 sys/netinet6/udp6_usrreq.c
--- a/sys/netinet6/udp6_usrreq.c        Thu Feb 08 11:34:35 2018 +0000
+++ b/sys/netinet6/udp6_usrreq.c        Thu Feb 08 11:49:37 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udp6_usrreq.c,v 1.132 2018/02/08 11:34:35 maxv Exp $ */
+/* $NetBSD: udp6_usrreq.c,v 1.133 2018/02/08 11:49:37 maxv Exp $ */
 /* $KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $ */
 /* $KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $ */
 
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.132 2018/02/08 11:34:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.133 2018/02/08 11:49:37 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -708,6 +708,9 @@
        }
 
        if (control) {
+               if (__predict_false(l == NULL)) {
+                       panic("%s: control but no lwp", __func__);
+               }
                if ((error = ip6_setpktopts(control, &opt,
                    in6p->in6p_outputopts, l->l_cred, IPPROTO_UDP)) != 0)
                        goto release;



Home | Main Index | Thread Index | Old Index