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=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 C4FC7C43333 for ; Wed, 3 Mar 2021 19:09:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76BC364EEE for ; Wed, 3 Mar 2021 19:09:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1578693AbhCCSRt (ORCPT ); Wed, 3 Mar 2021 13:17:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:35042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230430AbhCCQJq (ORCPT ); Wed, 3 Mar 2021 11:09:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 563A264ED7; Wed, 3 Mar 2021 16:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614787739; bh=oLEMq+FKXQy4SVc1LwzFfB9gKXgRmMlJaTjBzUFQP+4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UnikIBCXiim0R4HJziT75V1F8nppUbRj3q+OrkLYA/NTyaweTDY+8tXeQDONo+IiQ kLA4hbqX8DFJiApfUGeaTk2/E+FHgtc/ieEdQgRJK5FrXl3gVkMNd8pV28ZTu3RJle UWUyjf4ErPsURpCRh9nMmkle3Ry3Ujs9iLjAowH0= Date: Wed, 3 Mar 2021 17:08:56 +0100 From: Greg Kroah-Hartman To: Michael Walle Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Subject: Re: [PATCH] mtd: require write permissions for locking and badblock ioctls Message-ID: References: <20210303155735.25887-1-michael@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210303155735.25887-1-michael@walle.cc> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 03, 2021 at 04:57:35PM +0100, 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 > --- > drivers/mtd/mtdchar.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) Thanks for auditing the rest of these from my original patch. If this is ok with userspace tools, it's fine with me, but I don't even have this hardware to test with :) Reviewed-by: Greg Kroah-Hartman