From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60A5318EB0 for ; Tue, 26 Mar 2024 17:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711473577; cv=none; b=NcBeLGDzZsiPXUFrT+mYYE5uEqu8dHZ7dKsw30welfYIsRpJ+fWxwkPDiQBpYO9t+mU0SKlNnhLK/IzpPPjn09xEHU5z71CWRb+T4JlY0rRX70q/MJ973MO0la+6WeDWFKxR9+rVONfNaGXO6cNgg0MZpoZegUjt/pYGwJVZBZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711473577; c=relaxed/simple; bh=E8EkmCtKjd4P3QjfiKp1bDDsUUoBAbFGtloT5m8/9IE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AfvgOuWxwhz4pX9XnsUTRE1EjKTSbgbwdkgZQ9IPwk9SGPDl85g8u3Lxkt5EExqCO+Hxqo2Gc1O45vNW+p8uActcye5Dx69YigU9KxHhIYRn/oMDsPKi2+SYAbpohrVjEVYVqoQ9SvuiOs38dg7oHiLig7iQBQEKEFL+85qhKg0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pSp55AE0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pSp55AE0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E797C433C7; Tue, 26 Mar 2024 17:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711473576; bh=E8EkmCtKjd4P3QjfiKp1bDDsUUoBAbFGtloT5m8/9IE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=pSp55AE0m/dadrhCXpO7M92njOZPRTZlJdSzl3pXoO8FvPVzDPJPxMcMNaQk9NP7e yCE1koZN97FzGW41PCSQl0bv55HJbkJmj7D+kjh34C53RdeK+EShNvUhQynGxgDbI4 CmWhKvo7DlTRxbVHTunjo7fwx01fcD512dZMeYNWDTMeNkYJiRihBqLYHLmhutVpRe +BbTmeR/VcqPSeU6r4+JQWSloyIXl0fT1SXzYmQemDjGKMLc6KolGL15A/hK+MTd5F ve008y7k7YnwYe4rf6xbr8eBurCQliu3sVEYbG3abu3JpHTc3wa67QWjFnhUTNapOB sRu1q7GMQVxqw== From: Lee Jones To: linux-cve-announce@vger.kernel.org Cc: Lee Jones Subject: CVE-2023-52621: bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers Date: Tue, 26 Mar 2024 17:19:30 +0000 Message-ID: <20240326171931.1354035-4-lee@kernel.org> X-Mailer: git-send-email 2.44.0.396.g6e790dbe36-goog Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3077; i=lee@kernel.org; h=from:subject; bh=E8EkmCtKjd4P3QjfiKp1bDDsUUoBAbFGtloT5m8/9IE=; b=owEBbQKS/ZANAwAKAVGvii+H/HdhAcsmYgBmAwOjjUMFs+5jJsxwA5a+/vCvKKTHu3BJETAug +nJqMxAfUiJAjMEAAEKAB0WIQR2tsk1o74gmpTwh0hRr4ovh/x3YQUCZgMDowAKCRBRr4ovh/x3 YZOAD/9+PYD+749hOXa/7EwNp+iwK2VHoWmUU2GhEUAx5HLyYmR3nIevvbrIWsgrReOp6M+1Z8U xpm183nJcPSMWUmXGSJVAb4+p+yjUq4UTQn5TFU/zbgaN7TADpbyPIplfRrrLj68qtnFlj3cN7b D+XUNU6GF3tJpydDtNmgj57olQw1uVAUpFqVO4eJckNeSaxaSbYxtyN5gCmOESp6a4KUEyerl9a CrivmzfVB4VrA2t+uQ7K/uUz89LgdcT4sRmj8amCTBLv+pHJvFiETV1bgftuvDK2erO6gbh9ULn hHxETia3GqlvS+tBOclLLBhlEV19A8FPDQmzt5mshBsR7bQC17aPt+IUto9zRxRF8WeJoG3j1mL DcsuoEPoOD0wiDFEGJXZFLxpYTlFLEYsIuvjXrzU5aZgft3DG6BMPlx6iT11s1enNYh2Gqz3A7g r6WIeNOzHERjWtw9w4dXIYCWCqcxcRuI0WrPwDkQ7EEy68uPB7YoG+iJgZxOPaSPL/Q61XG1NOV nv4yAVoaUe/sNB0W9PgTTSnaaqXuTLi/hyZ/9PHvlsaFz5ysFi2Hq72cCP0/yNO4tjKu6Lt4Laq H1txjhcuz/CzoE7nqrAgUsUK/zqUo+x9f9dbdl1tbkVLAWB4sMdcN1gqmQJ2tJqivZmf+m1EE+Q WCcH7ePmXSJGv5Q== X-Developer-Key: i=lee@kernel.org; a=openpgp; fpr=76B6C935A3BE209A94F0874851AF8A2F87FC7761 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers These three bpf_map_{lookup,update,delete}_elem() helpers are also available for sleepable bpf program, so add the corresponding lock assertion for sleepable bpf program, otherwise the following warning will be reported when a sleepable bpf program manipulates bpf map under interpreter mode (aka bpf_jit_enable=0): WARNING: CPU: 3 PID: 4985 at kernel/bpf/helpers.c:40 ...... CPU: 3 PID: 4985 Comm: test_progs Not tainted 6.6.0+ #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) ...... RIP: 0010:bpf_map_lookup_elem+0x54/0x60 ...... Call Trace: ? __warn+0xa5/0x240 ? bpf_map_lookup_elem+0x54/0x60 ? report_bug+0x1ba/0x1f0 ? handle_bug+0x40/0x80 ? exc_invalid_op+0x18/0x50 ? asm_exc_invalid_op+0x1b/0x20 ? __pfx_bpf_map_lookup_elem+0x10/0x10 ? rcu_lockdep_current_cpu_online+0x65/0xb0 ? rcu_is_watching+0x23/0x50 ? bpf_map_lookup_elem+0x54/0x60 ? __pfx_bpf_map_lookup_elem+0x10/0x10 ___bpf_prog_run+0x513/0x3b70 __bpf_prog_run32+0x9d/0xd0 ? __bpf_prog_enter_sleepable_recur+0xad/0x120 ? __bpf_prog_enter_sleepable_recur+0x3e/0x120 bpf_trampoline_6442580665+0x4d/0x1000 __x64_sys_getpgid+0x5/0x30 ? do_syscall_64+0x36/0xb0 entry_SYSCALL_64_after_hwframe+0x6e/0x76 The Linux kernel CVE team has assigned CVE-2023-52621 to this issue. Affected and fixed versions =========================== Fixed in 6.1.77 with commit d6d6fe4bb105 Fixed in 6.6.16 with commit 483cb92334cd Fixed in 6.7.4 with commit c7f1b6146f4a Fixed in 6.8 with commit 169410eba271 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-52621 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: kernel/bpf/helpers.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/d6d6fe4bb105595118f12abeed4a7bdd450853f3 https://git.kernel.org/stable/c/483cb92334cd7f1d5387dccc0ab5d595d27a669d https://git.kernel.org/stable/c/c7f1b6146f4a46d727c0d046284c28b6882c6304 https://git.kernel.org/stable/c/169410eba271afc9f0fb476d996795aa26770c6d