From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5802F46EF8F for ; Fri, 21 Aug 2026 10:31:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787308304; cv=none; b=kUh9GYRP3EXI5q6VFMQ8YFeGBq+rgS0I+wMW31KMdR95lJw72nrY5sdHvlo83e/5wyVRfyXtsjGHRJ/SoYrAwFfPEnCYs6wA9cb8k4cE0bBJscfS/pd3x1EykL1zlzuLYluv5nnxRM/lpHy1lV4r55CAsROOmQz4UH5zak4/8aU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787308304; c=relaxed/simple; bh=my919OzKEaFXzGVa7gtJMqqOzzE/+K6McWGi3sdLOFg=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=V9H7ps8h461rsDzcB9BNJpI4JrkGvVZOcm8zCmGIYOTNZlxoaAvKhFOFtSJK8fL+6jZfF0YJOvRbwqMwMEUbGyndVP9prU5DqPlXKwTNc3NNbjaa2ugaoWmJSiYSim9paRvfVNOR0DhtkSlP0wmu5bxUW91az67ieb2wDt4e9Bk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.210.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-ot1-f70.google.com with SMTP id 46e09a7af769-7ec3b429610so1594681a34.1 for ; Fri, 21 Aug 2026 03:31:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787308294; x=1787913094; h=content-type:to:from:subject:message-id:in-reply-to:date :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=+XFog1lYQKgJXs5kwao6+DbPAL5aeVsZScwQUSVvmYo=; b=BQEaczobvEWcqFt9nSQX1++nTxuY9sQeLuILl2lCF10te74COaa8nr/rp8FZphcHap iE//lY72fWqiY4L7Uh708acaf04OOJysAunRFIN8hg2pJw3yP1bfn4krpFEP5SUcwa2g +IinNyYLs5TvC9ABlxACXIa+/17GSX64iOAD51GT9KnKonBaZ5edH8TUVOfLHiyeQGTx 8HLPcT55NP2BE7/UPx4K6g2NMf8wqFLS0FMpm2iTpYqsRj0TCnXkVyeWktJDoBxPVdw/ Y0+a0p/MO+I76ppQQcyN9BqxQzg1GJDbgtlYiI8KPr5RVwHzGhNRUDQYj9Y8tj6x/ukt x3cg== X-Gm-Message-State: AOJu0YwD2feGW2sBvRw0tgXgkCqvWYsU8fEX36PtlBeKIDImBTWI961u Ixqe2dOSDRt3attKA8yR/RqfG3Nmkn2uJ2cygfuZzfRDlp3R88Pir/loVwZjj0dfGPCoCw8OFF7 tanBzJXHja/yvFvq2EUdIJBYVDZg2KWw7HHjHx2oEgBm81u43KOMv7r1H+QI= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:205:b0:6a1:7790:258e with SMTP id 006d021491bc7-6b1593ad808mr5882949eaf.18.1787308294649; Fri, 21 Aug 2026 03:31:34 -0700 (PDT) Date: Fri, 21 Aug 2026 03:31:34 -0700 In-Reply-To: <6a8818d8.ae6ddae5.3da009.0030.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a882906.ae6ddae5.3da009.0033.GAE@google.com> Subject: Forwarded: [PATCH] usb: typec: ucsi_acpi: fix NULL pointer dereference in ucsi_acpi_probe() From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] usb: typec: ucsi_acpi: fix NULL pointer dereference in ucsi_acpi_probe() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master ucsi_acpi_probe() dereferences the ACPI companion device pointer returned by ACPI_COMPANION() without checking it for NULL. While this driver is normally probed through ACPI device enumeration where a companion is always present, a platform_device can also be manually bound to any platform driver via the sysfs 'bind' file (bind_store() -> bus_find_device() -> driver_attach_device()), which matches purely on device name and bypasses ACPI matching. If ucsi_acpi is bound this way to a platform device with no ACPI companion, ACPI_COMPANION() returns NULL and the subsequent adev->dep_unmet access dereferences a NULL pointer, resulting in a general protection fault. Add a NULL check for adev immediately after it is obtained and before any resource allocation, returning -ENODEV to decline binding cleanly. Reported-by: syzbot+23cf45a9fce78e4e0dc1@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=23cf45a9fce78e4e0dc1 Signed-off-by: Deepanshu Kartikey --- drivers/usb/typec/ucsi/ucsi_acpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c index 18286d3e9cc5..9fe4ba43afea 100644 --- a/drivers/usb/typec/ucsi/ucsi_acpi.c +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c @@ -196,6 +196,9 @@ static int ucsi_acpi_probe(struct platform_device *pdev) acpi_status status; int ret; + if (!adev) + return -ENODEV; + if (adev->dep_unmet) return -EPROBE_DEFER; -- 2.34.1