From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 3F0012E7379; Sat, 30 May 2026 17:31:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780162273; cv=none; b=FQIXqg6BLTSmAv/u3gvRyk2K9ISkJ3pAKXm0L6AiQ9HATpIjclS5TkkK4kvU7Y8oBLjOR96XPo3fG2dh05dFuwP0EKORjvZ3SiXZrkpiLHYgld0Wh7HFRy3jK6j+PJBJu82HJUDFLJvGzjK8+iZ6PFoG8d4V1lhf0kPwJAfAnC0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780162273; c=relaxed/simple; bh=cUFP7FB/+8CYqUj7A9Ag03pVYZK6KWbSrl/TGo+9Z2k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iINcwU8M/kEy2Y9Slu3awSWszLZGwPiBsD+MKtuj8CPhxA4TaGL3NLEfl9FFGZPX/B0joyh7apydC/+OyWTmxq4Bx5rk9LvY5qdCzG5DaxnXrM3EHkEcm59fhqSAPbZsXcqXh7wwkAhOKWyJVCutXCEVFgrVKa0J/jv1x8Ap25o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rVQUbYdX; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rVQUbYdX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 819C81F00893; Sat, 30 May 2026 17:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780162272; bh=ksCv0qoaiN89Z10Zg6OfKK5/vylIxqXl8pWWFZVkTvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rVQUbYdXvw64R7CrvEjd+jy5kb4fyGFXFSVj4V542lfAuK7S3Tv/Z7he5O9hF93Bc WnBeguJFC8D7eETGDzG9qjlTx9JBi8DNMVh8gBvGSH2EjsyB/4H4AkSaS0EckU5SWu PpN1tvh26PVbx4hgxw4wMTO3e3nOy52wQkHUdFbc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Bartosz Golaszewski , "Rafael J. Wysocki (Intel)" , Andy Shevchenko , Sakari Ailus Subject: [PATCH 6.1 873/969] device property: set fwnode->secondary to NULL in fwnode_init() Date: Sat, 30 May 2026 18:06:37 +0200 Message-ID: <20260530160324.791967997@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bartosz Golaszewski commit 215c90ee656114f5e8c32408228d97082f8e0eef upstream. If a firmware node is allocated on the stack (for instance: temporary software node whose life-time we control) or on the heap - but using a non-zeroing allocation function - and initialized using fwnode_init(), its secondary pointer will contain uninitalized memory which likely will be neither NULL nor IS_ERR() and so may end up being dereferenced (for example: in dev_to_swnode()). Set fwnode->secondary to NULL on initialization. Cc: stable Fixes: 01bb86b380a3 ("driver core: Add fwnode_init()") Signed-off-by: Bartosz Golaszewski Reviewed-by: Rafael J. Wysocki (Intel) Reviewed-by: Andy Shevchenko Reviewed-by: Sakari Ailus Link: https://patch.msgid.link/20260506115701.23035-1-bartosz.golaszewski@oss.qualcomm.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- include/linux/fwnode.h | 1 + 1 file changed, 1 insertion(+) --- a/include/linux/fwnode.h +++ b/include/linux/fwnode.h @@ -193,6 +193,7 @@ struct fwnode_operations { static inline void fwnode_init(struct fwnode_handle *fwnode, const struct fwnode_operations *ops) { + fwnode->secondary = NULL; fwnode->ops = ops; INIT_LIST_HEAD(&fwnode->consumers); INIT_LIST_HEAD(&fwnode->suppliers);