From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 76F3C3D9045; Fri, 27 Mar 2026 08:54:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774601696; cv=none; b=JHJDuWZ+F9m+D5fx/CSwmzOfn3QHV3i4g33jfJNSVqdXufV0vCBNsP9MGEnzbrJOkdb2Za/h2WU55M2p+B2PP6+Plh2Ay+rbcepTkB0uwYNCVhT3Uz3EgVJgpDzrgxdJEVhXpM+p23vABC8xUqfTZoQ36c/kKotCjL8z0ubEzfk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774601696; c=relaxed/simple; bh=GT5s6SukjMZBZVEPM5ZT8q2nEZACMQgI+mtZ4XZWFMM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G8TLoG08xllyYexE1cUuUxWBXcfhaE3EVQAVLd9mFHqRgNjhO4D9O+MNXZxAzAs/ms10CeH64QbqmXJ33w/JyZbzfxn7CmLIDCmno7sdjJxkAZnHXXOTewNS7WsOy+TXzkZApwLKHEBhoN/hfdMmLnpUKLRoofrbVe2dw4cE3N8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gbYSLisq; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gbYSLisq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774601694; x=1806137694; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=GT5s6SukjMZBZVEPM5ZT8q2nEZACMQgI+mtZ4XZWFMM=; b=gbYSLisqCV1zqvOry6ABxJdjkQBSYa0J4t4+nI9E4yVMEguz4w9i7nRn 0CDBtfIQFONoTj6Hpv5ql6YTRnShF3skNe+tepnTAge880wCcMkpIY0AL Wrq/aBWFNXdSOd8rKA7WTEWsPsZ4VZxCRUu52OTK9HFjbIRwSB0TVK8W5 vAtXCtqQDCLypC55cM09w+OsG3kXZzzZnYBreKs4odk3ptl8BCQ3KhM1I z32aMg30T3CUE7DAkPaLig5SeO4AcZZiC1KGnL9YOBkApMZufVOT6NQ8J Wa7nwnWf/TPWIyPwEn9GsrOrUZfVXxLFgkaZpsCS1s0gBDWAiBL8Ur78J w==; X-CSE-ConnectionGUID: JLKvOQueTlivp9FMU6E9dw== X-CSE-MsgGUID: gu3DG+rATSa7ypheedRKmw== X-IronPort-AV: E=McAfee;i="6800,10657,11741"; a="75386697" X-IronPort-AV: E=Sophos;i="6.23,143,1770624000"; d="scan'208";a="75386697" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 01:54:54 -0700 X-CSE-ConnectionGUID: WuY9rM5aTSOLyJKZuw5YLA== X-CSE-MsgGUID: 9gOiy6CPRXevPJwTJfN1Ow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,143,1770624000"; d="scan'208";a="230185947" Received: from vpanait-mobl.ger.corp.intel.com (HELO localhost) ([10.245.244.127]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 01:54:52 -0700 Date: Fri, 27 Mar 2026 10:54:49 +0200 From: Andy Shevchenko To: Geert Uytterhoeven Cc: Guangshuo Li , Andy Shevchenko , =?iso-8859-1?Q?Jean-Fran=E7ois?= Lessard , Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] auxdisplay: line-display: fix NULL dereference in linedisp_release Message-ID: References: <20260326171412.1109402-1-lgs201920130244@gmail.com> Precedence: bulk X-Mailing-List: stable@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: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Fri, Mar 27, 2026 at 09:10:50AM +0100, Geert Uytterhoeven wrote: > Hi Guangshuo, > > Thanks for your patch! > > On Thu, 26 Mar 2026 at 18:14, Guangshuo Li wrote: > > linedisp_release() currently retrieves the enclosing struct linedisp via > > to_linedisp(). That lookup depends on the attachment list, but the > > attachment may already have been removed before put_device() invokes the > > release callback. This can happen in linedisp_unregister(), and can also > > be reached from some linedisp_register() error paths. > > > > In that case, to_linedisp() returns NULL and linedisp_release() > > dereferences it while freeing the display resources. > > Indeed, the attachment is not yet or no longer available when > put_device() is called. > > > The struct device released here is the embedded linedisp->dev used by > > linedisp_register(), so retrieve the enclosing object directly with > > container_of() instead. > > True. > > > Fixes: 66c93809487e ("auxdisplay: linedisp: encapsulate container_of usage within to_linedisp") > > Cc: stable@vger.kernel.org > > Signed-off-by: Guangshuo Li > > Reviewed-by: Geert Uytterhoeven Pushed to my review and testing queue, thanks! -- With Best Regards, Andy Shevchenko