Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp5280772ybb; Tue, 24 Mar 2020 14:22:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvIACvOEZRuZs5ky3ZcRK0vEtYQwruHfn00zi5l8ua/W3aYUIWll1R3Gq7nM9OtTVk8UvC3 X-Received: by 2002:aca:5057:: with SMTP id e84mr222669oib.120.1585084974020; Tue, 24 Mar 2020 14:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585084974; cv=none; d=google.com; s=arc-20160816; b=WT8cWdvkszoQAo1ahyoY/l2Y8z8Cpb6tW8sMt0WUdD5d1h2Uob/7voyonGi7yu7inp whlGoayxkDOujb2zhrlP8iFRUSuJF/kmQkzaQ96JH+2+BehM5pZSmUie8iNr3/kXTSyY CIUSLEYax6UtGJW2ePjlcZ5dzLPuOl4x95a8Vi2by3FA/GiVDECJt/nr2TgS+GifjuZ6 L5qgMUgiC9sNCAKRl72afx/j/Cm6KlkyS8iRpWDYu4lAEyqCGZnTLe8FZMsGDDw570yS 1yIRmenHuiKZnkFsoZQMSxhu7ZVcXtgcKw7M1QLJqGciuC85Lmad2Fy6xcTwKAhLRWN8 te3Q== 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=K0AQOrscsNAyPOgnjIz1wdZ8BwbWscK7BvSW7dZFNMU=; b=KMKK3rp17g96Ym5xS83aaghnFd6VTuhJSomZ+ROJsBh72ZXy3drWG+3VT8KnZfDsql FKUU+rHlfrusYw/am7oeiWEdsIExUcKpalmoZvFOUJARIVvCAeLMKRQXC2ugJHCtQ43z FksCpM2lbr941Log4sfg+0jdoxfiqDu66L8SH0VF0xtK5TNftasUazUyPU4h31dk5kLb xfQYeJWa1+nJf4nMCAsF3Tj6kkw8kGEB9C8mwZVbD7PziEImlV5HStX6iFwELij3OEVj lQWxHqOSaXUBSENmb332+Old2cMyQVNWeNlZwxSNSMl1q0vTocbz2Td7XLKxJWdDKjVi TD3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=TU+v6vgT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r23si9871404otq.255.2020.03.24.14.22.39; Tue, 24 Mar 2020 14:22:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=TU+v6vgT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727753AbgCXVWT (ORCPT + 99 others); Tue, 24 Mar 2020 17:22:19 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:46342 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726673AbgCXVWS (ORCPT ); Tue, 24 Mar 2020 17:22:18 -0400 Received: by mail-lj1-f193.google.com with SMTP id v16so213180ljk.13 for ; Tue, 24 Mar 2020 14:22:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=K0AQOrscsNAyPOgnjIz1wdZ8BwbWscK7BvSW7dZFNMU=; b=TU+v6vgTqqL8DSRyHNIS3zPA2Au3s8bOdz4RjYVrI59y/xJG37DuCzUkFedo8prEM1 kEhbDC8RUbuZ44J4woqibSX2DnsCF77IrNvFFBgUdsgFnP87BEfOj65kKyLU5UPa/XiH yLDUovevdVM9pFj6antE7mF1/9gnUPays5DSg= 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=K0AQOrscsNAyPOgnjIz1wdZ8BwbWscK7BvSW7dZFNMU=; b=Mau47tj/vxmXRguB0cinbmpu0kY/ERXDf4tRTW8biTDmyD9m6Ice6zbmuMdcjcL/bx 0vdY1xzqSnBvyT3uwrxJvz43TWWUGbBvsbkPBhnq+fiwirmDhnjLunAkBkNAdo4mPAtQ Wu79+oku7BbnNgPAPqay2R9W5/qJeH/DPG0L+foRAm196XyQTazUyaYKZ6CipDogVV3K U2P20GXKaOB+uSAzjL8t8mMgpupOpNoCPmkGdCaFsIEh5L2gZ2vkLa4MhDEHlKuo/i6N G6wiY+oHt0DaenCGKwmnZDAEn5KIVmoLxJf3Y9WcqBPLE6L0qIMxkTemn6Tz6zOgPV7h XWKg== X-Gm-Message-State: ANhLgQ0f812tmcz7coJ8S46F0a1zCpu5Ni8X/AV2qj2SVh9Ka+g1sr5s GkQMnLHPMvvVnaUtI1KoRg4Xpr1ZQgk= X-Received: by 2002:a2e:3206:: with SMTP id y6mr6666471ljy.231.1585084936008; Tue, 24 Mar 2020 14:22:16 -0700 (PDT) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com. [209.85.167.53]) by smtp.gmail.com with ESMTPSA id d23sm937823lji.62.2020.03.24.14.22.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Mar 2020 14:22:15 -0700 (PDT) Received: by mail-lf1-f53.google.com with SMTP id j11so46903lfg.4 for ; Tue, 24 Mar 2020 14:22:15 -0700 (PDT) X-Received: by 2002:a19:f015:: with SMTP id p21mr60990lfc.10.1585084934903; Tue, 24 Mar 2020 14:22:14 -0700 (PDT) MIME-Version: 1.0 References: <20200324204449.7263-1-gladkov.alexey@gmail.com> <20200324204449.7263-4-gladkov.alexey@gmail.com> In-Reply-To: <20200324204449.7263-4-gladkov.alexey@gmail.com> From: Linus Torvalds Date: Tue, 24 Mar 2020 14:21:59 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RESEND v9 3/8] proc: move hide_pid, pid_gid from pid_namespace to proc_fs_info To: Alexey Gladkov Cc: LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexander Viro , Alexey Dobriyan , Alexey Gladkov , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , "Eric W . Biederman" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Kees Cook , Oleg Nesterov 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 Tue, Mar 24, 2020 at 1:46 PM Alexey Gladkov wrote: > > +/* definitions for hide_pid field */ > +enum { > + HIDEPID_OFF = 0, > + HIDEPID_NO_ACCESS = 1, > + HIDEPID_INVISIBLE = 2, > +}; Should this enum be named... > struct proc_fs_info { > struct pid_namespace *pid_ns; > struct dentry *proc_self; /* For /proc/self */ > struct dentry *proc_thread_self; /* For /proc/thread-self */ > + kgid_t pid_gid; > + int hide_pid; > }; .. and then used here instead of "int"? Same goes for 'struct proc_fs_context' too, for that matter? And maybe in the function declarations and definitions too? In things like 'has_pid_permissions()' (the series adds some other cases later, like hidepid2str() etc) Yeah, enums and ints are kind of interchangeable in C, but even if it wouldn't give us any more typechecking (except perhaps with sparse if you mark it so), it would be documenting the use. Or am I missing something? Anyway, I continue to think the series looks fine, bnut would love to see it in -next and perhaps comments from Al and Alexey Dobriyan.. Linus