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 B73E934A3A7 for ; Fri, 13 Feb 2026 12:12:01 +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=1770984721; cv=none; b=fEZIGF/bqeYyLKSPtBkzw7+Qhzd44qVl2grYK5DZmLyF/GCYus8SgAhtixUHp8sTH4phgSYOrpaTYseCjnbkYSnPD3jrLg5k7fwKVoJOz2GnSw0wazlO2vc+p1qEawOCiR4y2zbB8liOAPBTWAQ3EEnan+KqqdWLuJwZPlP1K2E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770984721; c=relaxed/simple; bh=MGp/JDX0aRN8sf2kW7jlupPBV15XXIrb3+KR8OCSNcM=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=oI7VheZCpeStltWnVBHWBnYzGWlpzbsEXUKwf1ls0VHw9qD1PwXPR4Ja42m0a/6xKHeBk9VinhTK3eBA9Iqc3h9k+hAF0MhIvOpvpLjLL9fE+E8lQVfimvZVjrxz7S5LnwVK+7U/qCrmczaoE5AfVCT2NgWTx5s9kcElQ/AgXeI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZtrwzhIx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZtrwzhIx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E80D0C116C6; Fri, 13 Feb 2026 12:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770984721; bh=MGp/JDX0aRN8sf2kW7jlupPBV15XXIrb3+KR8OCSNcM=; h=Subject:To:Cc:From:Date:From; b=ZtrwzhIxdMzouuJacY19og2Aitn2qb9HYuvsJsksWfbZPIYRVmRwBYArbKKFbllxT 2e3G8q2FUekMnqC2nELWtZ4byA/HKCytYn0pTa19TRkBQPQsBB1ZTlX34J1uBAnjTB 9DyF7T1nPRR7Dj36isxtzlWVB2JNySXppRk7/Scc= Subject: FAILED: patch "[PATCH] bus: fsl-mc: fix use-after-free in driver_override_show()" failed to apply to 5.15-stable tree To: hanguidong02@gmail.com,chleroy@kernel.org,ioana.ciornei@nxp.com Cc: From: Date: Fri, 13 Feb 2026 13:11:47 +0100 Message-ID: <2026021347-applicant-whooping-9898@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 148891e95014b5dc5878acefa57f1940c281c431 # git commit -s git send-email --to '' --in-reply-to '2026021347-applicant-whooping-9898@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 148891e95014b5dc5878acefa57f1940c281c431 Mon Sep 17 00:00:00 2001 From: Gui-Dong Han Date: Wed, 3 Dec 2025 01:44:38 +0800 Subject: [PATCH] bus: fsl-mc: fix use-after-free in driver_override_show() The driver_override_show() function reads the driver_override string without holding the device_lock. However, driver_override_store() uses driver_set_override(), which modifies and frees the string while holding the device_lock. This can result in a concurrent use-after-free if the string is freed by the store function while being read by the show function. Fix this by holding the device_lock around the read operation. Fixes: 1f86a00c1159 ("bus/fsl-mc: add support for 'driver_override' in the mc-bus") Cc: stable@vger.kernel.org Signed-off-by: Gui-Dong Han Reviewed-by: Ioana Ciornei Link: https://lore.kernel.org/r/20251202174438.12658-1-hanguidong02@gmail.com Signed-off-by: Christophe Leroy (CS GROUP) diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c index c08c04047ae2..08b99b0b342f 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -231,8 +231,12 @@ static ssize_t driver_override_show(struct device *dev, struct device_attribute *attr, char *buf) { struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); + ssize_t len; - return sysfs_emit(buf, "%s\n", mc_dev->driver_override); + device_lock(dev); + len = sysfs_emit(buf, "%s\n", mc_dev->driver_override); + device_unlock(dev); + return len; } static DEVICE_ATTR_RW(driver_override);