Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4061466rwb; Fri, 30 Sep 2022 12:13:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7uGPkfQySPTPIcTdM72QOBFbVEsAM7J1W53GqasGLhiNqT0Rmo+dVDmYbggr6ArmBuDIQx X-Received: by 2002:a17:906:794f:b0:781:dbee:4256 with SMTP id l15-20020a170906794f00b00781dbee4256mr7519007ejo.404.1664565186545; Fri, 30 Sep 2022 12:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664565186; cv=none; d=google.com; s=arc-20160816; b=HvzgwGGe4Dx6sTN+aAjn7FweBZ2JxPuAg0ojtwJdEX5bgobjYPunykdKMoHYqsGeJa OGxDeJZLaIAgX4KqoHQ+iPB/+dRn5qHhaeQzhgfQQa50MeFCXnNQ4NqUpANN6yBOG7EE QIAArhoooBcABSCmSNhVrgpzd4/eteejBFzIwCgBn3oEbxFIp8hK6eihrCRKhjfiYbvr K5Vu4e9MD+PUTzGTvz4posVGSpH0zJMLYGJKbQLMkeZGkOjBzjVxuXdexgxf83q9Oyhd /OCNeWhp8VXmi6qktvNsjWPwaMeNxZ+cXsL+fPVOUEouaNFvZJ4cG8zswyUVufYfGwT2 /4LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Y0jkg0UfITvu715KQMSBhfyS1TFcoNUOpfI9/MT9+hU=; b=t4Y5Cbbqlmqpssc/6u7suA20c6mkuOAx68Y+UvQSUgzjTOE+tUGsJqhXqU2ZlBf01Y donwjuYyNq6rsyk48r6qAE3Sy9lppTBsyrs2boA+HdJtU5nlaxmGBF/VBU5LEeIlRQ5e b6XkcljMd+PKnJy3gwnTxbpvnIKWp+l3h5Xe/96o1fT8pdFi3sGfGRXa4itwCh9jdVc4 76jofSOyqnpa0j8KZMczsu1oqokRbEWraxvsiBvS1oNBtWlxJv8QEMEH+bh1l1UsmwNW +hk+N/zaVjtOzQnOibOWjUqTa3b5L/2r4RXj0br3D2lh3AlPkEpzJbLDr+mPawE5VWJG dYZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SJlmL8pG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a056402084500b0044eca55b86fsi2864708edz.367.2022.09.30.12.12.40; Fri, 30 Sep 2022 12:13:06 -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=pass header.i=@chromium.org header.s=google header.b=SJlmL8pG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230309AbiI3TIy (ORCPT + 99 others); Fri, 30 Sep 2022 15:08:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232058AbiI3TIp (ORCPT ); Fri, 30 Sep 2022 15:08:45 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 773711D8496 for ; Fri, 30 Sep 2022 12:08:44 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id u69so4930188pgd.2 for ; Fri, 30 Sep 2022 12:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=Y0jkg0UfITvu715KQMSBhfyS1TFcoNUOpfI9/MT9+hU=; b=SJlmL8pGdRuQmveG772+ss+QQnvFj9fpBjKyuxdT8ajkZW/YPP75CX1SiJ2oC6jffJ V03m1cfV7AxqKe2biiwYMfcCmlvf/Zx8JQMxoYLyXOKWoO2Qn5v0wLompjH9pBdGmrIn vPj83g2YlWSfU9c5U3dQFT7SzmNyq82mXDNBo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=Y0jkg0UfITvu715KQMSBhfyS1TFcoNUOpfI9/MT9+hU=; b=2oSpNIWlH9RgGAHxfoJExlZHSVp0CeYAz3ndZxFGBdG7vz+jnrHoL0hoRiA0X5MtAS HVpyNBspShY+s1NwBp+cgskto39ZEsBd/7GsiTLUXDdqnpeUDbOHxBSdOUv+D/h38IFm F8Qwz04aYJojtLC/sk2J98jwe1EKCE1wLVJBXTHIPSiMyvO+bcDHO8dnYxgK93WcuO+/ YklN19nNPTFnA4TZDBdUX7G76tigpngjd+AzBTQIcxsxgak0FQnZU2WkQv2w6P5HWoRP KLw+uL2NN4TcGhj8YpSQoQexL2t0m657Wv7c8sP2JrZoa/kCNZoiHWmuivrN2ebInUaB 6WFA== X-Gm-Message-State: ACrzQf2h0IHZf/u8KyDa9h4Z32SBZGJem9fezZgdpCwQNGBUIAPp29Pq AMCMARpjpoY3zp3l+v9cf7pJo3tBK1/s7A== X-Received: by 2002:a63:3c5:0:b0:43c:8455:d67d with SMTP id 188-20020a6303c5000000b0043c8455d67dmr8978718pgd.73.1664564923801; Fri, 30 Sep 2022 12:08:43 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l6-20020a170902d34600b0016c0c82e85csm2258000plk.75.2022.09.30.12.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 12:08:43 -0700 (PDT) Date: Fri, 30 Sep 2022 12:08:42 -0700 From: Kees Cook To: "Guilherme G. Piccoli" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, regressions@lists.linux.dev, linux-fsdevel@vger.kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, Anton Vorontsov , Colin Cross , Tony Luck , Thorsten Leemhuis Subject: Re: [REGRESSION][PATCH] Revert "pstore: migrate to crypto acomp interface" Message-ID: <202209301207.66D6069757@keescook> References: <20220929215515.276486-1-gpiccoli@igalia.com> <202209291951.134BE2409@keescook> <56d85c70-80f6-aa73-ab10-20474244c7d7@igalia.com> <101050d9-e3ec-8c21-5fb6-68442f51b39f@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <101050d9-e3ec-8c21-5fb6-68442f51b39f@igalia.com> X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 Fri, Sep 30, 2022 at 03:31:17PM -0300, Guilherme G. Piccoli wrote: > On 30/09/2022 12:51, Ard Biesheuvel wrote: > > [...] > > > > Does this help? > > > > diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c > > index b2fd3c20e7c2..c0b609d7d04e 100644 > > --- a/fs/pstore/platform.c > > +++ b/fs/pstore/platform.c > > @@ -292,7 +292,7 @@ static int pstore_compress(const void *in, void *out, > > return ret; > > } > > > > - return outlen; > > + return creq->dlen; > > } > > > > static void allocate_buf_for_compression(void) > > > > Thanks a lot Ard, this seems to be the fix! Tested with lz4/zstd/deflate > in both ramoops/efi backends, and all worked fine. It makes sense, > outlen was modified in the previous API and not in the acomp thing, so > it was a good catch =) > > > >> Heheh you're right! But for something like this (pstore/dmesg > >> compression broke for the most backends), I'd be glad if we could fix it > >> before the release. > > > > Yeah better to revert - this was not a critical change anyway. But I > > think the tweak above should fix things (it works for me here) > > Agreed - in fact seems it was reverted already. More than that, I found > yet another small issue in the acomp refactor, a memory leak - attached > is a patch with the fix, feel free to integrate in your acomp refactor > when re-submitting (I mean, feel free to just integrate the code, don't > need to send it as a separate patch/fix). > > I'm also working some fixes in implicit conversions in pstore that > aren't great (unsigned -> int in many places), I'll send some stuff next > week. Awesome! Thank you both! I'll probably be busy for the next week with the merge window, but after that I'll pull new stuff into -next for pstore. I appreciate more people poking around in the code. :) -- Kees Cook