From nobody Mon Sep 28 11:39:23 2026 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (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 5495837E5DE for ; Sat, 22 Aug 2026 06:55:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787381751; cv=none; b=UNV5rETq/Njx7oeI3DUGcM3DhEw7e7sg3FfRtC7HhcYB+2lA/QH3yFC7vekPw4mHv2o57K48eQFLOd8j8+5ovW7K1Ll+2NS02d6g0V+vj25ilcG3rU9gMcOHQ9yGapAgxA8+vS/bwDxl+Pd+6Kme7ZLa/bTqJuRK9mNImezdRvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787381751; c=relaxed/simple; bh=FR4uMqCgqqzj+wS/Mdb0c+7HhwVZDV+2T3NiS2uX5YA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AIWxbJBUth/b02Z7TRGaVauM6Q582vB6HxUnxLXqSDP2/+j4L/YLNDy0c4GjX08fqaeDY+vTk/zW0c3isbaok2eFGGBvRLfIg0EL3cGyEAFL7CXTE34wfCuTwgtxJ7inw9fhKRstcIOlzxLxWTPKaBOOaSD8tjdlMdPWl33q35Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bL6r4Jvs; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bL6r4Jvs" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-c966b9ee9cbso1275872a12.1 for ; Fri, 21 Aug 2026 23:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787381750; x=1787986550; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=aK/WC9HoTRSFn5lPzlPYF3fTXd4a1ghNzsc62+BGToA=; b=bL6r4Jvslisl1vdQq9MsUQ5u2eOJ04eyrYb583tUsUQSNeLjFQXYOk0Lb7C0XWZ1r1 RC+6gdiz5o6xrP37hVDf8GeUHVTSkw0UBawS5YMMsT/JvKfnIfql7UFv4LWU9FySKyeD UDVtnUiIlUxV+cQohFCBMx5htjtkMLMkq7SY+2nC+KXD5CFwzqjNEc1oW6bg5670Kf+C u2Srq671oMmRc7ZjdHvfbUtMG7iDkXaGwfvR2X47awxuEeA31DAy6Y1AvaqEenqUS60D jNjhlGpdAKkVN2NzKP9dZOS7/krAnGsYrIYNY6p/h2QC2iF2c1zRgVm/BRsTDApB31C+ BOmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787381750; x=1787986550; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=aK/WC9HoTRSFn5lPzlPYF3fTXd4a1ghNzsc62+BGToA=; b=npxpETV6JwnR3Ceizd/aHSle8OlAg3nZ8imTo4bmPkilz+VjkMPkoCSado5DMafLcN /xQO0bS5x1f52if5v7XDZWVxA6wyAIOjH+kZsa84bv7qaY401fSZFfsiullQwT9Xvw7Z cb0zvpmOOzQImpD/cK9UohNIuyguLCaxgsAviaetBMx4m/Rjsx9lEeuiaqw5jbD5+cxW vsSxqE7tMx55UoNDSFOXAmtAK42P1tKZsLJuAbM+sugvNLGSyjvhPBfgt18U5if48JCe wH5wiDPLBcp8bWisk1spPefUFN44O64CA77zefiqsHniIsl7wcvwp5NXKElwkapbfg3I kp0w== X-Forwarded-Encrypted: i=1; AHgh+Roj7vFRJgCKJNBFgjiZCsIMJHqJnfRoaZgjh0UO5U+pH85Z06XtLSM4LjTrVF1jepuLX7fAuANJjKYq+7c=@vger.kernel.org X-Gm-Message-State: AFuF++kte5e4mhDaR+nRlIivOI5ad0t8y756J6jS3enu6dAnFoHTQyTG wLVoQG7pQfdO8AQqglphlXow9GVaXH7f2UA3qEBNjVjQeVi6q4Bh32H1qch2MZSK X-Gm-Gg: AR+sD11oOGqNmC2NDcn/E7ufuDHiUiYULdBB9Dnwwwoi5TGUW/4704spIolCV91zJzm L0LMiqHjV8Wf9xGAuVy+KnFCVrX+6RabtsGvvuRWdTekoHHncYAcgolWv1Zzr1YTuMasKAcuhaL pn1fn+BNzrgj4N239fn5y6rxKwwbRO3PzeK9aR+eWcREr1RQsSaXDugmS/nQppeH0HrTfBmLudA 64/dRjPDRWiPZ1wNywA+JzNN4k0Ax69eHDzZdZkMNr73wwcfYnODCJOLprDZVMzd0IoY0Ri/ohR hbkG+As5REg71aPr+3fQMp2tn1zV2Eg0X5gLZUYk6FutKTZPmQesKUhOo2RXLvJKi0G8hw2z2Mg MAJbhubl92pwBSmazVy0YHBzfHp6sMWAUSv9IMVncV1gFZKeBg5WvPeuIwuHNqkJ3ALovyHVd0d FR6tjhHGNykGoKH/wStrFX7Scyj3Mp5KIRFyVP5N1UMcwUtnbojy5kpgYddCUSMxv+Vy6A+A== X-Received: by 2002:a05:6a21:78b:b0:3b3:1b38:d9c3 with SMTP id adf61e73a8af0-3cd4b9e88cfmr8166230637.4.1787381749437; Fri, 21 Aug 2026 23:55:49 -0700 (PDT) Received: from TheRealOne ([2409:40e1:2e:3bcd:720e:b4ea:c360:a954]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327f91d2d1esm3430099eec.17.2026.08.21.23.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 23:55:48 -0700 (PDT) From: Chandradhar Kumar To: broonie@kernel.org Cc: lgirdwood@gmail.com, rppt@kernel.org, linux-kernel@vger.kernel.org, Chandradhar Kumar , syzbot+bfc9e55cf4f98183c636@syzkaller.appspotmail.com Subject: [PATCH] regulator: fixed: reject incompatible platform devices Date: Sat, 22 Aug 2026 12:25:19 +0530 Message-ID: <20260822065519.112441-1-chandradhar.2003@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The fixed regulator driver expects non-DT platform devices to provide their configuration through platform_data as a struct fixed_voltage_config. An explicitly bound driver can bypass the normal platform device/driver matching and attach the fixed regulator driver to an unrelated platform device. This causes the driver's platform_data to be interpreted as a struct fixed_voltage_config even though it contains data for a different device. Reject non-DT platform devices whose name does not match the fixed regulator driver before accessing their platform data. Fixes: 4b74ff651249 ("regulator: add support for fixed regulators.") Reported-by: syzbot+bfc9e55cf4f98183c636@syzkaller.appspotmail.com Closes: https://syzbot.org/bug?extid=3Dbfc9e55cf4f98183c636 Signed-off-by: Chandradhar Kumar --- drivers/regulator/fixed.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 417d282dd4ed..faa82f30eb1f 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -28,6 +28,7 @@ #include #include #include +#include =20 struct fixed_voltage_data { struct regulator_desc desc; @@ -225,6 +226,9 @@ static int reg_fixed_voltage_probe(struct platform_devi= ce *pdev) enum gpiod_flags gflags; int ret; =20 + if (!pdev->dev.of_node && strcmp(pdev->name, "reg-fixed-voltage")) + return -ENODEV; + drvdata =3D devm_kzalloc(&pdev->dev, sizeof(struct fixed_voltage_data), GFP_KERNEL); if (!drvdata) --=20 2.55.0