Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1129212pxb; Thu, 4 Mar 2021 04:11:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkhh/RnbmztqSwA5zbE7maZCC784F34IK4vUM8ogW7CWHI0DIsWFfH+vW9UonbgwUmYPfD X-Received: by 2002:a17:906:ecfb:: with SMTP id qt27mr3730691ejb.245.1614859916279; Thu, 04 Mar 2021 04:11:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614859916; cv=none; d=google.com; s=arc-20160816; b=FzkZsgtmJQ7+qDg+992ay7Q8grWMaSql5u4t2StraubVZ4TU2w4D0ZpVsy6cQj5D13 CyjkbZtcJMF14UThVqM9CB9rHwd6z9InLxE50uP05VJFIuxrdhUXq6O6pSdV/dMtzlRV 2n7XsXHpbyw21hOUIuohkO7+E6BscLhhlL1OOjOPuIL+CvtxnYCEbCwa9GxVAj2UW5di zK92mvY5mN13Kj7z6Na5zYSqZf1COr86JQIoNoPS7DHeKZtq1LtbVoOnlkfH9wWhMgE5 qQi6nXNWiyCxj0dHghXeNq0NnXnd4dfyYhoXlEx0VxNL3I9lLqKB/HhmMyWbS5/o9OxA CjZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=/sbNfArgSMix4wk1kr39+jfT8Y30HRqGOwjo1dppLdw=; b=loYN/i2PBJTZHx7cIrD60X6WSyn3wMPj6DeLKAgZpvDFXYb0ucLYarzo4N02yWBqXV LljtwU7eiUGT/4NISmjVhpkmJ1EJKCcRKV773HYbhYikohS0FIijK8N+3IAug8gEsqYz u6PPgJ3huGyqHHCDWdR8IN96dgb/jM7nA5/zno4SyQwu52iHlY7nMMoc6l14pnzkPR35 ucbSaI0HjHrvRtOjNBOhHof38PID3Cg02Rj1+a8HoP+magmNOBuuDe03Y+7A+rYKOUtg lMv48ashvheOLSQMMe6ffDhWZrrnAFuB7vTNUIsmDfRRqJAjb5bpLz8KLzc1GCHzsIvX nPnA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si12804815ejb.431.2021.03.04.04.11.33; Thu, 04 Mar 2021 04:11:56 -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; 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 S1579308AbhCCSa5 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 3 Mar 2021 13:30:57 -0500 Received: from lithops.sigma-star.at ([195.201.40.130]:50128 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240311AbhCCQfT (ORCPT ); Wed, 3 Mar 2021 11:35:19 -0500 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 6F9BA6083275; Wed, 3 Mar 2021 17:34:02 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id XkqzEhlnOBsv; Wed, 3 Mar 2021 17:34:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 214DD6083244; Wed, 3 Mar 2021 17:34:02 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 55hyWb7TB4oV; Wed, 3 Mar 2021 17:34:02 +0100 (CET) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id EEA2A608A38A; Wed, 3 Mar 2021 17:34:01 +0100 (CET) Date: Wed, 3 Mar 2021 17:34:01 +0100 (CET) From: Richard Weinberger To: Michael Walle Cc: linux-mtd , linux-kernel , Miquel Raynal , Vignesh Raghavendra , Greg Kroah-Hartman Message-ID: <675291050.42876.1614789241828.JavaMail.zimbra@nod.at> In-Reply-To: <040cf2058fe4cf5e63dbff534582881a@walle.cc> References: <20210303155735.25887-1-michael@walle.cc> <689194005.42755.1614788236355.JavaMail.zimbra@nod.at> <040cf2058fe4cf5e63dbff534582881a@walle.cc> Subject: Re: [PATCH] mtd: require write permissions for locking and badblock ioctls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF78 (Linux)/8.8.12_GA_3809) Thread-Topic: require write permissions for locking and badblock ioctls Thread-Index: xINH3Mpwe4blEkzF/YfzWKJ0Ni21Ug== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Ursprüngliche Mail ----- >>> 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 :) >> >> That's my fear. Michael, did you verify? > > I don't know any tools except the mtd-utils. So no. openwrt folks have their own tooling, Anrdoid too. >> In general you need to be root to open these device files. >> So, I don't see a security problem here. > > Then this begs the question, why is this check there in > the first place? I fear historical reasons. As soon you can open the device node you can do evil things. > This come up because I was adding a OTPERASE which > was suggested that is was a "dangerous" command. So I > was puzzled why the ones above are considered "safe" ;) :-) Thanks, //richard