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 4CAAAC433EF for ; Tue, 26 Apr 2022 10:38:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346360AbiDZKlQ (ORCPT ); Tue, 26 Apr 2022 06:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350268AbiDZKkU (ORCPT ); Tue, 26 Apr 2022 06:40:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9908DB6 for ; Tue, 26 Apr 2022 03:30:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 267FCB81D52 for ; Tue, 26 Apr 2022 10:30:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4067FC385A4; Tue, 26 Apr 2022 10:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650969009; bh=CU/HBoNB92rU0rmf7epvx4Utj0M89EKDnvgARZdup2U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i5gMoioC5cSOtGR+PAPOqoSQahcu7r70Hyrl5b8JAmK8G+iu7JkbFXg6XX4wxrEPc Kh50ae+xb5znmIzwny4lnCU9JtKafhUqT2hNYw63rYN5BCXD772cUAYfWjmT4a5klp gd+lWVLyZ+lfLUZey2RrYYf2ckIrzlAPOngbITwg= Date: Tue, 26 Apr 2022 12:30:07 +0200 From: Greg Kroah-Hartman To: Bastien Nocera Cc: Oliver Neukum , Peter Hutterer , linux-usb@vger.kernel.org, Alan Stern , Benjamin Tissoires Subject: Re: [RFC v1] USB: core: add USBDEVFS_REVOKE ioctl Message-ID: References: <1d82343a5987a308ac9bd3f6fd481bc12a608a24.camel@hadess.net> <7def25c7-0870-accc-c689-4d8eef1b7acf@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Tue, Apr 26, 2022 at 12:07:32PM +0200, Bastien Nocera wrote: > On Tue, 2022-04-26 at 10:46 +0200, Oliver Neukum wrote: > > > > > > On 26.04.22 09:21, Greg Kroah-Hartman wrote: > > > Yes, but, it's not so simple.  Many people have asked for revoke() > > > to be > > > added as a syscall like is in the BSDs, but the BSDs only allow > > > that for > > > a very small subset of file descriptor types, and doing it in a > > > generic > > > fashion seems very difficult (I tried a few years ago and gave up, > > > but > > > my knowledge of the vfs layer is minimal.) > > Well, then we should go for the minimalist approach and just > > add a hook to VFS. Multiple different ioctl()s are definitely a bad > > idea. > > An frevoke() looks much easier to do than one based on paths. > > If I understand the issue behind the proposal correctly the caller > > has opened the device. > > Doesn't look like FreeBSD at least has an frevoke() syscall anymore, it > had an FREVOKE flag, which is now a define for the O_VERIFY option > which has quite different semantics: > https://www.freebsd.org/cgi/man.cgi?sektion=2&query=open Take a look at this implementation: https://man.openbsd.org/revoke.2