From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECD893E51F3 for ; Fri, 26 Jun 2026 09:14:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782465286; cv=none; b=uDscw249JKqzbBFLI/m4b+M1cfFmKt8NNrKawMcQyTnrDpIa0PIIVmdMfQdSS9tbstu+aCtt0PHv/yN1qD87Ta/yru6xXMhoRClbo5AojcPHW6lkvcWv/G1cCgaXzzWmPo7Ha0GGaVW/uqoZ2XMDRvP64Kurq0o1Hx0AGw61uXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782465286; c=relaxed/simple; bh=FvW/wYUykFkDvbA6mlDgK1yCPVtuwaEu2fiLJ/w9lyY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Lf4Aa+fMVe2PtIeORVwOqf6bkRdHfvVZGL8WOEC81JJfhdUJykpJrgFMXBovDOWGT5IOPB4VJUtDe/jAafrEc0Q7NG/mUCBiexzyzB3+Xhb3h+3Os2KjkXF1dmHh4KM4VAjQDPRAZRPxIwVysax13IDVklgf2cXcFfTTHP0eyeg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=VHsVCvqE; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="VHsVCvqE" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D7B3F1655 for ; Fri, 26 Jun 2026 02:14:39 -0700 (PDT) Received: from [192.168.0.1] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 372E53F836 for ; Fri, 26 Jun 2026 02:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1782465284; bh=FvW/wYUykFkDvbA6mlDgK1yCPVtuwaEu2fiLJ/w9lyY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VHsVCvqELL/VJWJmVlUKodoHEWlpDQrsm2Bkmrd8gt0G7A3GjNMTQuDfpFXeuVxrD lUwOUn6vq7fZJnQv4BWhxTzHfVn1zOnQ0EtdGZXPmT4FOm9wvfRpOyaZhfDJ9wPP3C yexlh6a6fts0aBb3IkfDF4zo2W07V/uIbVkKdY/w= Date: Fri, 26 Jun 2026 10:14:32 +0100 From: Liviu Dudau To: Boris Brezillon Cc: Steven Price , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Nicolas Frattaroli , Chia-I Wu , Karunika Choo , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, sashiko-bot@kernel.org Subject: Re: [PATCH 04/11] drm/panthor: Fix potential invalid pointer deref in group_process_tiler_oom() Message-ID: References: <20260625-panthor-misc-fixes-v1-0-b67ed973fea6@collabora.com> <20260625-panthor-misc-fixes-v1-4-b67ed973fea6@collabora.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260625-panthor-misc-fixes-v1-4-b67ed973fea6@collabora.com> On Thu, Jun 25, 2026 at 02:40:30PM +0200, Boris Brezillon wrote: > If heaps is an ERR_PTR(), panthor_heap_pool_put() will deref an invalid > pointer. Make sure we set it to NULL in that case. > > Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block") > Reported-by: sashiko-bot@kernel.org > Closes: https://sashiko.dev/#/patchset/20260625-panthor-signal-from-irq-v5-0-8836a74e0ef9@collabora.com?part=2 > Signed-off-by: Boris Brezillon Reviewed-by: Liviu Dudau Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_sched.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c > index e97f29469d28..8fd4d97b062e 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -1600,7 +1600,10 @@ static int group_process_tiler_oom(struct panthor_group *group, u32 cs_id) > if (unlikely(csg_id < 0)) > return 0; > > - if (IS_ERR(heaps) || frag_end > vt_end || vt_end >= vt_start) { > + if (IS_ERR(heaps)) { > + ret = -EINVAL; > + heaps = NULL; > + } else if (frag_end > vt_end || vt_end >= vt_start) { > ret = -EINVAL; > } else { > /* We do the allocation without holding the scheduler lock to avoid > > -- > 2.54.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯