FreeBSD Bugzilla – Attachment 249037 Details for
Bug 264115
net/wireguard-kmod: Panics ARM64 (RockPro64) on FreeBSD 14-CURRENT (716fd348e01): panic: vm_fault failed: 0 error 1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
git-diff against src
wg.diff (text/plain), 1.73 KB, created by
Kyle Evans
on 2024-03-08 20:05:10 UTC
(
hide
)
Description:
git-diff against src
Filename:
MIME Type:
Creator:
Kyle Evans
Created:
2024-03-08 20:05:10 UTC
Size:
1.73 KB
patch
obsolete
>commit 9e60d837d468095c6b056c804c8f6c0c33ea6a0c >Author: Kyle Evans <kyle.evans@klarasystems.com> >Date: Fri Mar 8 19:53:22 2024 +0000 > > if_wg: use proper barriers around pkt->p_state > > The hardware's allowed to reorder these loads in wg_deliver_out() such > that we end up with a garbage mbuf that we try to pass out without > appropriate load-synchronization to pair with store barriers in > wg_encrypt() and wg_decrypt((). > >diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c >index c7649e2b405..42c426ac181 100644 >--- a/sys/dev/wg/if_wg.c >+++ b/sys/dev/wg/if_wg.c >@@ -1517,8 +1517,7 @@ wg_encrypt(struct wg_softc *sc, struct wg_packet *pkt) > state = WG_PACKET_CRYPTED; > out: > pkt->p_mbuf = m; >- wmb(); >- pkt->p_state = state; >+ atomic_store_rel_int(&pkt->p_state, state); > GROUPTASK_ENQUEUE(&peer->p_send); > noise_remote_put(remote); > } >@@ -1590,8 +1589,7 @@ wg_decrypt(struct wg_softc *sc, struct wg_packet *pkt) > state = WG_PACKET_CRYPTED; > out: > pkt->p_mbuf = m; >- wmb(); >- pkt->p_state = state; >+ atomic_store_rel_int(&pkt->p_state, state); > GROUPTASK_ENQUEUE(&peer->p_recv); > noise_remote_put(remote); > } >@@ -1647,7 +1645,7 @@ wg_deliver_out(struct wg_peer *peer) > wg_peer_get_endpoint(peer, &endpoint); > > while ((pkt = wg_queue_dequeue_serial(&peer->p_encrypt_serial)) != NULL) { >- if (pkt->p_state != WG_PACKET_CRYPTED) >+ if (atomic_load_acq_int(&pkt->p_state) != WG_PACKET_CRYPTED) > goto error; > > m = pkt->p_mbuf; >@@ -1689,7 +1687,7 @@ wg_deliver_in(struct wg_peer *peer) > struct epoch_tracker et; > > while ((pkt = wg_queue_dequeue_serial(&peer->p_decrypt_serial)) != NULL) { >- if (pkt->p_state != WG_PACKET_CRYPTED) >+ if (atomic_load_acq_int(&pkt->p_state) != WG_PACKET_CRYPTED) > goto error; > > m = pkt->p_mbuf;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 264115
: 249037 |
249416