Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3380111rwb; Fri, 9 Dec 2022 13:47:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf4RbsRTl1mOu3QScqhaSLsx+IskqJ0lBgz67D7w9Dr+6ZyN4MhilBqbrGLooAwzZW1Kl65e X-Received: by 2002:a17:906:c51:b0:7b2:91e8:1553 with SMTP id t17-20020a1709060c5100b007b291e81553mr6742344ejf.20.1670622428473; Fri, 09 Dec 2022 13:47:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670622428; cv=none; d=google.com; s=arc-20160816; b=GZkHEF5kgg1u3rlt0D2w4bLSVhsAXLUKUu7QkHE4nl16rZJVqzwlkMZTAqlbPaEUSc KYiBvQgGiiISMr1rpN7X1RHicn0q3PDlhPMIJ8vhV7mUMrE044y0VLmMm4bdQImLzFqu loz8yzoqIy12KHZIXeQC3c7P8oG2DSA58iQsoPzmqhhkuw42wCIO5wH4tkt+elh8x1cp DB9El1uw7+K9V1U9MeDWIHdpmLo7jx/cEE073VMPe2r7bSBw9dZFhJ3dsP+Z36G6BOwC TSmBCy3FgwVgL7lcfjmMca4643G3sj9u6wcC8JI0kG59SsTimeNVEPs5EP9oFcSBE3qP fzGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=m7BYSJsyYbjfUSGto8PSIeWcxdhQleYdsTdMfBA5rws=; b=dWt8IytXjiL4gJbeumyg1bA63KdmKbDckSu5TTedFlGNJ5qC8MsWdEkZtxoeO/5w/E nffboUjS5FOMLkZYtW1VSnfQvSssNDWN9UmLNdv5kbOFrxuty6p26Wbih6QBknla8g6Y M0mIUxsw8F+8SYBYMSuZuL1hP3eeO/fUa0ZehjGNOXXeQlAYXwscrnu0Do1d8jfy6/pH CLKayQi2Loc3umyWHxnMpeoD/7VThdpkQ6ZZwrXpVEbAhWKumLAsyJXcPwSo1Gs7Bil7 rJtpBAzPv+hFlQ+e9ZbuNU3hewH+iZmpWwdgSnjZjCZ0pNGg0UNQtG4VxOCZEHSFNzJ3 NeNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=poYdTDQK; 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 ds9-20020a170907724900b0072ef52514f6si789645ejc.629.2022.12.09.13.46.50; Fri, 09 Dec 2022 13:47:08 -0800 (PST) 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=20210112 header.b=poYdTDQK; 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 S229863AbiLIVUR (ORCPT + 74 others); Fri, 9 Dec 2022 16:20:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbiLIVUJ (ORCPT ); Fri, 9 Dec 2022 16:20:09 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57EDAB4E15 for ; Fri, 9 Dec 2022 13:20:08 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id 65so4575735pfx.9 for ; Fri, 09 Dec 2022 13:20:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=m7BYSJsyYbjfUSGto8PSIeWcxdhQleYdsTdMfBA5rws=; b=poYdTDQKQ+ROqrDeu33rphBnUYHE36o3J4O2/FZpPVcfSspcGclae9TpsGfhyYWhjQ 4YwNOph218hSnfjvOl1wL5TBw0fJzOOEBW+Src+idIoyG+T9csEXq/70CKPw3wErkO5r z6zACaCkskUz6r7Sni9s0/wpC3nxmsnQd2ktAukR6cx+iRj1bo4gD0A3oPkJR+H+py6K y/bOvkOKQDu7lG7Byw5tYUTKflkKOWvvfqA1FhUsJ/MPewau+YMZk1XLXRYX/xRpeQ+g oAp1V9eLurl6VehkrIxrxfYkSvBfRjblCtSI7ndTZxswL7UI4IyEAEve3FljlLh/isCt DS8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m7BYSJsyYbjfUSGto8PSIeWcxdhQleYdsTdMfBA5rws=; b=6MlQsP/c0dsGfeuiPUGP5dYRKP1RPBC6oAOKIc+h/9Iacnk7zkuqdw2SE8xB3TJ4ZI JmFJaIva6ncbaKUbclg0shTVmel9+lOKnokun0dD9mN8rnxWWvSWvFGgadQf1S0DQV3y lQrOX7agCx8bADmTgc9onCSHAjPx4OaNLmJwS3ojNBIeDbAwTac9mCs4+7qbhrl146Px RwOnOrnr/PNFMyYVfpH0i6G4F6lmTM9E/2UXVik6tgTg1pt4f/EDFpbKVCP3Zt+R+K3W s5FHCUa+ojGqRZvhfQVlb4zp5KfezC+7PGPnyTWwcH6V4pbg4LrAZKChhTQMrv2CSkMu g+2w== X-Gm-Message-State: ANoB5pnjnR3KEO4vBZPbBbsNr0iqQoaNGe13lmXVjyFb/R3AXL9Z6/PU kFduF9CweGj9KkG7cTqi2/BgPcL45XCg3zBRtvw= X-Received: by 2002:a63:e444:0:b0:477:6a3a:e614 with SMTP id i4-20020a63e444000000b004776a3ae614mr69123199pgk.81.1670620807481; Fri, 09 Dec 2022 13:20:07 -0800 (PST) MIME-Version: 1.0 References: <202208091600.D19DFF9C7D@keescook> <202212071412.1B1BF97@keescook> In-Reply-To: <202212071412.1B1BF97@keescook> From: Kamal Dasu Date: Fri, 9 Dec 2022 16:19:56 -0500 Message-ID: Subject: Re: Invalid pstore_blk use? To: Kees Cook Cc: Florian Fainelli , WeiXiong Liao , Linux Kernel , Anton Vorontsov , Colin Cross , Tony Luck Content-Type: text/plain; charset="UTF-8" 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 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 Kees, Thanks for your reply. I will send the RFC patch. Kamal On Wed, Dec 7, 2022 at 5:13 PM Kees Cook wrote: > > On Fri, Nov 18, 2022 at 03:41:44PM -0500, Kamal Dasu wrote: > > Kees, > > > > I am in the process of implementing mmcpstore backend for mmc based > > on the mtdpstore driver > > > > This is what is registered with register_pstore_device(&cxt->dev); > > cxt->dev.flags = PSTORE_FLAGS_DMESG; > > cxt->dev.zone.read = mmcpstore_read; > > cxt->dev.zone.write = mmcpstore_write; > > cxt->dev.zone.erase = mmcpstore_erase; > > cxt->dev.zone.panic_write = mmcpstore_panic_write; > > > > # dmesg | grep pstor > > [ 0.000000] Kernel command line: pstore_blk.blkdev=/dev/mmcblk1p8 > > crash_kexec_post_notifiers printk.always_kmsg_dump > > [ 1.993986] pstore_zone: registered pstore_blk as backend for > > kmsg(Oops,panic_write) pmsg > > [ 2.002582] pstore: Using crash dump compression: deflate > > [ 2.008133] pstore: Registered pstore_blk as persistent store backend > > [ 2.020907] mmcpstore: /dev/mmcblk1p8 size 131072 start sector > > 34468 registered as psblk backend > > [ 17.868753] psz_kmsg_recover_meta: pstore_zone: no valid data in > > kmsg dump zone 0 > > [ 18.298933] psz_recover_zone: pstore_zone: no valid data in zone pmsg > > [ 18.305398] psz_recovery: pstore_zone: recover end! > > > > The driver is successfully registered and the read path works when > > /sys/fs/pstor is mounted , however mmc_pstore_panic_write is not > > called. > > Need help in understanding what could be missing. I am using the > > latest upstream kernel for testing. > > Hi! > > Can you send an RFC patch? I'd expect this to work as you've currently > described it, but without code I'd just be guessing. :) > > -Kees > > -- > Kees Cook