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 E3995443AA3 for ; Wed, 15 Jul 2026 10:43:08 +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=1784112191; cv=none; b=lgm22gPMeMasQYrgj9WKEb8t4c/6Uax2yPXO0eusAjTfblCRBCOHuAHATNOKRPU8s5JqrA3WHOj7lPU4PsE8QTJVUn8531hfzSpSisBbbaYVDVBV3DzppuY1FJkJ+ytEcscWH8yGokdV+VTabVFFTBfgX9b+eVftoNvcNOa5PPM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784112191; c=relaxed/simple; bh=aa3pG2P5vQO0i02r0jp442RpbvJBP4nam9HCCrn4gJ0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hZQ//IiuTrj537mK5g1NwB7JOtLe5gl47BwEoze95BmAuO/uby5q+lT4HVZPzx0fuN1BFPvfCdDKmV0Bzx+HRocFKnDZ0VcgBTdlgw6XtSjE5c8VL4UTcSN7CoqCuAMsI2obo8tLBKywxhh/ZPgk8bxh3Ev6lbAW2DZs5IQVAGs= 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=HxrILp/8; 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="HxrILp/8" 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 726B71477 for ; Wed, 15 Jul 2026 03:43:03 -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 789583F7B4 for ; Wed, 15 Jul 2026 03:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1784112187; bh=aa3pG2P5vQO0i02r0jp442RpbvJBP4nam9HCCrn4gJ0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HxrILp/8xWJRcJKfwOTDtEmGVzUqeQcEDwtf95IXKX0r8AnlcIqaTclZBGAz+deQa td8a18aK/BTSSujk9vu6zTwuFfSbCNqZrNxY4b+rAfSroseRCqRGY1fimMbFsuQJ3t cyq8+JcZR1oFNuzmvOr7JowQEcmQbjHXD5oXJUuQ= Date: Wed, 15 Jul 2026 11:42:54 +0100 From: Liviu Dudau To: Osama Abdelkader Cc: Boris Brezillon , Steven Price , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Heiko Stuebner , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] drm/panthor: return error on truncated firmware Message-ID: References: <20260714163056.22329-1-osama.abdelkader@gmail.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: <20260714163056.22329-1-osama.abdelkader@gmail.com> On Tue, Jul 14, 2026 at 06:30:55PM +0200, Osama Abdelkader wrote: > panthor_fw_load() detects truncated firmware images, but jumps to the > common cleanup path without setting ret. If no previous error was recorded, > the function can return 0 and treat the invalid firmware as successfully > loaded. > > Set ret to -EINVAL before leaving the truncated-image path. > > Fixes: 2718d91816ee ("drm/panthor: Add the FW logical block") > Cc: stable@vger.kernel.org > Signed-off-by: Osama Abdelkader Reviewed-by: Liviu Dudau Thanks for the fix! Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_fw.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c > index 986151681b24..39fff094ebb5 100644 > --- a/drivers/gpu/drm/panthor/panthor_fw.c > +++ b/drivers/gpu/drm/panthor/panthor_fw.c > @@ -829,6 +829,7 @@ static int panthor_fw_load(struct panthor_device *ptdev) > } > > if (hdr.size > iter.size) { > + ret = -EINVAL; > drm_err(&ptdev->base, "Firmware image is truncated\n"); > goto out; > } > -- > 2.43.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯