From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
Subject: [PATCH net 4/5] wireguard: receive: remove dead code from default packet type case
Date: Wed, 18 Mar 2020 18:30:46 -0600 [thread overview]
Message-ID: <20200319003047.113501-5-Jason@zx2c4.com> (raw)
In-Reply-To: <20200319003047.113501-1-Jason@zx2c4.com>
The situation in which we wind up hitting the default case here
indicates a major bug in earlier parsing code. It is not a usual thing
that should ever happen, which means a "friendly" message for it doesn't
make sense. Rather, replace this with a WARN_ON, just like we do earlier
in the file for a similar situation, so that somebody sends us a bug
report and we can fix it.
Reported-by: Fabian Freyer <fabianfreyer@radicallyopensecurity.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
drivers/net/wireguard/receive.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireguard/receive.c b/drivers/net/wireguard/receive.c
index 243ed7172dd2..da3b782ab7d3 100644
--- a/drivers/net/wireguard/receive.c
+++ b/drivers/net/wireguard/receive.c
@@ -587,8 +587,7 @@ void wg_packet_receive(struct wg_device *wg, struct sk_buff *skb)
wg_packet_consume_data(wg, skb);
break;
default:
- net_dbg_skb_ratelimited("%s: Invalid packet from %pISpfsc\n",
- wg->dev->name, skb);
+ WARN(1, "Non-exhaustive parsing of packet header lead to unknown packet type!\n");
goto err;
}
return;
--
2.25.1
next prev parent reply other threads:[~2020-03-19 0:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-19 0:30 [PATCH net 0/5] wireguard fixes for 5.6-rc7 Jason A. Donenfeld
2020-03-19 0:30 ` [PATCH net 1/5] wireguard: selftests: remove duplicated include <sys/types.h> Jason A. Donenfeld
2020-03-19 0:30 ` [PATCH net 2/5] wireguard: selftests: test using new 64-bit time_t Jason A. Donenfeld
2020-03-19 0:30 ` [PATCH net 3/5] wireguard: queueing: account for skb->protocol==0 Jason A. Donenfeld
2020-03-19 0:30 ` Jason A. Donenfeld [this message]
2020-03-19 0:30 ` [PATCH net 5/5] wireguard: noise: error out precomputed DH during handshake rather than config Jason A. Donenfeld
2020-03-19 1:54 ` [PATCH net 0/5] wireguard fixes for 5.6-rc7 David Miller
2020-03-19 2:30 ` Jason A. Donenfeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200319003047.113501-5-Jason@zx2c4.com \
--to=jason@zx2c4.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).