From nobody Tue Jan 9 20:40:59 2024 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8jWJ6QWNz56Xv4 for ; Tue, 9 Jan 2024 20:41:00 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4T8jWJ5J0Nz4sqh; Tue, 9 Jan 2024 20:41:00 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by glebi.us (Postfix, from userid 1000) id C06826A583; Tue, 9 Jan 2024 12:40:59 -0800 (PST) Date: Tue, 9 Jan 2024 12:40:59 -0800 From: Gleb Smirnoff To: Rainer Hurling Cc: freebsd-current@freebsd.org Subject: Re: kernel: fatal trap 12 on CURRENT, when using WireGuard Message-ID: References: <423b62fc-6687-4e56-b8e7-ecaebcadfd7f@gwdg.de> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Bg+iM+vkVc6+oo40" Content-Disposition: inline In-Reply-To: <423b62fc-6687-4e56-b8e7-ecaebcadfd7f@gwdg.de> X-Rspamd-Queue-Id: 4T8jWJ5J0Nz4sqh X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] --Bg+iM+vkVc6+oo40 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Rainer, On Tue, Jan 09, 2024 at 09:23:54PM +0100, Rainer Hurling wrote: R> I tried to update my 15.0-CURRENT box from n267335-499e84e16f56 to a very R> recent commit. The build and install went fine. After booting with new R> base, I got a page fault with the following error: Sorry for that, my fault. Can you please test this patch? -- Gleb Smirnoff --Bg+iM+vkVc6+oo40 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="n.diff" diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index 7660dcada103..4790845d1d31 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -233,7 +233,7 @@ nl_send_group(struct nl_writer *nw) copy = nl_buf_copy(nb); if (copy != NULL) { nw->buf = copy; - (void)nl_send_one(nw); + (void)nl_send(nw, nlp_last); } else { NLP_LOCK(nlp_last); if (nlp_last->nl_socket != NULL) @@ -246,7 +246,7 @@ nl_send_group(struct nl_writer *nw) } if (nlp_last != NULL) { nw->buf = nb; - (void)nl_send_one(nw); + (void)nl_send(nw, nlp_last); } else nl_buf_free(nb); diff --git a/sys/netlink/netlink_io.c b/sys/netlink/netlink_io.c index fb8e0a46e8dd..5f50c40f71d8 100644 --- a/sys/netlink/netlink_io.c +++ b/sys/netlink/netlink_io.c @@ -194,9 +194,8 @@ nl_taskqueue_handler(void *_arg, int pending) * If no queue overrunes happened, wakes up socket owner. */ bool -nl_send_one(struct nl_writer *nw) +nl_send(struct nl_writer *nw, struct nlpcb *nlp) { - struct nlpcb *nlp = nw->nlp; struct socket *so = nlp->nl_socket; struct sockbuf *sb = &so->so_rcv; struct nl_buf *nb; diff --git a/sys/netlink/netlink_message_writer.c b/sys/netlink/netlink_message_writer.c index 0b85378b41b6..50305e3d9d80 100644 --- a/sys/netlink/netlink_message_writer.c +++ b/sys/netlink/netlink_message_writer.c @@ -65,6 +65,13 @@ nlmsg_get_buf(struct nl_writer *nw, u_int len, bool waitok) return (true); } +static bool +nl_send_one(struct nl_writer *nw) +{ + + return (nl_send(nw, nw->nlp)); +} + bool _nlmsg_get_unicast_writer(struct nl_writer *nw, int size, struct nlpcb *nlp) { diff --git a/sys/netlink/netlink_var.h b/sys/netlink/netlink_var.h index c8f0d02a0dab..ddf30b373446 100644 --- a/sys/netlink/netlink_var.h +++ b/sys/netlink/netlink_var.h @@ -130,9 +130,7 @@ void nl_osd_unregister(void); void nl_set_thread_nlp(struct thread *td, struct nlpcb *nlp); /* netlink_io.c */ -#define NL_IOF_UNTRANSLATED 0x01 -#define NL_IOF_IGNORE_LIMIT 0x02 -bool nl_send_one(struct nl_writer *); +bool nl_send(struct nl_writer *, struct nlpcb *); void nlmsg_ack(struct nlpcb *nlp, int error, struct nlmsghdr *nlmsg, struct nl_pstate *npt); void nl_on_transmit(struct nlpcb *nlp); --Bg+iM+vkVc6+oo40--