Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2130622rdb; Thu, 7 Dec 2023 21:27:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIaKAx/Xlx/PptgVOHrKk0aA9Po/kdfiiWYBJg3LI7+ppa/Rn3Fvz1+kk6i4sWrteycVeM X-Received: by 2002:a17:902:6b0a:b0:1cf:73ff:b196 with SMTP id o10-20020a1709026b0a00b001cf73ffb196mr4188485plk.8.1702013253093; Thu, 07 Dec 2023 21:27:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702013253; cv=none; d=google.com; s=arc-20160816; b=XxOu+j1csFzfFcuz6ypAYB1qLTQpGmNQsPodDHdVERiy8lI8vIxuJJzeQsDjvQtmaR B04pbZyTLPEItg+c5jfEewlZL1SiX+QSsjCSxPD0x4W2QPyDFW7HmKbzdWrCgTJfIIzD hB9XdW02kVVMaj5frtQx3QoRHFy7YfQsYTqLPFj7ZIZE0l8fpa5MkErLTbzp6cFlDyfH SgWohJcBGc4szaL+LvkvyjN93vHDyEFzgo4NH5y+I66U4Q7mA4thuVVSgDBMGG9DVhB4 HXJEWNoOdCeu+HTqOYJ7i/xmnYrZFz5ti+oTzifQvvwq951ePv2/Q0bh2YMdtUBmCh35 cv8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ROPNoO4uO4qvmzxGXSnRhzbmRJYJmdITiyKD06YEh3w=; fh=TewSL/7BcBUXQ4abhIzM1AmEf/ZtEM7R7UDrxSp4XEU=; b=MoeEdm9/BlmvhdjwRECL3GyXngkoAKvWgbn9VKn9G4VBOHwVPNH1mQXSYmnEopm2Cy qjU14ad//3teKkJRYW/Qo9ZTJ7Xz0yap8Tx2K66k0gTkOEIMm6p92sQVY2f6E7LA1crm diZ06Mx21FfCR+nxlebfcvZCiYg19BQ3nK63sN5uz1UcCda13diAeK+bWBlL6Vz/Ybps x+3G/viwCc4KGESgqua1UfQrh0zJQqTO9ofgjIx6ev3TpFKhxPBz0tSzcDMe3tk9cO4Q iY8N+M3j4jHyrqkAdw0Iselg0v4IsSXZrV0KL3k1aNECNCoqeKO4Xva4fK+QvsNwpEu3 E4iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NNPwQFPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id t8-20020a1709028c8800b001d08be55d01si952472plo.101.2023.12.07.21.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 21:27:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NNPwQFPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8FB5085A6CF4; Thu, 7 Dec 2023 21:27:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbjLHF1N (ORCPT + 99 others); Fri, 8 Dec 2023 00:27:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjLHF1M (ORCPT ); Fri, 8 Dec 2023 00:27:12 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F4F91708 for ; Thu, 7 Dec 2023 21:27:18 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5144EC433C7; Fri, 8 Dec 2023 05:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1702013237; bh=MWgjljHfQqo8VDu9iHxYxZNeRzofKjBIkHCOEehD1jE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NNPwQFPWpNf5CEaajJe3E3xnFBUxXAK4T22t5sZbl2dY6hzThvMj/dEgXYbPv83Me oPIGL8lg3qnL41higu605jVpykpJT55Iv8KDwQqPeJo+UfV+B1zw3cJBc7dkx7KLr7 0uQmJQwQxo7cxRcBXZ+h+nq1EhVHpHItkpvHaDwQ= Date: Fri, 8 Dec 2023 06:27:14 +0100 From: Greg Kroah-Hartman To: Aron Silverton Cc: Jakub Kicinski , Saeed Mahameed , Jason Gunthorpe , David Ahern , Arnd Bergmann , Leon Romanovsky , Jiri Pirko , Leonid Bloch , Itay Avraham , linux-kernel@vger.kernel.org, Saeed Mahameed Subject: Re: [PATCH V3 2/5] misc: mlx5ctl: Add mlx5ctl misc driver Message-ID: <2023120857-calculus-concerned-cef0@gregkh> References: <20231128103304.25c2c642@kernel.org> <2023112922-lyricist-unclip-8e78@gregkh> <20231204185210.030a72ca@kernel.org> <20231205204855.52fa5cc1@kernel.org> <20231207092329.3ec04dca@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 07 Dec 2023 21:27:30 -0800 (PST) On Thu, Dec 07, 2023 at 12:06:28PM -0600, Aron Silverton wrote: > On Thu, Dec 07, 2023 at 09:23:29AM -0800, Jakub Kicinski wrote: > > On Thu, 7 Dec 2023 10:41:25 -0600 Aron Silverton wrote: > > > > I understand that having everything packaged and shipped together makes > > > > life easier. > > > > > > I think it is a requirement. We operate with Secure Boot. The kernel is > > > locked down. We don't have debugfs access, even if it were sufficient, > > > and we cannot compile and load modules. Even without Secure Boot, there > > > may not be a build environment available. > > > > This 'no debugfs' requirement is a kernel lockdown thing, I presume? > > Are we expected to throw debugfs out the window and for all vendors > > to reimplement their debug functionality via a misc driver taking > > arbitrary ioctls? Not only does that sound like a complete waste of > > time and going backward in terms of quality of the interfaces, needing > > custom vendor tools etc. etc., but also you go from (hopefully somewhat) > > upstream reviewed debugfs interface to an interface where the only > > security assurance is vendor telling you "trust me, it's all good". > > IIRC, with lockdown, we can read from debugfs IFF the entries' > permissions are 0400. We cannot write. It's not suitable for > implementing an interactive debug interface. This is a policy decision that a distro decides to do, and I have seen it happen many times. The problem with this is then, as you have found out, vendors try to work around the removal of access to debugfs by creating new interfaces like misc drivers and sysfs files to emulate what they were previously exporting with debugfs. When they do that, they break the reason why the distro/vendor decided to prevent access to debugfs in the first place, making the whole system insecure again! I see this happen all the time in Android devices as Android restricted access to debugfs many years ago to try to solve the problem of drivers doing insecure things there. Those drivers then just moved those insecure operations to a different interface, making the system insecure again. To stop this cat-and-mouse game, work with the vendors that are implementing these requirements to shut down access to these interfaces. That is a policy decision made by them, and does NOT mean that the kernel community needs to then start taking code to circumvent those decisions as that makes the whole thing pointless. So in short, use debugfs, that is what it was designed for. If a vendor does not wish to enable access to debugfs, then that is their decision (probably a good one), don't circumvent it by making a new interface, as odds are, the vendor will eventually realize it and work to cut off that new interface as well, as they rightfully should. thanks, greg k-h