Skip to content

Commit

Permalink
Merge branch 'wireguard-patches-for-5-18-rc4'
Browse files Browse the repository at this point in the history
Jason A. Donenfeld says:

====================
wireguard patches for 5.18-rc4

Here are two small wireguard fixes for 5.18-rc4:

1) We enable ACPI in the QEMU test harness, so that multiple CPUs are
   actually used on x86 for testing for races.

2) Sending skbs with metadata dsts attached resulted in a null pointer
   dereference, triggerable from executing eBPF programs. The fix is a
   oneliner, changing a skb_dst() null check into a skb_valid_dst()
   boolean check.
====================

Link: https://lore.kernel.org/r/20220421134805.279118-1-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Apr 22, 2022
2 parents b253a06 + 45ac774 commit f675ed0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/wireguard/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/if_arp.h>
#include <linux/icmp.h>
#include <linux/suspend.h>
#include <net/dst_metadata.h>
#include <net/icmp.h>
#include <net/rtnetlink.h>
#include <net/ip_tunnels.h>
Expand Down Expand Up @@ -167,7 +168,7 @@ static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev)
goto err_peer;
}

mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
mtu = skb_valid_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;

__skb_queue_head_init(&packets);
if (!skb_is_gso(skb)) {
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/wireguard/qemu/arch/i686.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_ACPI=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_CMDLINE_BOOL=y
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/wireguard/qemu/arch/x86_64.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_ACPI=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_CMDLINE_BOOL=y
Expand Down

0 comments on commit f675ed0

Please sign in to comment.