Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4277235rwi; Wed, 12 Oct 2022 13:15:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hJtEvvZBjbSJmgSC878+FomY5NrMUnPwTITkYuaaokV7EfadL2MAY45PfzZysl4xRkVxr X-Received: by 2002:a17:906:5a6a:b0:78d:d25e:55de with SMTP id my42-20020a1709065a6a00b0078dd25e55demr8293516ejc.130.1665605701973; Wed, 12 Oct 2022 13:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665605701; cv=none; d=google.com; s=arc-20160816; b=sTdh/APXIhfbS1Sa3mT7VSM2FUVdcTp6NDLLr72DljxO5P4fbemxAXjUy1NXHQLVqR ZABtY88fu8+mTuVyPT4zZgL+jf83Or11pPwmQ8fa/vZdWsshP1yInZZt9aI8M6Z8ugPK f2eKZtyQttkYNBoFlY3OJQE+On9u66sX4Ulq/ejzv8GOpfOgmogQsAIwh606PXGxTZrB hJLfdH22o0dMj+CkN7vOwbvUyBV8QWYjksVGNL2asbBglHSsn57/AYrAfJsBy9kMzgsa OmwBkkgL+NnHGIcbLhrqVNPjGAfpNW357Px8IL0l5xPDOgx6Wv6/j+f8cBGjxY8YM4qw j8yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SEsOJPccncUf9asxPB8n32Yu7J9QL+U/NyQGwZbIDxY=; b=EqmllHozUdVk9ctNzKSs2eV5wWv+tdvb3mluWzi3teJXSYdhPXEIs6mT+Uxwg3yZ9J GF0GCa6I+/qHG4EgEUT4GIqgrUhwguR6CCxh1Q3w7Om8a6Bs+gPvMT0lA/Vq4yYDKmau BdKOkNbv42/0yLFJEvPdPsbrO1qWVQvOOmj0CRKVQemhw7UQwT6bF9n25ajm0rcfUtw8 gwto92HZ2QEhDdd9xl7d6ykPFPjlB2Ru4Jcu9ADOBxiF+d15uiiDAavZN9Oae1+6iG+5 aV0dFOl8xXr4ZWI8sIfcJUQWXctTlr/N3EPyOHAFSK7ajlI9RHPB2sfssbh38EjuA3qD A4Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=pwO2Zcxs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga25-20020a1709070c1900b0077fd6028710si16863921ejc.670.2022.10.12.13.14.36; Wed, 12 Oct 2022 13:15:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=pwO2Zcxs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229618AbiJLToT (ORCPT + 99 others); Wed, 12 Oct 2022 15:44:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229589AbiJLToL (ORCPT ); Wed, 12 Oct 2022 15:44:11 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40F3278587; Wed, 12 Oct 2022 12:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=SEsOJPccncUf9asxPB8n32Yu7J9QL+U/NyQGwZbIDxY=; b=pwO2ZcxsQ6YRCYHbiroRiyKNKc lxZea+9q4J+fpIByQsWxyL9FlyFveWgsASEvhofYKp/WXWzD38fw0PXJjJbt1u0SMcCdH0bhhNqw1 SixEEKDI4TysV682FECEehB4iTxX4I9n47Gqb9MzZcJcNyPdQnyUVX9rJVg17amhQO1rsegJaQgsm 4628S+MNW18763YXxsJ37TDHQB/3rdRrl8FKra6qSCEZb6eFNBRK9S47RFNby6k7DKbScfjosSZYr yoKtyc+eTWWMFF7zdxdZYVBlBFT2rYLJJYWLEua9jLECwY/YKocyR1W17XDdkC1YrdIuO2yvzefAv UCDEHP3Q==; Received: from 201-43-120-40.dsl.telesp.net.br ([201.43.120.40] helo=[192.168.1.60]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1oihe5-000OLe-Oh; Wed, 12 Oct 2022 21:44:02 +0200 Message-ID: Date: Wed, 12 Oct 2022 16:43:46 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH 1/5] pstore/ram: Consolidate kfree() paths Content-Language: en-US To: Kees Cook , linux-hardening@vger.kernel.org Cc: Anton Vorontsov , Colin Cross , Tony Luck , Paramjit Oberoi , Ard Biesheuvel , linux-kernel@vger.kernel.org References: <20221011200112.731334-1-keescook@chromium.org> <20221011200112.731334-2-keescook@chromium.org> From: "Guilherme G. Piccoli" In-Reply-To: <20221011200112.731334-2-keescook@chromium.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/2022 17:01, Kees Cook wrote: > There's no reason to keep separate kfree() paths: either all allocations > succeeded, or not. Everything is torn down in the case of failure, so > adjust the callers to reflect this. > > Cc: Anton Vorontsov > Cc: Colin Cross > Cc: Tony Luck > Signed-off-by: Kees Cook > --- > fs/pstore/ram.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > Reviewed-and-tested-by: Guilherme G. Piccoli Tested by building / booting and triggering crashes with efi and ramoops backends. Cheers, Guilherme