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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AD8EC25B0C for ; Tue, 9 Aug 2022 17:25:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245041AbiHIRZX (ORCPT ); Tue, 9 Aug 2022 13:25:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245169AbiHIRZW (ORCPT ); Tue, 9 Aug 2022 13:25:22 -0400 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D9D022A; Tue, 9 Aug 2022 10:25:18 -0700 (PDT) Received: from in01.mta.xmission.com ([166.70.13.51]:53696) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oLSyj-00DfNP-Ed; Tue, 09 Aug 2022 11:25:17 -0600 Received: from ip68-227-174-4.om.om.cox.net ([68.227.174.4]:33792 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oLSyh-002dz9-GI; Tue, 09 Aug 2022 11:25:17 -0600 From: "Eric W. Biederman" To: Bastien Nocera Cc: linux-usb@vger.kernel.org, bpf@vger.kernel.org, Greg Kroah-Hartman , Alan Stern , Benjamin Tissoires , Peter Hutterer , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko References: <20220809094300.83116-1-hadess@hadess.net> Date: Tue, 09 Aug 2022 12:25:08 -0500 In-Reply-To: <20220809094300.83116-1-hadess@hadess.net> (Bastien Nocera's message of "Tue, 9 Aug 2022 11:42:58 +0200") Message-ID: <87y1vx1g97.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1oLSyh-002dz9-GI;;;mid=<87y1vx1g97.fsf@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.227.174.4;;;frm=ebiederm@xmission.com;;;spf=softfail X-XM-AID: U2FsdGVkX1+cCyXu6eLCt0w/0GFvnj61lRiEqcod9WI= X-SA-Exim-Connect-IP: 68.227.174.4 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH 0/2] USB: core: add a way to revoke access to open USB devices X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Bastien Nocera writes: > BPF list, first CC: here, I hope the commit messages are clear enough to > understand the purpose of the patchset. If not, your comments would be > greatly appreciated so I can make the commit messages self-explanatory. > > Eric, what would be the right identifier to use for a specific user > namespace that userspace could find out? I know the PIDs of the > bubblewrap processes that created those user namespaces, would those be > good enough? A namespace file descriptor would work. AKA The result of opening /proc//ns/user. I assume you are asking so that you can filter the set of file descriptors to revoked not by user but by user namespace. Eric > Changes since v2: > - Changed the internal API to pass a struct usb_device > - Fixed potential busy loop in user-space when revoking access to a > device > > Bastien Nocera (2): > USB: core: add a way to revoke access to open USB devices > usb: Implement usb_revoke() BPF function > > drivers/usb/core/devio.c | 79 ++++++++++++++++++++++++++++++++++++++-- > drivers/usb/core/usb.c | 51 ++++++++++++++++++++++++++ > drivers/usb/core/usb.h | 2 + > 3 files changed, 128 insertions(+), 4 deletions(-)