Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp245407pxu; Wed, 2 Dec 2020 21:44:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxI8OKL6nhb8d5dwlo6fr2RWbIZobotHPUuPMxZjAU8uMDqzI8HBPNjEACQRr8IyvQXPSue X-Received: by 2002:a17:906:3704:: with SMTP id d4mr1103122ejc.338.1606974297310; Wed, 02 Dec 2020 21:44:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1606974297; cv=pass; d=google.com; s=arc-20160816; b=p0ziRCgiiI3/o/ItY+M9F0zOw8C5cpi0BLIw2MAUzuzrEp2sgdA4w1v+wymu+xcCdJ hozgRN59gN8Ofl0A1n/XV2wYtwCt/7J+dpODrxJNs+2v743T4NenjLNEiN/zt4pcmJON lCHrNdgOxj/5tWJ8SqliffKqGxxKPt5EfKruphDEAg/mDkSzztI0giF77ldK484uFOFP lVGdop2iL6kLfMPynNcLa6J/9KwWUokHfcSWI2E5w5r91nUD6dwAxgvUTL1U5OK8LT7w LKgiiKxAe7ZdxfF9nGpyTOas6xQwBQd84JnE7b4beqnbfLWcai5HaF652ITZgzgPj1ex ouFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-signature; bh=VUrEd4DbSMO9MaRxJg6MX/xCHYKneFGvnXfs7BEhmek=; b=ZJuH6eGeg1TQxEj9BMQl6xvuNwtluzXeIjJHonHuCD4iglMjDK9Qxp5X3EluscYAEv tE4DtPmpW91uEp/UzBnn7mBovTnk/lTPAZUd+egppXZalK+UQ6pU8ZRNEV1yL8zdWWcz eBrRhbKWgOH9HFVk4Uea3dpekng+MKhuFnnLLgo34t7utnW/Zxzs36IeQfXqAWbVqCAg BfPX48hPPXHuiGKe788fw0H3akYMUMOVLQeIbikpNdfpQuSD/xJzgvG4PElvCNxBA5gJ DwRen1gi2/tVk8aZmhmkPaYNW/blcW7EToFaIAcBV2pjGA+5VoaK7NkoVqiW/E2A7waX m2NA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=YAUtkSfL; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector1-marvell-onmicrosoft-com header.b=OPtOKKWa; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y25si478872ejd.556.2020.12.02.21.44.33; Wed, 02 Dec 2020 21:44:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=YAUtkSfL; dkim=pass header.i=@marvell.onmicrosoft.com header.s=selector1-marvell-onmicrosoft-com header.b=OPtOKKWa; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728220AbgLCFl6 (ORCPT + 99 others); Thu, 3 Dec 2020 00:41:58 -0500 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:64764 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725979AbgLCFl5 (ORCPT ); Thu, 3 Dec 2020 00:41:57 -0500 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0B35fC0a016546; Wed, 2 Dec 2020 21:41:12 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0220; bh=VUrEd4DbSMO9MaRxJg6MX/xCHYKneFGvnXfs7BEhmek=; b=YAUtkSfLqXT6+EtrIJ0Esfe1h3RZkI6+V5J/02mybg6fl+JTXPB58K2d2RRrIDCLP5lQ 8TIcvmI1YnKlkJjRTtY8erLcy2RLv53BU1jRfPFK7bhbrWwMMbu4dT9f0SwkCMgouTNG A3iHCXkGf8v8ShDzhPPxDW5xBnTSa1X9R5xpXS567nJhb5SErJdfb78T/zNt6oxn7KK6 tOSqExIMBdqAK3/4W+9zMKqu4E03GJ/yi0TDDFrxUP+Ot/2RYcBeMzhwdTLS+/UvF4+i DBqNhXA7DbAhqCXmKscOU7CqB79Y9GJLLF06Ols7dAzRFUqrSzLcfWHRy/x7ODiLWEFk 1Q== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 355w50crv9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 02 Dec 2020 21:41:12 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Dec 2020 21:41:10 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Dec 2020 21:41:10 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 2 Dec 2020 21:41:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EWBdYUS/igNnVNsWmdS3XNJ8TrFIqEJNJZm1jpMCFGFr/X9MXqO1LWXF3M4iAky7apOqvhPjRgQGwN5j+HhurCFhaKSk3sWcT8x/aw3DDch+M5Uw2lLGY0bVYHowhuQ4QghVITNf//ORyjGfiR3JFCVLJqvCcPOnFaxh3WzDcBZ4ssUFjS7aXrVn4nf7tfqoRifBvWEXJBHeok2KR4kd1mMCzyWksOa3OfnWtKvyIPJg2Wk3F+cPCLkmiyn23PUCXYZJ9rZg/W2uvWPeFTNzUEuWD3LzbP1p2vNYBJysaFT1gwmR5iFuCEESoDyXp6R3P0ZH2DEB29sYGmrFFYyhPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VUrEd4DbSMO9MaRxJg6MX/xCHYKneFGvnXfs7BEhmek=; b=V6vELxmlDndU5H7ednLZFERVLL+IzuIH7eu/olHVq3X5upLLlghwl403ZTy/D1cfYHbeWSFBn40hPUjI4pkdP/8F3ma/SUI+cxEkhUuOKBGdIiSgkW64XKxXl4ty6T6HryB5C2yCXC9ZjbTTSbYaRPwXVeqLa3pJG+Q0ajU37UQUfjT96kLIb61E0f2ptbzoHsefKySIB0P0aUiSEzzsceAC7Yu92SChJyRL2YkXdt4YNuUrEThkSmsNLt4390BduKBU3Wa7VsxRvLJ4Hc+hvO060sucYPzO64OEIBUBUd+Fjfci0ffAgPYEIF+ukqCfwd2ROJsrvQFzELmNdI66Mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VUrEd4DbSMO9MaRxJg6MX/xCHYKneFGvnXfs7BEhmek=; b=OPtOKKWaLWGk7eq9e1iMOjDVgFD/XtwoaFIw1PN31RxuFOB5IWc+qwrll4QuYy0mslSxwM0Uj5jgx34I6NGetfNUYI/IadvM3XiVxUnJVZ9SvolAXx89UoaCPITNryAv8BVi6xcP9HRoQRBrLKP9fxx8oV/yX/29er+6ppD7KIg= Received: from CY4PR1801MB2070.namprd18.prod.outlook.com (2603:10b6:910:7e::28) by CY4PR18MB1190.namprd18.prod.outlook.com (2603:10b6:903:110::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20; Thu, 3 Dec 2020 05:41:08 +0000 Received: from CY4PR1801MB2070.namprd18.prod.outlook.com ([fe80::c9c8:b925:516f:9090]) by CY4PR1801MB2070.namprd18.prod.outlook.com ([fe80::c9c8:b925:516f:9090%7]) with mapi id 15.20.3611.031; Thu, 3 Dec 2020 05:41:08 +0000 From: Bhaskara Budiredla To: Kees Cook CC: "ulf.hansson@linaro.org" , "ccross@android.com" , "tony.luck@intel.com" , "Sunil Kovvuri Goutham" , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "outgoing2/0000-cover-letter.patch@mx0b-0016f401.pphosted.com" Subject: RE: [EXT] Re: [PATCH v2 1/2] mmc: Support kmsg dumper based on pstore/blk Thread-Topic: [EXT] Re: [PATCH v2 1/2] mmc: Support kmsg dumper based on pstore/blk Thread-Index: AQHWwYqKGp95SRIfpkeLwxPInxlbBqnivWIAgACfeiCAAOO4AIAAn9QA Date: Thu, 3 Dec 2020 05:41:08 +0000 Message-ID: References: <20201123111925.28999-1-bbudiredla@marvell.com> <202012011218.3B6566C5@keescook> <202012021126.20ACBBD@keescook> In-Reply-To: <202012021126.20ACBBD@keescook> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=none action=none header.from=marvell.com; x-originating-ip: [27.59.143.196] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d7b7400f-0ed7-40a8-62a4-08d8974e08bd x-ms-traffictypediagnostic: CY4PR18MB1190: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2276; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7WnE4vMU73fF2edpY8Q5P75eA7XXv9BrBaqg90upE+dkyyyZZqRGh/TwlGUL5vfYwDRufq4wp0fd7o6JpE5HoLatb4nUCBlLjEqIuKo/lZU9cJxhZ7A/w0FgJW48B0d5UzymGbJbmnUKMy9fyYKAVVjG3+ji0WipXXlCADsCIlVJOEU68qZTsEC1K9WsTkiet+yy5vKZdz9OjZtuQh6tfql06+qbz0yYZaezfbP7kCBJ/8PTx6lBfZp2Nk5apf5La/3Qo+VceM1PsOYApIyn/3slg05VOObWY5Q+oprnJ90h3NAe4c6L5f6z3WUXXXqqEfsSEhYOWzf7QyOeh6Mxxg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1801MB2070.namprd18.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(376002)(346002)(366004)(136003)(39860400002)(52536014)(8676002)(316002)(26005)(478600001)(33656002)(76116006)(7696005)(6506007)(83380400001)(66946007)(86362001)(71200400001)(66476007)(54906003)(64756008)(66446008)(9686003)(8936002)(6916009)(2906002)(4326008)(186003)(55016002)(66556008)(5660300002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?kWBnS5HIAx0tEYjMG7TG1YKCTU95ZksfhXlQ56opYCVgzDmujapd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uflGY/Lxmrx+sb3TchFIOj5RAei1Gy62Kh2l?= =?us-ascii?Q?S6Cz+9K2ay5L1h5tBOYIsNNtPnlYkkauJCaRaqtKahE=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR1801MB2070.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7b7400f-0ed7-40a8-62a4-08d8974e08bd X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2020 05:41:08.1138 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oezJLdecWlwE14IITIznC3hKKGA8EY+L3In5v1Oe59K+ErR4Wws+bNbkfm6EKheIdDYwtWNDlwP6w41B4LpWlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR18MB1190 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-12-03_01:2020-11-30,2020-12-03 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >-----Original Message----- >From: Kees Cook >Sent: Thursday, December 3, 2020 1:02 AM >To: Bhaskara Budiredla >Cc: ulf.hansson@linaro.org; ccross@android.com; tony.luck@intel.com; Sunil >Kovvuri Goutham ; linux-mmc@vger.kernel.org; >linux-kernel@vger.kernel.org; outgoing2/0000-cover-letter.patch@mx0b- >0016f401.pphosted.com >Subject: Re: [EXT] Re: [PATCH v2 1/2] mmc: Support kmsg dumper based on >pstore/blk > >On Wed, Dec 02, 2020 at 06:36:21AM +0000, Bhaskara Budiredla wrote: >> >From: Kees Cook On Mon, Nov 23, 2020 at >> >04:49:24PM +0530, Bhaskara Budiredla wrote: >> >Why isn't this just written as: >> > >> >config MMC_PSTORE >> > bool "Log panic/oops to a MMC buffer" >> > depends on MMC_BLOCK >> > select PSTORE_BLK >> > help >> > This option will let you create platform backend to store kmsg >> > crash dumps to a user specified MMC device. This is primarily >> > based on pstore/blk. >> > >> >> The idea was to compile MMC_PSTORE as part of MMC_BLOCK driver, >> provided it is optionally enabled. >> The above arrangement compiles MMC_PSTORE as module: if >> (CONFIG_MMC_PSTORE_BACKEND =3D=3D y && CONFIG_MMC_BLOCK =3D=3D m) >> as static: if (CONFIG_MMC_PSTORE_BACKEND =3D=3D y && >CONFIG_MMC_BLOCK =3D=3D y) > >Ah, okay. If it's a tri-state, wouldn't it track CONFIG_MMC_BLOCK's state?= As >in, does this work: > Yes, it's a tri-state but not compiled as a separate driver.=20 >config MMC_PSTORE > tristate "Log panic/oops to a MMC buffer" > depends on MMC_BLOCK > select PSTORE_BLK > help > This option will let you create platform backend to store kmsg > crash dumps to a user specified MMC device. This is primarily > based on pstore/blk. > No, this will cause problems for MMC_PSTORE=3Dm and MMC_BLOCK=3Dy MMC_PSTORE automatically have to be selected as module or static based on MMC_BLOCK selection. There were couple of function calls from the code in MMC_BLOCK to MMC_PSTORE. Uffe prefers them to be unconditional calls (as per discussion in v1). =20 >> >> + if (strncmp(cxt->dev_name, disk_name, strlen(disk_name))) >> >> + return; >> > >> >Why isn't this just strcmp()? >> >> The mmc disk name (disk_name) doesn't include the partition number. >> strncmp is restricted to something like /dev/mmcblk0, it doesn't cover f= ull >/dev/mmcblk0pn. >> The partition number check is carried out in the next statement. > >Okay, gotcha; thanks! > >> >> + dev->flags =3D PSTORE_FLAGS_DMESG; >> > >> >Can't this support more than just DMESG? I don't see anything specific = to >that. >> >This is using pstore/zone ultimately, which can support whatever >> >frontends it needs to. >> >> Yes, as of now the support is only for DMESG. We will extend this to >> other frontends on need basis. > >Okay -- I assume this has mostly to do with not having erasure (below). > >> >> + dev->erase =3D NULL; >> > >> >No way to remove the records? >> >> Yes, at this time, no removal of records. > >Okay. (I think this might be worth mentioning in docs somewhere.) > Would it be sufficient to add corresponding notes to the commit message?=20 >-- >Kees Cook