Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp59270pxb; Mon, 8 Nov 2021 09:42:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkDSwF0I5v9DN+wUsO20QC/m7iATIne8MwQrzc4FuoqxJGlCgz/iplNgxyJ4INpcSfX/Be X-Received: by 2002:a05:6e02:1c23:: with SMTP id m3mr594668ilh.12.1636393367757; Mon, 08 Nov 2021 09:42:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636393367; cv=none; d=google.com; s=arc-20160816; b=wnOvJGxBXouwSt/J1ruTeVO/rRqvxzZP02icOMMNOiq6hCwxl2RLMe9UsXf8G3b70F pUi6MT3Jj068q6Q4FKIr1HEwjmI7wasygRhicolIXvncsfFmls7JTmbLj9FwAtcRv+1F q0L66V4c+9PIRRA06LE4nkCMpqCqHVHmjKWDVjoRVjw8HbLQxuA7lefysp87onvq8DBH Jdp5tQnUhPP+a5O89xk8bKXd341odQrvRf6FhP6+HMJRuVb1MZ3uLfiVIXh9n7WBmwjw obNYnqUFNfBIbXDCso57nzhdt59BYp3WdPaCt4VlCZHCyxHn4ctfJHX+evCwXp5Z+gHJ JYKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=VdzImpsfe23Fb4V1nNW/QvmmMLEtkLMoeL/e6kYeyek=; b=oVmQc+Up16pFFzQ3z8alK8Otr5uDgdRzth9BrmZOsJMpDSMRUGgTR3kpezzP5o3rV7 Cfzmqh0xHAzoCi/j6Cyq8w1VT8lT5PTL1u1MSc80bijjRobHtfVp8k4y6Qkbp7QDmQPl m+vfvcxGBxWShvw9oHBkCXT5e0o21B+yiPIxoFKmvp1STYnHKXp8qdoebPHdBb9D1G6i 2I1X8Ri0arTKq8qc8Oat3jMEZWKULMVPihup8iRoL2Pjcewrk9FL3OhviJbrgLqIJZdq AMAlNewi3aDZ2972Wbnl+k1RBrT+LDmLfIyheRIt1l4q/NnZko8shUG+dSe8MRpuZA4q jEQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=H7YRReVN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si16651259iow.14.2021.11.08.09.42.35; Mon, 08 Nov 2021 09:42:47 -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=@walle.cc header.s=mail2016061301 header.b=H7YRReVN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241039AbhKHPqD (ORCPT + 99 others); Mon, 8 Nov 2021 10:46:03 -0500 Received: from ssl.serverraum.org ([176.9.125.105]:55883 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236127AbhKHPqB (ORCPT ); Mon, 8 Nov 2021 10:46:01 -0500 Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 349B222205; Mon, 8 Nov 2021 16:43:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1636386195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VdzImpsfe23Fb4V1nNW/QvmmMLEtkLMoeL/e6kYeyek=; b=H7YRReVNPBSpcw1sbgLJ3R36siXN+BrCZTzDEEqc9/XIbpVoMQICQ3zSNZ2cTpL7TNpN38 s7uVV4fd20C83ZVp1HRLPsK0hgt6JT3VK6djZKJCMdDg86jUthThcGKCI6xGEaCb1LEUzp aXJBCFANUqtvmEwq+v/n1Pf543Xl9sM= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 08 Nov 2021 16:43:15 +0100 From: Michael Walle To: shiva.linuxworks@gmail.com Cc: tudor.ambarus@microchip.com, p.yadav@ti.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Shivamurthy Shastri Subject: Re: [PATCH 1/4] mtd: spi-nor: micron-st: add advanced protection and security features In-Reply-To: <20211027103352.8879-2-sshivamurthy@micron.com> References: <20211027103352.8879-1-sshivamurthy@micron.com> <20211027103352.8879-2-sshivamurthy@micron.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <24469d5c42e62959390c3f0aa75fc57a@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Am 2021-10-27 12:33, schrieb shiva.linuxworks@gmail.com: > From: Shivamurthy Shastri > > Micron SPI NOR flashes are enabled with advanced sector protection > features, using volatile lock bits, non-volatile lock bits, global > freeze bits and password. > > Advanced sector protection and security features offers additional > levels of protection against accidentally corrupting code and data > stored, and it also prevents malicious attacks that could intentionally > modify or corrupt the code or data stored. > > Signed-off-by: Shivamurthy Shastri > --- .. > +static const struct spi_nor_sec_ops authenta_ops = { > + .secure_read = authenta_secure_read, > + .secure_write = authenta_secure_write, > + .read_vlock_bits = authenta_read_vlock_bits, > + .write_vlock_bits = authenta_write_vlock_bits, > + .read_nvlock_bits = authenta_read_nvlock_bits, > + .write_nvlock_bits = authenta_write_nvlock_bits, > + .erase_nvlock_bits = authenta_erase_nvlock_bits, > + .read_global_freeze_bits = authenta_read_global_freeze_bits, > + .write_global_freeze_bits = authenta_write_global_freeze_bits, > + .read_password = authenta_read_password, Could you please explain what secure read and write and all the other ops actually are? Why is there no write password? They all seem to be used together with advanced sector protection. But you're just exporting all these ops to userspace. We already have lock and unlock ioctls in place. I'd expect that this sector protection will make use of these. Just exporting all the commands to userspace is not the way to go. -michael