CVE-2021-47127

Severity CVSS v4.0:
Pending analysis
Type:
CWE-476 NULL Pointer Dereference
Publication date:
15/03/2024
Last modified:
07/01/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> ice: track AF_XDP ZC enabled queues in bitmap<br /> <br /> Commit c7a219048e45 ("ice: Remove xsk_buff_pool from VSI structure")<br /> silently introduced a regression and broke the Tx side of AF_XDP in copy<br /> mode. xsk_pool on ice_ring is set only based on the existence of the XDP<br /> prog on the VSI which in turn picks ice_clean_tx_irq_zc to be executed.<br /> That is not something that should happen for copy mode as it should use<br /> the regular data path ice_clean_tx_irq.<br /> <br /> This results in a following splat when xdpsock is run in txonly or l2fwd<br /> scenarios in copy mode:<br /> <br /> <br /> [ 106.050195] BUG: kernel NULL pointer dereference, address: 0000000000000030<br /> [ 106.057269] #PF: supervisor read access in kernel mode<br /> [ 106.062493] #PF: error_code(0x0000) - not-present page<br /> [ 106.067709] PGD 0 P4D 0<br /> [ 106.070293] Oops: 0000 [#1] PREEMPT SMP NOPTI<br /> [ 106.074721] CPU: 61 PID: 0 Comm: swapper/61 Not tainted 5.12.0-rc2+ #45<br /> [ 106.081436] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019<br /> [ 106.092027] RIP: 0010:xp_raw_get_dma+0x36/0x50<br /> [ 106.096551] Code: 74 14 48 b8 ff ff ff ff ff ff 00 00 48 21 f0 48 c1 ee 30 48 01 c6 48 8b 87 90 00 00 00 48 89 f2 81 e6 ff 0f 00 00 48 c1 ea 0c 8b 04 d0 48 83 e0 fe 48 01 f0 c3 66 66 2e 0f 1f 84 00 00 00 00<br /> [ 106.115588] RSP: 0018:ffffc9000d694e50 EFLAGS: 00010206<br /> [ 106.120893] RAX: 0000000000000000 RBX: ffff88984b8c8a00 RCX: ffff889852581800<br /> [ 106.128137] RDX: 0000000000000006 RSI: 0000000000000000 RDI: ffff88984cd8b800<br /> [ 106.135383] RBP: ffff888123b50001 R08: ffff889896800000 R09: 0000000000000800<br /> [ 106.142628] R10: 0000000000000000 R11: ffffffff826060c0 R12: 00000000000000ff<br /> [ 106.149872] R13: 0000000000000000 R14: 0000000000000040 R15: ffff888123b50018<br /> [ 106.157117] FS: 0000000000000000(0000) GS:ffff8897e0f40000(0000) knlGS:0000000000000000<br /> [ 106.165332] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033<br /> [ 106.171163] CR2: 0000000000000030 CR3: 000000000560a004 CR4: 00000000007706e0<br /> [ 106.178408] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000<br /> [ 106.185653] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400<br /> [ 106.192898] PKRU: 55555554<br /> [ 106.195653] Call Trace:<br /> [ 106.198143] <br /> [ 106.200196] ice_clean_tx_irq_zc+0x183/0x2a0 [ice]<br /> [ 106.205087] ice_napi_poll+0x3e/0x590 [ice]<br /> [ 106.209356] __napi_poll+0x2a/0x160<br /> [ 106.212911] net_rx_action+0xd6/0x200<br /> [ 106.216634] __do_softirq+0xbf/0x29b<br /> [ 106.220274] irq_exit_rcu+0x88/0xc0<br /> [ 106.223819] common_interrupt+0x7b/0xa0<br /> [ 106.227719] <br /> [ 106.229857] asm_common_interrupt+0x1e/0x40<br /> <br /> <br /> Fix this by introducing the bitmap of queues that are zero-copy enabled,<br /> where each bit, corresponding to a queue id that xsk pool is being<br /> configured on, will be set/cleared within ice_xsk_pool_{en,dis}able and<br /> checked within ice_xsk_pool(). The latter is a function used for<br /> deciding which napi poll routine is executed.<br /> Idea is being taken from our other drivers such as i40e and ixgbe.

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.12 (including) 5.12.10 (excluding)
cpe:2.3:o:linux:linux_kernel:5.13:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.13:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.13:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.13:rc4:*:*:*:*:*:*