Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3932054iog; Tue, 21 Jun 2022 08:40:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t63sBmdIc61+5uSXQV63HKq6De78WFc43/xs9Lkp+BwaxP4PchAa2XEifu1M64zsLvMxdE X-Received: by 2002:a17:907:e91:b0:707:c7af:93aa with SMTP id ho17-20020a1709070e9100b00707c7af93aamr26701469ejc.382.1655826016482; Tue, 21 Jun 2022 08:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655826016; cv=none; d=google.com; s=arc-20160816; b=ILyY3Nw7NL4mf8rjk4zejyODiz0j7kRxQkii/mlMgWGAF5FJJe80QgSAvfyc/Wg21H YZ18fWSKwYqQkmLuKfpw2PQ8Oui1cMdoWsn6LU62IyeuLNfQOA6UsoDDzVqKXne5dZjj riaIcHabV3BI+e/jcpL4sOSAOIrUUht5/NoDLlqErfXkuEQhI8jQmDVSzNjEqk7lDT7L NbUS8xofjx6HsdWO+vV+N+EjEH0QffqiSbEqfCOLah0CM0qsAyCh6mSJPMwzefMHdEdd S7NNvH4ACKCZs54Jy3IA2qhmdquWmN3H4dQeelsrj2gAuwSXm7u1Qw5QcDyKowh9Hw6+ A8iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=B6+bNqU3sHzfodwP6oA8E2LnKQKP5uxdLbY+GSrKqT4=; b=HpwvhqbnsnfsB/RJGTJOLT00dwOJwk/eFNVvg4BZZQcdCHO/Pwtr+5lHvCaXGeVud6 5xeqXxWhzrRO8Z6Mvv40BoGnogVuELcMjRwxiI9CRrwiXwXJ2exRujDs+mvvuthSw0uc hTyjbkoENuol+qrwWZpMb4nbs+27hAWuy1jzWAyG3wbwei8l44+Yh353Uqpn0RMl5u2b lS7gj2QFY7JFW4ognwuY6RHacW83n5Fb7d926zGe68U54NeBe2NEDrzzKhfIkhOXXfwn AFu599seOnZLyQTrYmPvSOzO6NMLJ0U8CTe5kvpn2hQc89F7y0Yky9oNbFn0uz3MKglO tEiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P10HG9L0; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm10-20020a170907948a00b007111f8df172si4937708ejc.271.2022.06.21.08.39.50; Tue, 21 Jun 2022 08:40:16 -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=@kernel.org header.s=k20201202 header.b=P10HG9L0; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352118AbiFUPgl (ORCPT + 99 others); Tue, 21 Jun 2022 11:36:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351828AbiFUPgh (ORCPT ); Tue, 21 Jun 2022 11:36:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E4382A734; Tue, 21 Jun 2022 08:36:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 13887B81A66; Tue, 21 Jun 2022 15:36:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9598DC341C4; Tue, 21 Jun 2022 15:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655825793; bh=X2IZFlLDvw59kZUFryr/lUy43KEq5hsgawhWP8FvINg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P10HG9L0/T9LAo78BphskNiMkrHuo7iI3bghciUrQDK2jBnrEOi0vXewvdLMP1btx zdtcaFj6fJneAj/AFMiRMPxgfhxmAnrwU5B3bimRn7yiL5gkF/QJ/kcunqdXK12r+v 7E+J84bxEQ8zQu6EDezLX+DPaIQB8D6d2TZOVxa064TsP9U5oU55HSZPg+Nt+dwtxk CkbUM4kb6NjIrWc4uvWYCs0hwhe4kndy5Qo9AjWTSJS2badLP5EMEO03d4uB6tmVNP Vy2x4nWFuZjw3TPYKtmwRn08QgVHiOerSfdi8OhF36sP6rYjAZRuzHYJG5XAnGL8tQ pMFUBLGytssDA== From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , Matthew Garrett , Peter Jones , Tony Luck , Kees Cook , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen Subject: [PATCH v2 1/9] pstore: Don't expose ECC metadata via pstore file system Date: Tue, 21 Jun 2022 17:36:15 +0200 Message-Id: <20220621153623.3786960-2-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220621153623.3786960-1-ardb@kernel.org> References: <20220621153623.3786960-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1010; h=from:subject; bh=X2IZFlLDvw59kZUFryr/lUy43KEq5hsgawhWP8FvINg=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBiseVoBHC+OBzHPWUPR/ztj2U0FqsWxo3CWG0Z00Wi QVp3Kn+JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYrHlaAAKCRDDTyI5ktmPJK3oDA CDuLO9c6Smjkix3WjVMSmmYIjOgvpmK+lYDBeKeLXn+CLjHcPx+KdHrzDrjgVqNqGoSIJw+VB98Rtl lS15bi7pWLCYei2wuSA3wklxaCKr2JDGJSY1Fa2GzYhVowkmcQ1FU453NOB3zOlPKFHBFJZECmY/kj LiiG/Mjh4xY5hm/m161294bUBm8P9YbdbqtnJ1LOrCnj2B8RgERfwjcFCYjdSy8fNpQEPVbZNEk//l NlifN9NyurezGYkmxGz5qEXZugynBgPvEBkynfYyTKUbJE0YeKSbn6B9nvfvv+kNb1mAy4UzKoJnCq Vnt3pZS559ftd0X9ycQYRNYFve+mSGb0TvlNmkoLmQtaa698p4S0gH8DlS/mmJgrG8H7hjrFG3wGji kzatr2Q+gTHdpL63E/4mlrVOiodklPJpjvLcyVOEJTRwdVsAG9uvh8eUxXZum5lnrcxV2e8fez9V7N EyoiJmVsB3XlBL4kN97sWGnVnUvF9fkBa3SCCMfIAUzVQ= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 If a pstore record has its ecc_notice_size field set to >0, it means the record's buffer has that many additional bytes appended to the end that carry backend specific metadata, typically used for error correction. Given that this is backend specific, and that user space cannot really make sense of this metadata anyway, let's not expose it via the pstore filesystem. Signed-off-by: Ard Biesheuvel --- fs/pstore/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 14658b009f1b..b62eead3f801 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -349,7 +349,7 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record) int rc = 0; char name[PSTORE_NAMELEN]; struct pstore_private *private, *pos; - size_t size = record->size + record->ecc_notice_size; + size_t size = record->size; if (WARN_ON(!inode_is_locked(d_inode(root)))) return -EINVAL; -- 2.35.1