Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1274380rwb; Fri, 7 Oct 2022 10:13:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gYDFkOjEU3TGpsoqtAjriNbizvkchsuDi+OUJiMuJYxQT7ETdiLoXV+1WCqYHOp9ChM/3 X-Received: by 2002:a63:ea48:0:b0:43c:69c4:68d4 with SMTP id l8-20020a63ea48000000b0043c69c468d4mr5467461pgk.416.1665162826990; Fri, 07 Oct 2022 10:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665162826; cv=none; d=google.com; s=arc-20160816; b=DghAvf5I0hzBJ8egzmI8+82WHwwt1LGnho+u6DFfrHswnMdzX0Og+PcQIBsdibzXk4 Heio60nzh1gqQ6JIgBkO3lTivCamA4yuzLDEGrPgB0KfqM0zS35DCOcyqfGM+5v31qnV n78Lq7H2EyY4FN86BLr4pemX5TcBUvqPk3wi0RuJyqcF1iL6JuEGZ5tp0nvziOaq2lrp bUGjT8U+jHVJ9j7NXUiAcQSXf5EgYasaNQIT5Vy6AMJq6JDlJxQtEz3rGK5nS6gGJSjd q/w4GGUjJq3nhuUIyyqn04w6/TpzaiS6+NwjtVnCs9kVD45hmjSSzuf5tDmIerGjKYTa BJTw== 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=AQv93op+k5Gt9JN/aohlZjFMvqKcFqY8ovnVzXuwPuQ=; b=f4T6qtRGZTq60n/rdGIJOplwzIEbjfET0lYPYEwhkTJLLkIxuxemgDDCsErlkj1UU2 nBDZNc+wV8MjgP3MDS62UPwPRlaIt/fgzKXywZqFM8oRvxmSdqNH+ara6Gu6Nqat7nVX sK/rLyvbSPEdLp+k1gPgagQ2dDowQ6P5yHHDwRIbsJR5lkgjjeKWqCQ8nCq51hIwODKn XVTAysaD6cEF2OZEKxTiBS8FeuLrYk0zd7sdvdu9WPOYMSCp05Tr6cL4F1f6LDvHKUl4 YHS5ygKNhzIoXDtgi55jmrsDx8ROLFzjYPPuLXtgZsyEo4qB5IYLtBDU03VY92lmiRVK 0VTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="Pe/uWQRJ"; 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 a22-20020a056a001d1600b0056013ee5ae6si2426645pfx.178.2022.10.07.10.13.33; Fri, 07 Oct 2022 10:13:46 -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="Pe/uWQRJ"; 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 S229579AbiJGRCa (ORCPT + 99 others); Fri, 7 Oct 2022 13:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbiJGRCR (ORCPT ); Fri, 7 Oct 2022 13:02:17 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C25523D5BD; Fri, 7 Oct 2022 10:02:15 -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=AQv93op+k5Gt9JN/aohlZjFMvqKcFqY8ovnVzXuwPuQ=; b=Pe/uWQRJRr6GwWj3Jav6a4p2nJ kNYc9uK/kB0GygBjbdhpymaU7lg7RxmcmstpYzLgvusDwDg/MwqVtrKSMI8fDGhAzTB3yOG2qqLf2 Ro3zk1no8UKiiCrmJHYQY6NRtxaEnRKu9N0sjLxW6Nzrc4ADnq5W7lgUb+pcq/XdnM2FzwpKxxqXZ Qg4sbg7zj2jQnfb5LtIO+0kxVIENpfbBOkFdIa2AyTEuvFykXGlyv1WAHVP3ctIGNo/h+Bmo+O20w c/DhBVQ+gXs2ZyEk+dIFAwXgg3kqmpf4OE6WOCScPaEtsXURqdp7wTJJPpxJQYYWjCuvl36Nh8CEE poNb/34g==; 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 1ogqji-00DNEg-4I; Fri, 07 Oct 2022 19:02:10 +0200 Message-ID: <00780cd5-8c4b-dfe1-950d-393cbaaff3fb@igalia.com> Date: Fri, 7 Oct 2022 14:01:53 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 8/8] efi: pstore: Add module parameter for setting the record size Content-Language: en-US To: Ard Biesheuvel Cc: Kees Cook , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, anton@enomsg.org, ccross@android.com, tony.luck@intel.com, linux-efi@vger.kernel.org References: <20221006224212.569555-1-gpiccoli@igalia.com> <20221006224212.569555-9-gpiccoli@igalia.com> <202210061614.8AA746094A@keescook> <2a341c4d-763e-cfa4-0537-93451d8614fa@igalia.com> From: "Guilherme G. Piccoli" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 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 07/10/2022 12:06, Ard Biesheuvel wrote: > [...] > Well, I did spot this oddity > > efi_pstore_info.buf = kmalloc(4096, GFP_KERNEL); > if (!efi_pstore_info.buf) > return -ENOMEM; > > efi_pstore_info.bufsize = 1024; > > So that hardcoded 4096 looks odd, but at least it is larger than the > default 1024. So what happens if you increase the record size to > > 4096? This is a very good finding, thanks a bunch Ard and apologies for this mistake! Before this patch it was "safe" doing this way since the allocation was 4096 whereas the size value was 1024. Now, with my change this is not valid anymore, and my feeling is that it worked fine in my tests because I'm testing panic (which is a single CPU/no-IRQ scenario), so basically we're corrupting memory...but nothing broke in my tests due to panic scenario. Thanks again, I'll fix that - need to allocate record_size. Guilherme