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 78FA014D43E for ; Thu, 29 Feb 2024 15:53:34 +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=1709222014; cv=none; b=k/XkjHzEjbOZRYI+0eFJ24o9jbFsJCblUcdo2VTrV1t++q3qfJjs3waXFMZf+xLwQ912uygOZfa/DHvk96Jw9WZKkSWEMPxtZBBAEWQfYD65ciZpfD7POVL5pcwaJtqleM5+Xx95qUMf+Ay0am4Plc+XizM2OnjuwZoURTBTJdg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709222014; c=relaxed/simple; bh=7dHVz5KRIqwn9ceBDBNexdm9L4R4UZfROFjvHg+hREc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Bf7dR5BU3czGlByX1uL777WkCySiLb0+RQSbRZLaiYn1JeuFWgCfmJURdUNuxv+bZv9fxndvvOmnD7oMRCAaUSiQsIR9ozIF82GLlAs0xgvmZtd9MgEVQ2IoW4B4bRTC6oC0W7wi/Q2D+HaSkExtISHtmJkwCzZpTkYsQCRw7P8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LytYir80; 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="LytYir80" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8BCAC43394; Thu, 29 Feb 2024 15:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709222014; bh=7dHVz5KRIqwn9ceBDBNexdm9L4R4UZfROFjvHg+hREc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=LytYir806+G4FYRkn5Gdtp5ismjz1IaRjhrRq1c+V0eYs+t00Bo5EQvCLblnpZ1Bf 81oURDJqc8ONcT/HVa2yi3gxQo0VLKIF8B/tymodoajmc1rJfgSLTdOuinYCAAL6ml urLRnOukQikc966+Fs61HDPXipRCUgLQWLyOaOir5T94bYyJjapm4eqKC398Z0O+oc 5PaQyC6OiWqMwaSC4iV5KpwbY0FWUwPGc30W3N0oEF+fzmePJVlHCvm5qZ7+BUFPqn JsBTR1Hr4nle6C6mjho1nh+gmZr3YI/9iXy/WYQeslIZti5hNLu9RzEgoEwG7PHqKh pA2b8RnRgcfiQ== From: Lee Jones To: linux-cve-announce@vger.kernel.org Cc: Lee Jones Subject: CVE-2024-26613: net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv Date: Thu, 29 Feb 2024 15:53:04 +0000 Message-ID: <20240229155245.1571576-45-lee@kernel.org> X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-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=4292; i=lee@kernel.org; h=from:subject; bh=7dHVz5KRIqwn9ceBDBNexdm9L4R4UZfROFjvHg+hREc=; b=owEBbQKS/ZANAwAKAVGvii+H/HdhAcsmYgBl4KhPtkZtv5VKV+0QJ95q9jYognJcHqJ1MgU1m QJKcs+5qHGJAjMEAAEKAB0WIQR2tsk1o74gmpTwh0hRr4ovh/x3YQUCZeCoTwAKCRBRr4ovh/x3 YWj8D/9QA2GbAKlSmX+pCvcfK0rofopLpDv2A9eykCiQMY69hNDhKf2sVyMmzutTWnoOmbNubuf Nd33BninUzlsrz1/Ie10TRGCzIqCPaXH19aS5OpmWEyymp36X++EmSNoTgwsw4W75RXOxBC9AO7 AMkmqN/nw1Eq1vMIVDRUmhSrPBpt4BRse+flKgCRr49bDNW3pULQrSH/SVvO8LkIaNWIqkrmCTl z34DxXRBjoiCbxaAq0lQ9aFiYK7QyRCopZn6VnLCpRMwcVpVqH1tSIdAzoxLk59MPqYDBSCHU2l yaplFMJOXnhbOlnjyJY2EORSVkhfRXC4rg5RNgU73u4/Uj5HyewA/zYrpaMaRzYYQRXJipbw24x FVN4Vpylj1jGMCzLlruiKTrhZ7/CKTsXLHP3yrKvRlY3XjQDo6OvgSyBpEQN3ukE4o+eTW3xIOy 0UvnG/g0VOt3ILePxX84JT5Vmk7P0gKyAUQ/0I3YORIOiJT7OYBR3AbRAaAqEAsD/HkunKhBr1/ dUiQln5gKXhwYxaMlIe3dgnfUb5EzHyP5oG8wC8EO4YWAIaSDgcLc4KcbOiHsI2lVlV+Qs9kqRk SISnwrlmHvUEQrrKUqvX4RnBwh2nUNC6j+edftjkR9I4dqaeVrr02DjyEpB9KRhpKV4mVP4DuLE F2luB2COPJzvFMg== 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: net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv Syzcaller UBSAN crash occurs in rds_cmsg_recv(), which reads inc->i_rx_lat_trace[j + 1] with index 4 (3 + 1), but with array size of 4 (RDS_RX_MAX_TRACES). Here 'j' is assigned from rs->rs_rx_trace[i] and in-turn from trace.rx_trace_pos[i] in rds_recv_track_latency(), with both arrays sized 3 (RDS_MSG_RX_DGRAM_TRACE_MAX). So fix the off-by-one bounds check in rds_recv_track_latency() to prevent a potential crash in rds_cmsg_recv(). Found by syzcaller: ================================================================= UBSAN: array-index-out-of-bounds in net/rds/recv.c:585:39 index 4 is out of range for type 'u64 [4]' CPU: 1 PID: 8058 Comm: syz-executor228 Not tainted 6.6.0-gd2f51b3516da #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x136/0x150 lib/dump_stack.c:106 ubsan_epilogue lib/ubsan.c:217 [inline] __ubsan_handle_out_of_bounds+0xd5/0x130 lib/ubsan.c:348 rds_cmsg_recv+0x60d/0x700 net/rds/recv.c:585 rds_recvmsg+0x3fb/0x1610 net/rds/recv.c:716 sock_recvmsg_nosec net/socket.c:1044 [inline] sock_recvmsg+0xe2/0x160 net/socket.c:1066 __sys_recvfrom+0x1b6/0x2f0 net/socket.c:2246 __do_sys_recvfrom net/socket.c:2264 [inline] __se_sys_recvfrom net/socket.c:2260 [inline] __x64_sys_recvfrom+0xe0/0x1b0 net/socket.c:2260 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b ================================================================== The Linux kernel CVE team has assigned CVE-2024-26613 to this issue. Affected and fixed versions =========================== Issue introduced in 4.11 with commit 3289025aedc0 and fixed in 4.19.307 with commit 344350bfa3b4 Issue introduced in 4.11 with commit 3289025aedc0 and fixed in 5.4.269 with commit a37ae111db5e Issue introduced in 4.11 with commit 3289025aedc0 and fixed in 5.10.210 with commit 5ae8d5004463 Issue introduced in 4.11 with commit 3289025aedc0 and fixed in 5.15.149 with commit 00d1ee8e1d02 Issue introduced in 4.11 with commit 3289025aedc0 and fixed in 6.1.76 with commit 71024928b3f7 Issue introduced in 4.11 with commit 3289025aedc0 and fixed in 6.6.15 with commit 7a73190ea557 Issue introduced in 4.11 with commit 3289025aedc0 and fixed in 6.7.3 with commit 0b787c2dea15 Issue introduced in 4.11 with commit 3289025aedc0 and fixed in 6.8-rc2 with commit 13e788deb734 Please see https://www.kernel.org or 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-2024-26613 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: net/rds/af_rds.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/344350bfa3b4b37d7c3d5a00536e6fbf0e953fbf https://git.kernel.org/stable/c/a37ae111db5e0f7e3d6b692056c30e3e0f6f79cd https://git.kernel.org/stable/c/5ae8d50044633306ff160fcf7faa24994175efe1 https://git.kernel.org/stable/c/00d1ee8e1d02194f7b7b433e904e04bbcd2cc0dc https://git.kernel.org/stable/c/71024928b3f71ce4529426f8692943205c58d30b https://git.kernel.org/stable/c/7a73190ea557e7f26914b0fe04c1f57a96cb771f https://git.kernel.org/stable/c/0b787c2dea15e7a2828fa3a74a5447df4ed57711 https://git.kernel.org/stable/c/13e788deb7348cc88df34bed736c3b3b9927ea52