Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1272694rdb; Sun, 7 Jan 2024 11:30:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFswtEBTFciWqMUQVQjC4b3VJkWxix0jT3HtVeGPmC9PVrACb37ITkzy65m2Jsmik+7ep4M X-Received: by 2002:a05:6358:6f1a:b0:175:64c5:a900 with SMTP id r26-20020a0563586f1a00b0017564c5a900mr2508460rwn.60.1704655853061; Sun, 07 Jan 2024 11:30:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704655853; cv=none; d=google.com; s=arc-20160816; b=EkwSBWGH4TaP0o4KuKRAzmVgFUlNxmm0gDg+vtp/bL1dgsr5MC80a/mKyUTJmkjU3A d0mImriPsyUHamgB2sh0SrDEb0CDWQhiLU6pYWTFFj7pvxTpxNvSjfFvNtry/8LNGabi fy3I5b4mY5iJrkFeQ3ev/Ndc4OfhIiqSsuCFAz7LwTADQGxcsvZELaxke3K4sWjUbFNn CqS9UOOiGubPktUGEXNDFxhvGsb2WkWChPI5pdM22hYFyzVVTKAf9JjskeB8sY4L0c+C 7ggyUMn6L6KOUKV9xKHldNmoP7HZHDQfW3BU1BBkJig2Nf+iMCPE9XuNTDjHgpGvraCj Lb3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=importance:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:references:in-reply-to :message-id:cc:to:from:date; bh=ldzDY8cc22vFqZMPOW9eLLnZ/tjMS9X3x5GFJ4Hg/dM=; fh=qS2Pl7VY2bZ5goi/kGCQb0Vigyk5rJQXGuOJP4wwqSw=; b=nLMUjZIJwVlTtLyld5wUlIQC1S5ovHMnwv1j2TzdYZptRBU4BsNvsVjVN+qzpt7n2e LYKuwHuUrh/ercK0r+Kf9dmb1oDjanT7s+8sD3n/LF1wJIshmDEz6U0oDKrIXfnCvKX6 wd+c3Dzm6ZPD1zMNpKjGwa6P5bxefx0/sODzHu2TAdaQgRt0EmQhJe2TD2kQlJso6O1k 20AYvBZuTuLvRhWd6PlrrxF5jD1vP1NUuHwoE+k2DLCc5zEAl+h7go4BaWp2ils1jpYE 2nV/9LZsDsv81ss6iheds4F1z0VAivq3FgRaeizI05t0hS+YamDGHTZPAEVW+hQe3OXj L+DA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-18965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18965-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t8-20020a17090a2f8800b0028bd6ea91e5si4315863pjd.122.2024.01.07.11.30.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 11:30:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-18965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18965-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id ADE17281776 for ; Sun, 7 Jan 2024 19:30:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8C6D11193; Sun, 7 Jan 2024 19:30:45 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from sxb1plwbeout02.prod.sxb1.secureserver.net (sxb1plwbeout02.prod.sxb1.secureserver.net [188.121.53.192]) (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 9CF5411188 for ; Sun, 7 Jan 2024 19:30:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=squashfs.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=squashfs.org.uk X-MW-NODE: X-CMAE-Analysis: v=2.4 cv=JNb98eGb c=1 sm=1 tr=0 ts=659af14c a=xZsz1WqYln3YGRp0IohaNA==:117 a=xZsz1WqYln3YGRp0IohaNA==:17 a=ggZhUymU-5wA:10 a=IkcTkHD0fZMA:10 a=FP58Ms26AAAA:8 a=VwQbUJbxAAAA:8 a=OQEHJ-BNlmcVwaK9_LUA:9 a=QEXdDO2ut3YA:10 a=EebzJV9D4rpJJoWO5PQE:22 a=AjGcO6oz07-iQ99wixmX:22 X-SECURESERVER-ACCT: phillip@squashfs.org.uk X-SID: MY9KrZPrXz19A Date: Sun, 7 Jan 2024 18:45:30 +0000 (GMT) From: Phillip Lougher To: Markus Elfring Cc: "kernel-janitors@vger.kernel.org" , LKML Message-ID: <522978349.868758.1704653130312@eu1.myprofessionalmail.com> In-Reply-To: <49472d26-29e6-443f-b0f5-21967a67dd4a@web.de> References: <49472d26-29e6-443f-b0f5-21967a67dd4a@web.de> Subject: Re: [PATCH] squashfs: Improve error handling in squashfs_decompressor_create() 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-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v8.19.35 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfOp6H2w7Gin0kDxhYJ6f54ZB0ExIU0in4Z5vWX/LeMg+nZcHXaBIR+/2mkPHvBQmNjfBWbbKLD0XcFwfpM1/kcigFSOKoONRTeOp/6a6kDiRjsbxuXPT GOVeHmhOQRkX7dsmvOB+cBFgXUZlroRfuhAk1Rpbac0Gyd0VPSBJugSMrBhBf+SKBBtPC9znBuvdznfJE8uKHiz03Bc4r7KArLn7IlR7nu5KevHVsbDxmJxu i/oTUkoeXh+3TsrbdaLr/PA5zMLQUVdWsqjeonV8cW8awiAB6uoHiwAsv7GjSe2OHMkO82zJSr6LVgkNjfxhPLxKxibwyHOddwvE/Lrmcjs= > On 30/12/2023 09:55 GMT Markus Elfring wrote: >=20 > =20 > From: Markus Elfring > Date: Fri, 29 Dec 2023 21:30:26 +0100 >=20 > The kfree() function was called in two cases by > the squashfs_decompressor_create() function during error handling > even if the passed variable contained a null pointer. > This issue was detected by using the Coccinelle software. >=20 > * Thus return directly after a call of the function =E2=80=9Ckzalloc=E2= =80=9D failed > at the beginning. >=20 > * Use another label. >=20 > * Move an error code assignment into an if branch. >=20 > * Delete an initialisation (for the variable =E2=80=9Cdecomp_strm=E2=80= =9D) > which became unnecessary with this refactoring. >=20 > Signed-off-by: Markus Elfring As mentioned in this thread (and many others) https://lore.kernel.org/all/20240104204032.GN31813@kernel.org/ calling Kfree with a NULL pointer is perfectly valid. So like most others I'm going to ignore this patch. Cheers Phillip