Remi Pommarel
f7667b4988
batman-adv: Do not get eth header before batadv_check_management_packet
...
commit eac27a41ab641de074655d2932fc7f8cdb446881 upstream.
If received skb in batadv_v_elp_packet_recv or batadv_v_ogm_packet_recv
is either cloned or non linearized then its data buffer will be
reallocated by batadv_check_management_packet when skb_cow or
skb_linearize get called. Thus geting ethernet header address inside
skb data buffer before batadv_check_management_packet had any chance to
reallocate it could lead to the following kernel panic:
Unable to handle kernel paging request at virtual address ffffff8020ab069a
Mem abort info:
ESR = 0x96000007
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x07: level 3 translation fault
Data abort info:
ISV = 0, ISS = 0x00000007
CM = 0, WnR = 0
swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000040f45000
[ffffff8020ab069a] pgd=180000007fffa003, p4d=180000007fffa003, pud=180000007fffa003, pmd=180000007fefe003, pte=0068000020ab0706
Internal error: Oops: 96000007 [#1 ] SMP
Modules linked in: ahci_mvebu libahci_platform libahci dvb_usb_af9035 dvb_usb_dib0700 dib0070 dib7000m dibx000_common ath11k_pci ath10k_pci ath10k_core mwl8k_new nf_nat_sip nf_conntrack_sip xhci_plat_hcd xhci_hcd nf_nat_pptp nf_conntrack_pptp at24 sbsa_gwdt
CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 5.15.42-00066-g3242268d425c-dirty #550
Hardware name: A8k (DT)
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : batadv_is_my_mac+0x60/0xc0
lr : batadv_v_ogm_packet_recv+0x98/0x5d0
sp : ffffff8000183820
x29: ffffff8000183820 x28: 0000000000000001 x27: ffffff8014f9af00
x26: 0000000000000000 x25: 0000000000000543 x24: 0000000000000003
x23: ffffff8020ab0580 x22: 0000000000000110 x21: ffffff80168ae880
x20: 0000000000000000 x19: ffffff800b561000 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 00dc098924ae0032
x14: 0f0405433e0054b0 x13: ffffffff00000080 x12: 0000004000000001
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
x8 : 0000000000000000 x7 : ffffffc076dae000 x6 : ffffff8000183700
x5 : ffffffc00955e698 x4 : ffffff80168ae000 x3 : ffffff80059cf000
x2 : ffffff800b561000 x1 : ffffff8020ab0696 x0 : ffffff80168ae880
Call trace:
batadv_is_my_mac+0x60/0xc0
batadv_v_ogm_packet_recv+0x98/0x5d0
batadv_batman_skb_recv+0x1b8/0x244
__netif_receive_skb_core.isra.0+0x440/0xc74
__netif_receive_skb_one_core+0x14/0x20
netif_receive_skb+0x68/0x140
br_pass_frame_up+0x70/0x80
br_handle_frame_finish+0x108/0x284
br_handle_frame+0x190/0x250
__netif_receive_skb_core.isra.0+0x240/0xc74
__netif_receive_skb_list_core+0x6c/0x90
netif_receive_skb_list_internal+0x1f4/0x310
napi_complete_done+0x64/0x1d0
gro_cell_poll+0x7c/0xa0
__napi_poll+0x34/0x174
net_rx_action+0xf8/0x2a0
_stext+0x12c/0x2ac
run_ksoftirqd+0x4c/0x7c
smpboot_thread_fn+0x120/0x210
kthread+0x140/0x150
ret_from_fork+0x10/0x20
Code: f9403844 eb03009f 54fffee1 f94
Thus ethernet header address should only be fetched after
batadv_check_management_packet has been called.
Fixes: 0da0035942d4 ("batman-adv: OGMv2 - add basic infrastructure")
Cc: stable@vger.kernel.org
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-30 16:18:17 +02:00
..
2023-04-20 12:13:53 +02:00
2022-12-31 13:14:42 +01:00
2023-05-24 17:36:52 +01:00
2023-06-09 10:32:26 +02:00
2022-06-22 14:22:01 +02:00
2023-08-30 16:18:17 +02:00
2023-08-26 14:23:25 +02:00
2022-12-31 13:14:11 +01:00
2023-07-27 08:46:59 +02:00
2023-03-17 08:48:54 +01:00
2023-08-30 16:18:13 +02:00
2023-08-11 15:13:55 +02:00
2023-08-30 16:18:15 +02:00
2023-08-11 15:13:53 +02:00
2023-08-30 16:18:14 +02:00
2023-07-23 13:47:30 +02:00
2023-05-17 11:50:18 +02:00
2023-04-05 11:25:02 +02:00
2022-11-03 23:59:14 +09:00
2023-08-26 14:23:38 +02:00
2023-08-26 14:23:32 +02:00
2023-03-22 13:31:28 +01:00
2022-11-26 09:24:50 +01:00
2023-08-26 14:23:32 +02:00
2023-04-26 13:51:54 +02:00
2022-04-27 14:38:53 +02:00
2023-07-27 08:47:02 +02:00
2023-06-09 10:32:25 +02:00
2022-12-14 11:37:25 +01:00
2023-02-06 07:59:02 +01:00
2023-02-22 12:57:09 +01:00
2023-07-05 18:25:04 +01:00
2023-08-30 16:18:16 +02:00
2023-08-30 16:18:15 +02:00
2022-04-13 20:59:10 +02:00
2023-07-23 13:46:56 +02:00
2023-06-09 10:32:16 +02:00
2023-07-23 13:46:56 +02:00
2023-05-24 17:36:51 +01:00
2023-02-22 12:57:09 +01:00
2023-08-16 18:22:01 +02:00
2022-01-11 15:35:16 +01:00
2023-04-20 12:13:53 +02:00
2023-03-10 09:39:16 +01:00
2022-04-08 14:23:00 +02:00
2023-02-22 12:57:02 +01:00
2023-05-17 11:50:17 +02:00
2023-08-30 16:18:15 +02:00
2023-08-30 16:18:13 +02:00
2023-06-14 11:13:01 +02:00
2021-11-18 19:17:11 +01:00
2023-08-30 16:18:10 +02:00
2023-08-03 10:22:37 +02:00
2023-08-26 14:23:22 +02:00
2023-08-26 14:23:38 +02:00
2023-05-24 17:36:49 +01:00
2023-08-11 15:13:49 +02:00
2023-02-09 11:26:40 +01:00
2023-08-16 18:22:01 +02:00
2023-08-26 14:23:33 +02:00
2023-06-21 15:59:15 +02:00
2023-06-21 15:59:15 +02:00
2023-05-24 17:36:42 +01:00