Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1423271ybg; Wed, 29 Jul 2020 13:57:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFylgEK8bJcxg5jujBGYzf9zWRPt286xrYPPxwnCXHEQeDHVKkxWLp2b/BxZljR1/NJFSA X-Received: by 2002:a50:e1c5:: with SMTP id m5mr200190edl.138.1596056245948; Wed, 29 Jul 2020 13:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596056245; cv=none; d=google.com; s=arc-20160816; b=Q8fRLFFPerEtTwoqYr2QSiR5BvHKegY0HfyMwaL4OEXTNnsVNYB3z8iz/tIrzifj6c D4+ooUmwY+Co4qFd9I1BY3yX++jMtZkzay7sN5fhYPjrdP6qza1vPucASR5PM+kzrwMD vbAH8NZz6DFT4dATdNpkehgDUyZbn5n+SzSlqvyQa/Gkzhz9ItpWcD6OewFkPZ4PAX5g wn59Tgp5ESCKekUhWfSaWrxgWVlT8ZLzkCz+cOM5w6Pvh5AI5zeExjQTDwwunzfnF3e+ H7nhAW89XC7+w3UP9THYwEoLIeUMrifsKBh7XnSflGcp6xA5Qcv1AgWMeHRkiwfndqqm NOqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hML/G2Vc4+8j8itR9nKQsmnhixEhsDERowGsOaYy7Gw=; b=wAAcg43EggfmXMt4eHa8lGVRhbNe2GBC7dXvbBwLBTNBYeEKjEUmQGP39zINnlhe5r RnPC56uiumUUivzWDkROODiSZ6L4Q5LEx2GXqE2gysGQz9NDC3mjLbrz0yH80apJtd8J 8FXH11EAeZvZHoicw/TTe7oygFvSQ+2vfgkWvWsRaFjnH/WydS4j2oR3SZVtm82E9cdE /MZrUY+mjzSMpoy/gl+EFxRUgO7fCPSHFRb/z2Jf7XHWhgAmZ2X9ITHVfDn4ivwDst1s zQzi0vaJt1Yw4lCQvG/zwM0CPWxsQc7rnkwQdeYW/xbmztQfABAV8SpgKXJf5bktYM6C 0Slg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@eclypsium.com header.s=google header.b=Zvip8zar; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=eclypsium.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si1767088edt.4.2020.07.29.13.57.03; Wed, 29 Jul 2020 13:57:25 -0700 (PDT) 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=@eclypsium.com header.s=google header.b=Zvip8zar; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=eclypsium.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726814AbgG2Uys (ORCPT + 99 others); Wed, 29 Jul 2020 16:54:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbgG2Uyr (ORCPT ); Wed, 29 Jul 2020 16:54:47 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75BF2C061794 for ; Wed, 29 Jul 2020 13:54:47 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id x69so23688261qkb.1 for ; Wed, 29 Jul 2020 13:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclypsium.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hML/G2Vc4+8j8itR9nKQsmnhixEhsDERowGsOaYy7Gw=; b=Zvip8zarCHkiOAp40mMHVMaLvnPMf3ZQI2kSo9fjzG0D6nM7fysyjZo3oR16GmU5un RZJgAoIIftLEUrNHVTF5d0lcuWp9PmRHSF3BhGGu49F/B7bFuFDHer7uqebnWZZFa3Fx ImE6syx7IxfsoVqZFf3KE2Y2ZOVMFUPq/qg/Qr9gfRk4irvzzWLIKi2tVewrQsPEdZRU b7JOXqr/VFRFAD8UjkJ6aUCSZWimOZhK9HJsrNnkF9fgcDXyegTccsVKvnXdv9NOYyfQ ivnNne6r436/TAQ9T6N0GFYlXffps/RnZu6Py4vMLefN7S89NM15w3rCHeUH2y6nq22u n+Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=hML/G2Vc4+8j8itR9nKQsmnhixEhsDERowGsOaYy7Gw=; b=KdGAjjkfC9kXYBSrTGHnkXRJ7/Bn/ASRkBXM++O3HjEwPOjfjleUBb2qCdUjljHvIX 4OXmt1COvJld81d3lCvqu44nJIZCS36Uns2UwwY+ZpMShpcLCi7BuUGxJzdR9r7Uf58l 9NH0WsRHPsB0bFAvr7saGodmIKOCAo/OecKnbqZ0G/eVut+Bhv6XoHSMSdOfDmXqMxaj O6UJ/4KlVp8W1Jb5rCHfgApDQA6dPd/6auxAVQLaJtoYPCnLyH+734EsKUru13bfLKdU 9ESz7CXMD1wQcSE13L7ozvEt7FVTHgNgDJdEOWzH7TKfT54bkMAnxcB/99sk7aodLcYr eFig== X-Gm-Message-State: AOAM530nOIY2mvxkRWRmqiBssyo9WMIeW4+MkCxJPZHTpW5ShdxEAuOE 078LysoyROwbg3QKCkzwhc/pywtNKCXRHNqa7KWHliM3 X-Received: by 2002:ae9:eb81:: with SMTP id b123mr35072208qkg.288.1596056086506; Wed, 29 Jul 2020 13:54:46 -0700 (PDT) MIME-Version: 1.0 References: <20200724212853.11601-1-daniel.gutson@eclypsium.com> <20200725055649.GA1047853@kroah.com> <20200726071723.GB441916@kroah.com> In-Reply-To: From: Daniel Gutson Date: Wed, 29 Jul 2020 17:54:35 -0300 Message-ID: Subject: Re: [PATCH] Module argument to control whether intel-spi-pci attempts to turn the SPI flash chip writeable To: Arnd Bergmann Cc: Greg Kroah-Hartman , Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mika Westerberg , Boris Brezillon , linux-mtd , "linux-kernel@vger.kernel.org" , Alex Bazhaniuk , Richard Hughes Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 27, 2020 at 12:31 PM Daniel Gutson wrote= : > > On Mon, Jul 27, 2020 at 12:15 PM Arnd Bergmann wrote: > > > > On Mon, Jul 27, 2020 at 5:05 PM Daniel Gutson wr= ote: > > > On Sun, Jul 26, 2020 at 4:17 AM Greg Kroah-Hartman wrote: > > >> > > >> On Sat, Jul 25, 2020 at 02:20:03PM -0300, Daniel Gutson wrote: > > >> > El s=C3=A1b., 25 jul. 2020 2:56 a. m., Greg Kroah-Hartman < > > >> > gregkh@linuxfoundation.org> escribi=C3=B3: > > >> > > > >> > > > >> > 1) I just did the same that intel-spi.c does. > > >> > > >> No need to copy bad examples :) > > > > > > > > > Didn't know it was a bad example. What's is the current modern mechan= ism that replaces initialization-time configuration? > > > > I'd say you'd generally want this to be a per-instance setting, which > > could be a sysfs attribute of the physical device, or an ioctl for an > > existing user space abstraction. > > But still, they are not equivalent. The initial configuration remains > constant for the rest of the life of the driver, whereas the > sysfs attribute is set after the initialization and can be re-set over > time. I'm not asking module parameters "to come back" if > they are now considered obsolete, I'm just trying to understand. > > > > > In the changelog, you should also explain what this is used for. Do > > you actually want to write to a device that is marked read-only, or > > are you just trying to make the interface more consistent between the > > two drivers? > > The device can either be locked or unlocked. If it is unlocked, it can > be set writable depending on the module > argument in intel-spi, or straight writable in intel-spi-pci. Which is > dangerous. > I wanted to make, as you say, the interface consistent. > Exposing an interface to the user (via a sysfs attribute) to try to > make the driver writable is definitively a bad idea. > I'd rather do nothing (no module arg) rather than open that > here-be-dragons door. ping. This is a real existing problem that I'm trying to address. There's currently no way to prevent the kernel to try to turn the SPI flash chip writable for the device IDs handled by intel-spi-pci. And allowing userspace to switch it between writable/non-writable is not an option. What other mechanism can I use other than the module parameter, so - not accessible through user space - ideally set once, ideally at initialization time Thanks, Daniel. > > > > > Arnd > > > > -- > Daniel Gutson > Argentina Site Director > Enginieering Director > Eclypsium > > Below The Surface: Get the latest threat research and insights on > firmware and supply chain threats from the research team at Eclypsium. > https://eclypsium.com/research/#threatreport --=20 Daniel Gutson Argentina Site Director Enginieering Director Eclypsium Below The Surface: Get the latest threat research and insights on firmware and supply chain threats from the research team at Eclypsium. https://eclypsium.com/research/#threatreport