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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 86AD5C433ED for ; Sat, 17 Apr 2021 03:42:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51EAF6115B for ; Sat, 17 Apr 2021 03:42:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235613AbhDQDmy (ORCPT ); Fri, 16 Apr 2021 23:42:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234999AbhDQDmx (ORCPT ); Fri, 16 Apr 2021 23:42:53 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C242C061574; Fri, 16 Apr 2021 20:42:27 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lXbqb-005wB1-Ec; Sat, 17 Apr 2021 03:42:17 +0000 Date: Sat, 17 Apr 2021 03:42:17 +0000 From: Al Viro To: Alexei Starovoitov Cc: davem@davemloft.net, daniel@iogearbox.net, andrii@kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH bpf-next 11/15] bpf: Add bpf_sys_close() helper. Message-ID: References: <20210417033224.8063-1-alexei.starovoitov@gmail.com> <20210417033224.8063-12-alexei.starovoitov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210417033224.8063-12-alexei.starovoitov@gmail.com> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Apr 16, 2021 at 08:32:20PM -0700, Alexei Starovoitov wrote: > From: Alexei Starovoitov > > Add bpf_sys_close() helper to be used by the syscall/loader program to close > intermediate FDs and other cleanup. Conditional NAK. In a lot of contexts close_fd() is very much unsafe. In particular, anything that might call it between fdget() and fdput() is Right Fucking Out(tm). In which contexts can that thing be executed?