From patchwork Mon Jul 8 15:37:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bethany Jamison X-Patchwork-Id: 1958016 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=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (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 4WHpDm5mK1z1xrP for ; Tue, 9 Jul 2024 01:38:32 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sQqRJ-0004Ix-FZ; Mon, 08 Jul 2024 15:38:05 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sQqRH-0004Ie-JX for kernel-team@lists.ubuntu.com; Mon, 08 Jul 2024 15:38:03 +0000 Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) (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-internal-1.canonical.com (Postfix) with ESMTPS id 2197B3F0DE for ; Mon, 8 Jul 2024 15:38:03 +0000 (UTC) Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-7fa92ebcba8so157220839f.0 for ; Mon, 08 Jul 2024 08:38:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720453082; x=1721057882; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4LrKjflGiadDFzQaHC6fio7okIjp7t3tQYqpUEA9H9A=; b=rkF0gU/9kMaMu2HRCuNO9fLlqRW3rzcIyP6S9nnofXlrkcVA7HGBQyy0CrYs+g5BR7 X3wwyC1uvWyKsLNIOoFiLZ8tQKOegZ888mcA14DweqY/AbxhUnJxAZmRL7F9teZlfmIM b1zQaxDfzy8RvBJ+sCGrJRvBoOxbbh8vcH3OFxwnEgpO/5Ez1yzTiSa4pNAviOMIuuGg RCHHp+YhJYOlca0xTD6wGkPB8v4BtZK8Sp30r0H7wlJFCQp8is4uDcYAEFZ5mynXvDa7 lO31KrVSEv8iDz7mWo/HQfuLkWrSP8HMNsz+JSEKytzwsAGENcSAjN86KE6/Bz1J813t Yjbw== X-Gm-Message-State: AOJu0YytXHXzumIunnudGqfsAOFbiiSygQ6xeyI6bFHvtWiMhPRwfs1s xb8H2QRjCZi8HiFxKtVUJEt/ebA1lHs+65rmiH+AcO/OaiVVT5W1M25GYtwLgPXUFlm6Wz54JtB X+xoewpyMPTQmzzjqkMkxZ6KJqpEXJ4GBNEKihpYfsEUfNtIKWYvrZ2WOOsuMyikB6QMcQwrQpr XLX/ERYySloQ== X-Received: by 2002:a5d:8195:0:b0:7eb:8d08:e9ee with SMTP id ca18e2360f4ac-7f66dea8c2emr1290665939f.10.1720453081791; Mon, 08 Jul 2024 08:38:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsJ5yk5JozD3N1ORuNAqwJmMOTztzNPU8VxPfgzz0qaLyIqt74rILh9hdIoRUDfdWNYtEJtw== X-Received: by 2002:a5d:8195:0:b0:7eb:8d08:e9ee with SMTP id ca18e2360f4ac-7f66dea8c2emr1290664039f.10.1720453081483; Mon, 08 Jul 2024 08:38:01 -0700 (PDT) Received: from smtp.gmail.com (167-248-51-36.oa02.lnk04.ne.dynamic.allophone.net. [167.248.51.36]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-7ffecec668dsm1784939f.36.2024.07.08.08.38.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jul 2024 08:38:01 -0700 (PDT) From: Bethany Jamison To: kernel-team@lists.ubuntu.com Subject: [SRU][J/F][PATCH 0/1] CVE-2023-52629 Date: Mon, 8 Jul 2024 10:37:59 -0500 Message-Id: <20240708153800.16332-1-bethany.jamison@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] sh: push-switch: Reorder cleanup operations to avoid use-after-free bug The original code puts flush_work() before timer_shutdown_sync() in switch_drv_remove(). Although we use flush_work() to stop the worker, it could be rescheduled in switch_timer(). As a result, a use-after-free bug can occur. The details are shown below: (cpu 0) | (cpu 1) switch_drv_remove() | flush_work() | ... | switch_timer // timer | schedule_work(&psw->work) timer_shutdown_sync() | ... | switch_work_handler // worker kfree(psw) // free | | psw->state = 0 // use This patch puts timer_shutdown_sync() before flush_work() to mitigate the bugs. As a result, the worker and timer will be stopped safely before the deallocate operations. [Fix] Noble: not affected Jammy: Backported - context conflict with neighboring line Focal: Jammy patch applied cleanly Bionic: fix sent to esm ML Xenial: fix sent to esm ML Trusty: not going to be fixed by us [Test Case] Compile and boot tested [Where problems could occur] This fix affects those who use the push-switch framework, an issue with this fix would be visible to the user via unpredicted system behavior or a system crash. Duoming Zhou (1): sh: push-switch: Reorder cleanup operations to avoid use-after-free bug arch/sh/drivers/push-switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Acked-by: Manuel Diewald Acked-by: Noah Wager