Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1152143ybb; Sat, 28 Mar 2020 20:18:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuHip8bLno9f9tqTxbHzlyv2XZEf07H0CnWO8yZk/xgwS6OUW6vT6i7q19Hqq5wJCACUATR X-Received: by 2002:a05:6830:1348:: with SMTP id r8mr4428491otq.57.1585451896185; Sat, 28 Mar 2020 20:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585451896; cv=none; d=google.com; s=arc-20160816; b=OT3U4Or+VDjkrrPDNv5mjVN9HDpNEbgih2BqnePjD4JZYOFpPt/8nxceNEO1Zyfac6 llRu/7wi4v0ORNdSeTOmqusVKLMW6Akm8oOuCCJYnGxmRiX1/aqR+rOCBdHEREpXBtgo NIv42ObCw1OocEpgrfiLSlth7MAORDon0fdY41M0dSlaziyo0g3nMR4J4zAcpll7yys3 HIlZrWGnGz6RPWuRk+rthW6N3kvO7UiClyaNLFZFltIIdHUvhjDypsUEBinLivN6DRlo 9WFpZhsLumCO+m583WNSkdt8lvzSafiC10vEjdPXV/K6P92DsbCM6au/GMFlDuXVBIGY l2CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4II2bc92WqcI1jJHIbHJBRCr9XHybTRKP72pOZ2vBn8=; b=LB1OBZKtMA9Pa+WcnwZ+IUlUi2T6x3Ss5Oe3UZKHMa2D9NX2k9NtrOLzD9P/7qgUeL LDnEpb9oHFeDsrIeFCwp/67l7qYe6Hm4Ew+xsUc4WbRK/WsdMOivot2u64071Qfnf71m iIVy7ZiVuS5ip7b3sZCKqpmVwmriDMX7BUvm6uE12C61ANfr7El5OC4ggIY3V3hD1Icz TIg0Uu6rraRtz2W82Jy7j/TmxAg1l1/GQlecXVqrmF7PYvy2RpCq4EedcrfhDPNnE7st DH2RYyve8JjbJOkNDk0PJXp5WWgH/79ykeubaBnHLRHhAJDPGOhnuAxZENmiR6HpI2O1 Tgpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m9oqaykc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w90si4224127otb.305.2020.03.28.20.17.53; Sat, 28 Mar 2020 20:18:16 -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=@chromium.org header.s=google header.b=m9oqaykc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727144AbgC2DRJ (ORCPT + 99 others); Sat, 28 Mar 2020 23:17:09 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:37889 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbgC2DRI (ORCPT ); Sat, 28 Mar 2020 23:17:08 -0400 Received: by mail-pj1-f65.google.com with SMTP id m15so5705168pje.3 for ; Sat, 28 Mar 2020 20:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4II2bc92WqcI1jJHIbHJBRCr9XHybTRKP72pOZ2vBn8=; b=m9oqaykcy7+GRfPUA0qekrpwJwNqG0S1mlKb9K3dSMoiUplMP4jDXKYYiUxNSn1n+v 4oyL3E8RvMsSp58YQD7MyGe1pOXmUDh3zVX3F14wt1es3/kyO62xLP1vqLHROC2/iG5A NA5fTeT/j2lxo6j6d+AbeShqGk6CPpwln0Emo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4II2bc92WqcI1jJHIbHJBRCr9XHybTRKP72pOZ2vBn8=; b=fRZn+68zB80IrZlTij07T4Y9SSu52gQlbQZzKCSHGMKYa5p1HPD04ydgjlRnHDRDMW RtxAC2U32FCGcupc/jcwFVuMtZsnLy8KwFhBZMy/UP1U+6Tu0IMWfo7LKov8h/Lw5sgw UmJyTdPV6OrJKG+y7NRxuxU3QxWhZdzcuLxHxViUzYeTdCyJMJnnUA8PLa1k6E9RgP3S r4AFfpBJheyM9uQ6Duk9Zuit4ygO7ydFl8+x5xemVyfxlynAN7p0kbzP6Qtpcw7q3vXX E36m+JqmXS9c4kwt0ocE3TF2iI7tWDTl8WI2x8hf7jg39hqiE9YPtcLGzRsSLQ8CLs6F Jm9w== X-Gm-Message-State: ANhLgQ2ERcxZWVAjradesPwgLJaXjf4awisBxERwPybokh/l7/hi44QV Gx55DHLyVT28ibPb4HBow//VbQ== X-Received: by 2002:a17:90a:7105:: with SMTP id h5mr8294662pjk.54.1585451827508; Sat, 28 Mar 2020 20:17:07 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id y14sm7123511pfp.127.2020.03.28.20.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Mar 2020 20:17:06 -0700 (PDT) Date: Sat, 28 Mar 2020 20:17:05 -0700 From: Kees Cook To: Alexey Gladkov Cc: LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexander Viro , Alexey Dobriyan , 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 , Linus Torvalds , Oleg Nesterov Subject: Re: [PATCH v10 7/9] proc: move hidepid values to uapi as they are user interface to mount Message-ID: <202003282016.19E071712@keescook> References: <20200327172331.418878-1-gladkov.alexey@gmail.com> <20200327172331.418878-8-gladkov.alexey@gmail.com> <202003281340.B73225DCC9@keescook> <20200328212547.xxiqxqhxzwp6w5n5@comp-core-i7-2640m-0182e6> <202003281453.CED94974@keescook> <20200328230046.v3qbffmbtl4sd7tg@comp-core-i7-2640m-0182e6> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200328230046.v3qbffmbtl4sd7tg@comp-core-i7-2640m-0182e6> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 29, 2020 at 12:00:46AM +0100, Alexey Gladkov wrote: > On Sat, Mar 28, 2020 at 02:53:49PM -0700, Kees Cook wrote: > > > > > +/* definitions for hide_pid field */ > > > > > +enum { > > > > > + HIDEPID_OFF = 0, > > > > > + HIDEPID_NO_ACCESS = 1, > > > > > + HIDEPID_INVISIBLE = 2, > > > > > + HIDEPID_NOT_PTRACEABLE = 4, > > > > > +}; > > > > Should the numeric values still be UAPI if there is string parsing now? > > > > > > I think yes, because these are still valid hidepid= values. > > > > But if we don't expose the values, we can do whatever we like with > > future numbers (e.g. the "is this a value or a bit field?" question). > > Alexey Dobriyan suggested to put these parameters into the UAPI and it > makes sense because these are user parameters. Okidokey. :) Anyway, ignore my HIDEPID_MAX idea then, since this could become a bitfield. Just checking for individual bits is the way to go for now. Sorry for the noise. -- Kees Cook