From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AE8FC433E5 for ; Sun, 28 Mar 2021 17:29:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40FDE61981 for ; Sun, 28 Mar 2021 17:29:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231435AbhC1R2q (ORCPT ); Sun, 28 Mar 2021 13:28:46 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:50959 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231350AbhC1R2j (ORCPT ); Sun, 28 Mar 2021 13:28:39 -0400 Received: from xps13.home (lfbn-tou-1-1325-59.w90-89.abo.wanadoo.fr [90.89.138.59]) (Authenticated sender: miquel.raynal@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id A0E14200003; Sun, 28 Mar 2021 17:28:36 +0000 (UTC) From: Miquel Raynal To: Michael Walle , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Greg Kroah-Hartman Subject: Re: [PATCH] mtd: require write permissions for locking and badblock ioctls Date: Sun, 28 Mar 2021 19:28:36 +0200 Message-Id: <20210328172836.10072-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210303155735.25887-1-michael@walle.cc> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'1e97743fd180981bef5f01402342bb54bf1c6366' Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-03-03 at 15:57:35 UTC, Michael Walle wrote: > MEMLOCK, MEMUNLOCK and OTPLOCK modify protection bits. Thus require > write permission. Depending on the hardware MEMLOCK might even be > write-once, e.g. for SPI-NOR flashes with their WP# tied to GND. OTPLOCK > is always write-once. > > MEMSETBADBLOCK modifies the bad block table. > > Fixes: f7e6b19bc764 ("mtd: properly check all write ioctls for permissions") > Signed-off-by: Michael Walle > Reviewed-by: Greg Kroah-Hartman > Acked-by: Rafał Miłecki > Acked-by: Richard Weinberger Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks. Miquel