From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A152EC433F5 for ; Fri, 30 Sep 2022 19:08:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231678AbiI3TIy (ORCPT ); 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-Google-Smtp-Source: AMsMyM5WppkI2prI3B2ix7AQu6tolb6o8CcR43jgfg0hmGm+zuqvhTTbtPJRC4076JhRaT1VYU8gYQ== 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> 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