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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 9ECCEC43140 for ; Fri, 6 Sep 2019 16:00:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 819DD214DE for ; Fri, 6 Sep 2019 16:00:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395001AbfIFQAW (ORCPT ); Fri, 6 Sep 2019 12:00:22 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:58304 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726295AbfIFQAW (ORCPT ); Fri, 6 Sep 2019 12:00:22 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.1 #3 (Red Hat Linux)) id 1i6Geq-0005iN-3P; Fri, 06 Sep 2019 16:00:20 +0000 Date: Fri, 6 Sep 2019 17:00:20 +0100 From: Al Viro To: Carlos Neira Cc: netdev@vger.kernel.org, yhs@fb.com, ebiederm@xmission.com, brouer@redhat.com, bpf@vger.kernel.org Subject: Re: [PATCH bpf-next v10 2/4] bpf: new helper to obtain namespace data from current task New bpf helper bpf_get_current_pidns_info. Message-ID: <20190906160020.GX1131@ZenIV.linux.org.uk> References: <20190906150952.23066-1-cneirabustos@gmail.com> <20190906150952.23066-3-cneirabustos@gmail.com> <20190906152435.GW1131@ZenIV.linux.org.uk> <20190906154647.GA19707@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190906154647.GA19707@ZenIV.linux.org.uk> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Sep 06, 2019 at 04:46:47PM +0100, Al Viro wrote: > > Where do I begin? > > * getname_kernel() is there for purpose > > * so's kern_path(), damnit > > Oh, and filename_lookup() *CAN* sleep, obviously. So that > GFP_ATOMIC above is completely pointless. > > > > + > > > + inode = d_backing_inode(kp.dentry); > > > + pidns_info->dev = (u32)inode->i_rdev; In the original variant of patchset it used to be ->i_sb->s_dev, which is also bloody strange - you are not asking filename_lookup() to follow symlinks, so you'd get that of whatever filesystem /proc/self/ns resides on. ->i_rdev use makes no sense whatsoever - it's a symlink and neither it nor its target are device nodes; ->i_rdev will be left zero for both. What data are you really trying to get there?