From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f175.google.com (mail-dy1-f175.google.com [74.125.82.175]) (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 74DB426AA91 for ; Sun, 1 Feb 2026 17:41:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769967713; cv=none; b=sneykrOacPLMmIH8HgQEHSPSPZgzldeAmASWE7K+v7nbCe5wkFmDnS+A+LmvlXBsvLFjRNvPqSMZoyLi1vuGwNMdUs1StpI/B4tI3101zAei+BkXKZdJVOsDnWjyrnSSWmK270qoNqN8UDXZgVvqQGYUwjWFW/i4h2KRakrGywc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769967713; c=relaxed/simple; bh=Z2xWZTP7yYyZ8vjYmOZSCjzsryy3Jprv9gx9FDarUhc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mCo9DgQgOQ3OJtkx4q5/6OUTQus0QEkIrRfXCfVyQKsBupS8wOQh29Fbco5QN9WHZzZWdgx1pFXDq6XUK5gJpKVl8+6vSZVrEW+KmBjFzlZDn9JYAfqmoAGXY+Zn5b2JThp0r9dEGlTGX8HKdWntNI6MlmJZ57soGb/QUEZflnw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=asu.edu; spf=pass smtp.mailfrom=asu.edu; dkim=pass (2048-bit key) header.d=asu.edu header.i=@asu.edu header.b=jHSv8CQG; arc=none smtp.client-ip=74.125.82.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=asu.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=asu.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=asu.edu header.i=@asu.edu header.b="jHSv8CQG" Received: by mail-dy1-f175.google.com with SMTP id 5a478bee46e88-2b4520f6b32so6913023eec.0 for ; Sun, 01 Feb 2026 09:41:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asu.edu; s=google; t=1769967710; x=1770572510; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=kOV12rWpqihzHlDSFZMOhY48oPOESyDjFwOMFN7I8pY=; b=jHSv8CQGrEX9Ja3BhNH/Mxa4f283GnjQg0ALFjmditNLSgUcH0fubFmtVW/ymbO16S BMyD1OGXTV4OV4bWfEM8WA2Xz9zU26imDTNCc5AbVeYnkLrrQaeWK8G+XS3SBzMDCxqK +cftiPSAXV0HnvWCTXBhWANu+jJUSC6UHNQhXPILqYqun2xqx1oG/h6gdsK4N5LqFymU MbDycLAAxMhKLnp8zh0qFZKT1XopRAw4fXmC9sh8LTqeFPpNsKFQ6hG6InmutCtBzHQU KYD3Y7h6HB4GIY6IG13vSumZsCdFrGgpfszKMDlJ4ix4/kIy3fnPzFpZ06MOlvfHH/CU L+9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769967710; x=1770572510; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kOV12rWpqihzHlDSFZMOhY48oPOESyDjFwOMFN7I8pY=; b=eqozXyjjIj3NxG7XHxNc1iFiXjTwHiUcsYoZrn6NxX4gw0yZhz/gWOuLXj0RBxmivr 3W0oN94HSuz6s+wV5TUK71LaYMLKwizcu9xdxXE0zJbJOAEfB/LxT2Y5l8gGXJMm2wox hmvLH+zE86GpenISGR80wslCZgiz4EsXJhAEJjP6pe1HWPJlC0o+/Zcz1bGRFkyYPJ+j Ai8E8RNLq69TWriQawOb7XfjLwrQlGze0ZW+ror/NbzmMdnn6jsnLRO3t/PHAmBQMuBw zH8OGnEwphOJa7a0P4zAqEqO/V/sdAMoFapqjVgPzHSI99K2uy2MI6ad43zQ/H07WJAd zY6A== X-Forwarded-Encrypted: i=1; AJvYcCXUjcFCDriN+mA6mw+x8VOJqZp+nfRlX0Qtn4Ka69U3awDARV6/d7jS5g57fUjzg0efH9LXkIDiqQtnSAk=@vger.kernel.org X-Gm-Message-State: AOJu0YzaeF2C+2DQW6hyuhNklofqxLO90RptLJ6HA5hHQrXVFIf+oFVC y9mk98yHrG7wEwkg3AFbArhC7lnFTQMu8HO741ovgUta8q8exaO3YkcyC643qpn7pA== X-Gm-Gg: AZuq6aIJKvVTeWlJiM5FeukEGfuKc0EL/c0eFIw9qdxThUJPebT/MKvt23Y9ci5wo7+ AWJ5uSqvUeDVgHF3Ir2IUnhyjLU8QYrgli2z2ZG65lv0Jrvf1kbXNew6lD4uNBqVsArVODjWgFm K/53SaXE5SqjxPPv9AhDpEuXFkxmmGVdNbRKXuonVADutKOpwa2JFhlS8tWgbRboSbBHVuB6nx8 tK0SMWTRzF2LInrtF/cA9EDKCrt3d2S9espf8M9hlOY4ZbQEP6oTParkes7G8Uswm17Q01IConW vsDmldIKoytofcBbKMYYp0GLeZZ04aUdkUzCzqnS1QILEmAEdVOcYUJBDaPz/+DqbxkTL4T5QKp bXQ3HlmdutEaiXaEHoL5CRweNtPlyfjm4uWL51CEh4yDJCdDfKdcjxUwgTFBlSQX2zAMOGw8AOd YYM6jbHVr6x63UkKryHpfsTOiCci8= X-Received: by 2002:a05:7300:7306:b0:2b7:2fff:ed1f with SMTP id 5a478bee46e88-2b7c86657admr4535532eec.17.1769967710524; Sun, 01 Feb 2026 09:41:50 -0800 (PST) Received: from gmail.com (129-219-8-213.nat.asu.edu. [129.219.8.213]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b7a16cfa53sm18701642eec.1.2026.02.01.09.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Feb 2026 09:41:49 -0800 (PST) Date: Sun, 1 Feb 2026 10:41:47 -0700 From: Will Rosenberg To: Tejun Heo Cc: Greg Kroah-Hartman , Oliver Rosenberg , =?utf-8?B?5p2c5LmJ5oGS?= , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] kernfs: fix NULL pointer dereference in __kernfs_new_node() Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Feb 01, 2026 at 07:05:50AM -1000, Tejun Heo wrote: > Commit 382b1e8f30f7 ("kernfs: fix memory leak of kernfs_iattrs in > __kernfs_new_node") introduced an err_out4 error path which frees iattr > when security_kernfs_init_security() fails. However, iattr is only > allocated by __kernfs_setattr() when the node has non-default uid/gid. > If the node uses default ownership, iattr remains NULL, and > security_kernfs_init_security() failure would cause a NULL pointer > dereference when err_out4 tries to access kn->iattr->xattrs. > > Add a NULL check before freeing iattr. > > Fixes: 382b1e8f30f7 ("kernfs: fix memory leak of kernfs_iattrs in __kernfs_new_node") Thank you for reporting the bug. This bug has been fixed by Commit 2b742094582d ("fs/kernfs: null-ptr deref in simple_xattrs_free()"). Commit 382b1e8f30f7 ("kernfs: fix memory leak of kernfs_iattrs in __kernfs_new_node") was also caught from entering any stable releases, so the bug should be fixed on all active branches. Please correct me if this bug has not been fully addressed. -- Will Rosenberg