Skip to content

Commit 842c361

Browse files
committed
Merge branch 'wireguard-fixes-for-6-10-rc7'
Jason A. Donenfeld says: ==================== wireguard fixes for 6.10-rc7 These are four small fixes for WireGuard, which are all marked for stable: 1) A QEMU command line fix to remove deprecated flags. 2) Use of proper unaligned helpers to avoid unaligned memory access on some systems, from Helge. 3) Two patches to annotate intentional data races, so KCSAN and syzbot don't get upset. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 0c754d9 + 381a7d4 commit 842c361

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

drivers/net/wireguard/allowedips.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ static void swap_endian(u8 *dst, const u8 *src, u8 bits)
1515
if (bits == 32) {
1616
*(u32 *)dst = be32_to_cpu(*(const __be32 *)src);
1717
} else if (bits == 128) {
18-
((u64 *)dst)[0] = be64_to_cpu(((const __be64 *)src)[0]);
19-
((u64 *)dst)[1] = be64_to_cpu(((const __be64 *)src)[1]);
18+
((u64 *)dst)[0] = get_unaligned_be64(src);
19+
((u64 *)dst)[1] = get_unaligned_be64(src + 8);
2020
}
2121
}
2222

drivers/net/wireguard/queueing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ static inline int wg_cpumask_choose_online(int *stored_cpu, unsigned int id)
124124
*/
125125
static inline int wg_cpumask_next_online(int *last_cpu)
126126
{
127-
int cpu = cpumask_next(*last_cpu, cpu_online_mask);
127+
int cpu = cpumask_next(READ_ONCE(*last_cpu), cpu_online_mask);
128128
if (cpu >= nr_cpu_ids)
129129
cpu = cpumask_first(cpu_online_mask);
130-
*last_cpu = cpu;
130+
WRITE_ONCE(*last_cpu, cpu);
131131
return cpu;
132132
}
133133

drivers/net/wireguard/send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void wg_packet_send_keepalive(struct wg_peer *peer)
222222
{
223223
struct sk_buff *skb;
224224

225-
if (skb_queue_empty(&peer->staged_packet_queue)) {
225+
if (skb_queue_empty_lockless(&peer->staged_packet_queue)) {
226226
skb = alloc_skb(DATA_PACKET_HEAD_ROOM + MESSAGE_MINIMUM_LENGTH,
227227
GFP_ATOMIC);
228228
if (unlikely(!skb))

tools/testing/selftests/wireguard/qemu/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ KERNEL_ARCH := x86_64
109109
KERNEL_BZIMAGE := $(KERNEL_BUILD_PATH)/arch/x86/boot/bzImage
110110
QEMU_VPORT_RESULT := virtio-serial-device
111111
ifeq ($(HOST_ARCH),$(ARCH))
112-
QEMU_MACHINE := -cpu host -machine microvm,accel=kvm,pit=off,pic=off,rtc=off -no-acpi
112+
QEMU_MACHINE := -cpu host -machine microvm,accel=kvm,pit=off,pic=off,rtc=off,acpi=off
113113
else
114-
QEMU_MACHINE := -cpu max -machine microvm -no-acpi
114+
QEMU_MACHINE := -cpu max -machine microvm,acpi=off
115115
endif
116116
else ifeq ($(ARCH),i686)
117117
CHOST := i686-linux-musl
@@ -120,9 +120,9 @@ KERNEL_ARCH := x86
120120
KERNEL_BZIMAGE := $(KERNEL_BUILD_PATH)/arch/x86/boot/bzImage
121121
QEMU_VPORT_RESULT := virtio-serial-device
122122
ifeq ($(subst x86_64,i686,$(HOST_ARCH)),$(ARCH))
123-
QEMU_MACHINE := -cpu host -machine microvm,accel=kvm,pit=off,pic=off,rtc=off -no-acpi
123+
QEMU_MACHINE := -cpu host -machine microvm,accel=kvm,pit=off,pic=off,rtc=off,acpi=off
124124
else
125-
QEMU_MACHINE := -cpu coreduo -machine microvm -no-acpi
125+
QEMU_MACHINE := -cpu coreduo -machine microvm,acpi=off
126126
endif
127127
else ifeq ($(ARCH),mips64)
128128
CHOST := mips64-linux-musl

0 commit comments

Comments
 (0)