From patchwork Wed Jun 14 10:42:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 1794905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Ab3vBXgg; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qh27q4Vy6z20Vx for ; Wed, 14 Jun 2023 20:43:02 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1q9Nxj-00055f-7u; Wed, 14 Jun 2023 10:42:51 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1q9Nxh-00055V-Tn for kernel-team@lists.ubuntu.com; Wed, 14 Jun 2023 10:42:49 +0000 Received: from quatroqueijos.. (unknown [179.93.171.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id C88433FD9A for ; Wed, 14 Jun 2023 10:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1686739369; bh=xewAYHl1vw7wgx0qu4ic7RwWbRGZI09Jrru2HT7rmKs=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=Ab3vBXggoVWUYUuJQliNjapt8lBQDPITakk01Hx2N/bQHJwd0HxAXG6gI0ohWOqPS yXqsFcNNdLpo90CevaTSFpc0s9WdMX1cR6MgidQzUKB0JKxaQ/RBxebHtDTpzCUr+S Eh2OQdgnVEuFNenmX5esMoESZT04SSlhonEybBFAzHr9vLJGv56J42jYWzVF+Hp5x1 tF7hpIpXz7aaET8OoN2Q8NUlwHWHjgfGmV7xQWcu8/Wvnz8LThI2V78NEk9QzKwJjC Ud2J/seThkjorNLcZdHJ2VI4S54IOeo/ldXE6J0bCHlN6qs7MoZhm8ufUf8F7VWgeG 8e6+iiKeX4w3w== From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [SRU Kinetic,OEM-6.1 0/4] CVE-2023-2430 Date: Wed, 14 Jun 2023 07:42:32 -0300 Message-Id: <20230614104237.1948590-1-cascardo@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" [Impact] A race condition when sending a MSG_RING operation to an IOPOLL io_uring may lead to incorrect behavior. [Test case] A test case was prepared where incorrect behavior was observed, indicating a race condition. [Backport] For 6.1, some conflicts because of previous out-of-order backports were dealt with. For 5.19, lots of file movements and different changes required that the backport was written anew. It introduces the double_locking (which is not double anymore), just for the sake of locking the other ctx uring_lock when sending MSG_RING data. For 6.0, there were more clean cherry-picks compared to 6.1. However, the testing shows some other strange behavior and is being currently investigated. [Potential regression] io_uring users relying on MSG_RING or IOPOLL would be affected. Jens Axboe (2): io_uring/msg_ring: move double lock/unlock helpers higher up io_uring/msg_ring: fix missing lock on overflow for IOPOLL Pavel Begunkov (2): io_uring: get rid of double locking io_uring: extract a io_msg_install_complete helper io_uring/msg_ring.c | 143 ++++++++++++++++++++++++++------------------ io_uring/msg_ring.h | 1 + io_uring/opdef.c | 1 + 3 files changed, 88 insertions(+), 57 deletions(-) Acked-by: Cengiz Can Acked-by: Tim Gardner