Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1759525pxa; Sun, 23 Aug 2020 15:32:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwY8qmMO6wJXZfyjC3wvHJsSb4E+J1aip8JNFulsHL74CCwM0DZIxsL3f/3YW8sJTOghuXD X-Received: by 2002:a05:6402:1e5:: with SMTP id i5mr2812529edy.194.1598221972359; Sun, 23 Aug 2020 15:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598221972; cv=none; d=google.com; s=arc-20160816; b=ROFQPupMO4fwq2RjektWuCpiECml9WZidxeJ2LxEczAVtZA3Ey9k1ngmKjY92hmyTy 41K6WmLXQKfyFJTGt8nT8IgNFrdoDLPAC7fHhxPyGWedw2caTl0WauRaN7F4EbfuAtAH 4SsekGnu34QP+sj8qz+bz/qqReIpiKlYyYgdrxUjQY4LEknKqMgJjp4xeAaAZXE17lcg AOj8FK5G0EJycUek1JsRzyzBCwbBtz1yq4SB7tBprjl3jh/Gb8EhTA0HSCcg4zmuzVxg KaQJjBurkt0xcwlv1zJqn0kTfiy29Cerfh5j/pvQx1dcDavHMjdvsvukwHk3IlunPAy4 l47g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OCbyT8Wrt7DW9zhQxNDDF4QWFdP2cM1l1TV2mZi9goY=; b=e6RpGSdl0TaA0lWmY6YFBOh7+YgV2aQZIWb0UQZBUDDKQ7TauuRRwP+THyQDSXRLB4 C1sIZsb78HrDg2h7snv52pN0Pq0/HtJdwAzdoe0RRlLMeIdfYUDi2XckCr5mouRH4FrS DgvOsYcDpkhAGqwi8bks1MWAtektdu3fxzSyBPBpX6POpsfFXjSW5vlDn5auj6qrbeyz y3bnvOvGJhhEi6/9fEYGqhf5J3AueXRjXoh/nZSY3vUoVGf2SIt5AuDlm/FdBH9J/2ex N+Zsh/FiyMjsW/diFPDxys86Ry1W8dQTC4didnbe/Q/43ZSZoM0hHqf6Y+ASIVG6RnoJ 6fhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tfz-net.20150623.gappssmtp.com header.s=20150623 header.b=QE6NuQ7z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e26si755241edc.216.2020.08.23.15.32.29; Sun, 23 Aug 2020 15:32:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@tfz-net.20150623.gappssmtp.com header.s=20150623 header.b=QE6NuQ7z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726862AbgHWW2i (ORCPT + 99 others); Sun, 23 Aug 2020 18:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726803AbgHWW2h (ORCPT ); Sun, 23 Aug 2020 18:28:37 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C33AFC061575 for ; Sun, 23 Aug 2020 15:28:36 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id d16so6841320wrq.9 for ; Sun, 23 Aug 2020 15:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tfz-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OCbyT8Wrt7DW9zhQxNDDF4QWFdP2cM1l1TV2mZi9goY=; b=QE6NuQ7zRXs7929353ltLpfgS+0DmhB/SOZWK1nX09cLl5mSRc08gunw0mSIFBIesi tqP5F//nFgo04iLXNaZeQcMgHiNC8U6K8USa4hUXsO+3j9h+wTPIE/PZ4HAV1c72a3pE 1toDiSt5vqJOaBMD1pVGD4WPUdgdwOhHwD5VByKN7e97sn6ZryxXerJm7hkWwrupKAM5 E/haE66gk+VyHis6tCQx07hpKRw+GSRS4F7wEfgaGQ5CP4fHSxlVS29xHD8LUj1Gembl F45+LBAJRagg36xhTnYsYrhrc8HFZeMSilx82bQFx2Pamf0Kgm2jYHX+mEgi9Xsy3Rif lKdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OCbyT8Wrt7DW9zhQxNDDF4QWFdP2cM1l1TV2mZi9goY=; b=iZigREAi88e72/NrYyptIPdluQFx/V2XrSU+os/oBVsMXCRXUTdrDc++GQrmeJzB3B Dqg0y0Z/+aTecOPcucA5bcPWWOgPvok4CUwwZiR5FpjmDWdw5IOAlRPuhzNwdWX2GHR8 RD3KuOPieBpq/7hGi3iO07FSl2fN+nm5e13gHYSfZNicW44cRFdvYa4KOJgu0XDjoxct kMYH7SkSiBRP7a1sL/TXkq/BMzEKQEHjhIzEdeiXLJrYRVSIE5AXpMnTM7yarngxZmV9 ZovC4UJn8V8TJ2GmqL4OSVWw54EvRarxpSnjEfM3iFW9fPP5eWuLsXroyqiLUuCiUgrJ 0xwA== X-Gm-Message-State: AOAM533txq8SUrufS3aYFyXgRsKZpxMB3hTef7w1G94vxJyB93FSIjd6 +XHIujyb4YMCnsl97jr9KTk2BKOGx1HALgKcnFI3tw== X-Received: by 2002:a5d:660d:: with SMTP id n13mr3054833wru.52.1598221714806; Sun, 23 Aug 2020 15:28:34 -0700 (PDT) MIME-Version: 1.0 References: <20200822.140141.880909883327091452.davem@davemloft.net> In-Reply-To: <20200822.140141.880909883327091452.davem@davemloft.net> From: Pascal Bouchareine Date: Sun, 23 Aug 2020 15:28:23 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] net: socket: implement SO_DESCRIPTION To: David Miller Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, netdev@vger.kernel.org, Jakub Kicinski , Andrew Morton , Alexey Dobriyan , Al Viro Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 22, 2020 at 2:01 PM David Miller wrote: > > About the pid part - > > On top of multiple pids to scan for a given socket, there's also the > > security provided by /proc - I'm not sure what inet_diag does for that > > So maybe users calling it will need to scan /proc for a long time anyway... > > > > Or is that doable? > > I'd like to kindly ask that you do more research into how this kind of > information is advertised to the user using modern interfaces, and what > kinds of permissions and checks are done for those. If we wanted to get rid of having to scan /proc from userland when using sock_diag to identify associated processes, I suppose scanning for pids would be the most annoying part? I understand sock_diag uses CAP_NET_ADMIN for some sensitive bits. I thought it would require an additional bit of logic to let an unprivileged user access its own socket "sensitive" data. Your message makes me think I need to read a lot more about it, so I'll try that - but more importantly as you mention APIs and modern interfaces, I think eBPF is going to be of great help to try and hack around this data without disturbing existing APIs. Thanks for taking the time to look into it