Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795042257; b=WIdIdfadzwdX/bUOymUGhvc3PxZ+DofivvSNdtS1fJfayWNm0jrwWjB0aP1w82AnvOoA wNDdL8sMIXh89VIaU7/GO4mcH94ol4H6Bq5hzWZdSz20h3fNb08gYGZR961AeCGfuuMD2 vuR2nNPLUKi0koUhQkQKtRJHPj1U3Ov+mFW+WUSWD+MlkmKiSdOsITNoBv9QmVpydxObl gbDL+wvzipipuN4Di0nFpPBO0kT4JvI46wKQ9ZdJQ94ih8UQCzkH2SwGVs1QFIK+/V1Lt USyavk0VidhZVNTqIujHWGbZYGJrKqAzfCSndxLrFMumHO+qrwHb+Uah6AVAtWr6JyA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795042257; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Cy8qDy7WtzBFeXnb/UQX80lF2UlJNJNRCO5lWAlwia0=; b=4xIxE+3e1d1hksPQy52WgfCIdwfw0JMAucMIfrcoG6puGLuzF0uwchEKexrGgEggkfbz GnDHLL8Zx1GIiBdmDYcFARbZAXDQxZDlBPmvAZZYj12YwYiLGLnr1Mdl/j6L2xnK+cv/h gZuYrUjrVyTtVR+Ip+AMMxwXeaD8QQhacaOlqng9UooeASahyu6ZenxliUor3VDfqFBz/ iSx3ChMpKnpAi/reetMNpc0ig5LImuZ0zIUOlR91Nk0iFu++WaTU3IdSDalmIyMUWIYnM Cb18786Mholsu6B/PiHIwMwgtN3EeQsHagvMCtAqqxGr53orP5tkLZey3aMKPN9gWRQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=l8l90oK1; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B29CA606A32A; Wed, 18 Nov 2026 22:50:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=l8l90oK1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EF871F000C4; Wed, 18 Nov 2026 22:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795042257; bh=Cy8qDy7WtzBFeXnb/UQX80lF2UlJNJNRCO5lWAlwia0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l8l90oK1BjDG4YpfiZEUo8SNu4aBsIBRE/Tk7PwgnRaS24bavJoZDv8YR1F6EVIxD eXiOt7P8AC8PSw/Lg+ExN/c+aFbY/TyAkMoIz2bKpCQFDV8H6vogpRWasdFop7HthW GTqtAyhdW+JWuaV/YxjyXhwhzr1SxrEUZuZ+q0ZE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jiale Yao , Naman Jain , Wei Liu , Sasha Levin Subject: [PATCH 6.6 3105/3318] Drivers: hv: vmbus: Check ACPI companion before use Date: Wed, 18 Nov 2026 16:02:07 +0100 Message-ID: <20261118150453.143087234@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150313.527275416@linuxfoundation.org> References: <20261118150313.527275416@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiale Yao [ Upstream commit dd57772e36f72f8d9a53d7fa4d90c974d8ebbcff ] Platform drivers can be forced to bind to devices outside their match tables through driver_override. vmbus_acpi_add() assumes that every bound device has an ACPI companion and dereferences it without checking. Return -ENODEV when the companion is absent to avoid a NULL pointer dereference. Signed-off-by: Jiale Yao Fixes: 9c8434238041 ("Drivers: hv: vmbus: Convert acpi_device to more generic platform_device") Reviewed-by: Naman Jain Signed-off-by: Wei Liu Signed-off-by: Sasha Levin --- drivers/hv/vmbus_drv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 44af1c455bbf9..c97ef6c6c9d39 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -2270,10 +2270,14 @@ EXPORT_SYMBOL_GPL(vmbus_free_mmio); #ifdef CONFIG_ACPI static int vmbus_acpi_add(struct platform_device *pdev) { + struct acpi_device *ancestor; + struct acpi_device *device; acpi_status result; int ret_val = -ENODEV; - struct acpi_device *ancestor; - struct acpi_device *device = ACPI_COMPANION(&pdev->dev); + + device = ACPI_COMPANION(&pdev->dev); + if (!device) + return -ENODEV; hv_dev = &device->dev; -- 2.53.0