Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18244951rwd; Tue, 27 Jun 2023 14:02:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5SmMec1rKmTBqWLr/ISGpY8Q6+72Q0bnBmmeHcHb/sPT2QTbCL3XM5KFKffC2UmZB+pUkS X-Received: by 2002:a92:506:0:b0:345:bfd0:66ac with SMTP id q6-20020a920506000000b00345bfd066acmr2175652ile.8.1687899752878; Tue, 27 Jun 2023 14:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687899752; cv=none; d=google.com; s=arc-20160816; b=XO8pzWzaQCLEkj9wKjjVylFmycuaYtZFSO8eQH3cw6UAWI+ZmZP3cVZ7izatRNaBiC oqyf4FlXllUbGOdu/839hzA5WqaHDL959HwGLP0EHzLWx2MvW49YAmIxDGYPqXmhLnFD EkupWpr2f8VKuURNXK2kmSXaHHqm/0qO0tm7pLzLtDvGqIz/V/DFsYFA74wzeHv8eJ4O P2v91n+pnNT3g7aXSh6sMtbRkrYBwbZZsbf5D+r4OXqsjVLN15jlD0fqGujqYfBZqZSG fZtiKX5/nesGUaaGfXn5MtHy9OWfF8RsJwDR2huJNMQB2MnsYQd9PY7gcDSNjlRWVWwS wmZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=1vPucO0ah2tzqliaea+4BxYPUmdSJl3E6NC0kkOLyyk=; fh=BValqFREB6/qctsySTuTsIiv6G6DuX2UZcT6pxvhxhk=; b=ua+Sof7lAU0minPFwgDLvJxW0v6K7trCkyQ29zD93K7S4MGtzkAqfzkFuSBByJIny3 4KhJso6wMNV5KAUEXnt/i+BEUP3hWaaRJ0dqCy7WSE8zD2BQnvQevMf70epKuD16ZlsQ sQ/sXoriRvjK6sGdzmyk7U2rvnPwbkr3hHHHaBEZuA8P5f1KKgb0pX6Bob1E/3UT8VoQ HCurnLJMjBus2RO3fn2AR32C5YhfVpYhmciZ7mYKY0KUmzwZASPy0eJZfqIC1qbQI3o9 5BZ85802Btkw3Uq1FPeHvgFcLgFjd1n3qp4LflPLtilxJAqpoSmNtcnakgJr8icctxAj rKJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=GcPz2Mcz; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j19-20020a63cf13000000b005533980c059si7761540pgg.494.2023.06.27.14.02.20; Tue, 27 Jun 2023 14:02:32 -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=@gmail.com header.s=20221208 header.b=GcPz2Mcz; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230315AbjF0U20 (ORCPT + 99 others); Tue, 27 Jun 2023 16:28:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbjF0U2Y (ORCPT ); Tue, 27 Jun 2023 16:28:24 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96A6D1BD1; Tue, 27 Jun 2023 13:28:23 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1b7ffab9454so16619235ad.3; Tue, 27 Jun 2023 13:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687897703; x=1690489703; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1vPucO0ah2tzqliaea+4BxYPUmdSJl3E6NC0kkOLyyk=; b=GcPz2MczXgU6SpJzyuUl5ZD4eFfWwa6lXpX3o8lJFATWNOCXX6DanvxQuaugiOtK2e 7V/sQ2zJd4ziSFffOMg4pakURS6v8zqidYS048F6K8nwifBE0+qmkl2a5P0AAV2pUo13 QQ+bejyQT+XW3VHHULhOtYoDbHAPlman2IckwsYp8YN2V+RedkMOTMi+SLRC+/wfJfvg hLedKXJ8X2wJ8G/aFduDmroJmXuHEjMuwXHniE7IDuYLVdO0fb/zlUtj+AaMBY48FllB 4vZ2Y6Q+NfmkDj7flIxL9a2lC8lEjs3yAc5v07Wt9NAlZ/RWfSPLEL3CYhX8w5TtbKtA /fKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687897703; x=1690489703; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1vPucO0ah2tzqliaea+4BxYPUmdSJl3E6NC0kkOLyyk=; b=jb8zfblovPtxrW9SpvBllChF92dWwrP4eEXxSOLREe/iy2pgWQLEj/JgiANe0Osb1Q Wbr8uJMcGYQIuya01e5WN0kMfF8ZvRuyF1CjQJVHYKUVz0XoPQwzGt8MZc2esOyWUttg Q2PLYWmEtIqixU4njrFyslcNHPWpM69eexR3fAnzYBJEbJpg+TOX5JvNfVrqWuRj4ohv ETOP9WUAY4BT7WKDDgGSG/2aIKZ4Ku5t3Chrbo+wzo319OHjRPjPtIxurZfXK1r5aBEp 6QJP/MeoEDAiktw2JXsjQawR9rp/Rx7XNxlR+hpMjRmjExOt2pQPO5muzjEdgPCNQ2qT OQOg== X-Gm-Message-State: AC+VfDwpWssMKDfugdot0Avo0mdhGnFn+9q6brYktKCkXEbyucqIgj0g oqvA1Kv9SkZ2FTgL3Qx8Vnw= X-Received: by 2002:a17:902:6ac3:b0:1b8:d90:d20f with SMTP id i3-20020a1709026ac300b001b80d90d20fmr4043915plt.3.1687897702939; Tue, 27 Jun 2023 13:28:22 -0700 (PDT) Received: from smtpclient.apple ([2620:15c:2c0:5:9d65:e705:252e:8337]) by smtp.gmail.com with ESMTPSA id t10-20020a170902a5ca00b001b53c8659fesm6338819plq.30.2023.06.27.13.28.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Jun 2023 13:28:22 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: support pmsg record size larger than kmalloc limitation From: Yuxiao Zhang In-Reply-To: <2023062702-frosty-winking-9257@gregkh> Date: Tue, 27 Jun 2023 13:28:11 -0700 Cc: Yuxiao Zhang , keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, linux-hardening@vger.kernel.org, William Kennington , linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <2023062715-eldercare-washed-3c29@gregkh> <2023062702-frosty-winking-9257@gregkh> To: Greg KH X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Thanks for the pointer, the document is very helpful. Seems that I = cannot use gmail to send patches. I sent it again by git send-email. I = also tested myself that the patch is well-formatted. Hopefully this time = it works. > On Jun 27, 2023, at 10:35 AM, Greg KH = wrote: >=20 > On Tue, Jun 27, 2023 at 10:05:04AM -0700, Yuxiao Zhang wrote: >> kfree(record->priv); >> kfree(record); >> if (rc !=3D -EEXIST || !quiet) >> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c >> index ade66dbe5f39..296465b14fa9 100644 >> --- a/fs/pstore/ram.c >> +++ b/fs/pstore/ram.c >> @@ -20,6 +20,7 @@ >> #include >> #include >> #include >> +#include >>=20 >> #include "internal.h" >> #include "ram_internal.h" >> @@ -268,7 +269,7 @@ static ssize_t ramoops_pstore_read(struct >> pstore_record *record) >> /* ECC correction notice */ >> record->ecc_notice_size =3D persistent_ram_ecc_string(prz, NULL, 0); >>=20 >> - record->buf =3D kmalloc(size + record->ecc_notice_size + 1, = GFP_KERNEL); >> + record->buf =3D kvmalloc(size + record->ecc_notice_size + 1, = GFP_KERNEL); >> if (record->buf =3D=3D NULL) { >> size =3D -ENOMEM; >> goto out; >=20 > Please try emailing a patch to yourself and see if you can apply it > afterwards. The kernel documentation has a section for how to handle > email clients, perhaps you should read it? >=20 > thanks, >=20 > greg k-h