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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 EDEB8C2D0EB for ; Sun, 29 Mar 2020 03:17:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C39A92071B for ; Sun, 29 Mar 2020 03:17:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="m9oqaykc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727226AbgC2DRL (ORCPT ); Sat, 28 Mar 2020 23:17:11 -0400 Received: from mail-pj1-f66.google.com ([209.85.216.66]:55574 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbgC2DRK (ORCPT ); Sat, 28 Mar 2020 23:17:10 -0400 Received: by mail-pj1-f66.google.com with SMTP id fh8so791393pjb.5 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=W7ADQ5B2fqyX1OKgfJxnIzjjPRa0juithN7YAiqAAiGKZuWpvq5BT7LDD7xtmzCGou Q00KYf7fS4+3+53H7uv964qhu906XhRRN3q7OBhydsCXsTyMqKow7P2IygWE8CbBA1qH SDncQsT/IauYHVUQubuicHnOecUZVsA+0QDq3rhO4jvxy1STchLsPMVoUcvLnNtxyC+l 6DuP4sZzAjAaX2QDp1FzYrrOwlIQc9gP8cPoF305UJR44pPgjac2k86zADpRqx8gtUsW RQaXVmbJ5qYa3qnOrbnVuHothEo1JK4K03amJ0nE2jv9CJjh0/QYOJ/OF4FWsL/1jP7g IetQ== X-Gm-Message-State: ANhLgQ3qRJyyh8OQ8tIjFxLoKvE5tVqNeW0DkHvBYbLx81EfIkoCi1ZE nQibeNMkCsqQrrqivDgqq0JZIA== X-Google-Smtp-Source: ADFU+vtseLSYN5So1Oobu2UiukVUxTzuZN3FTYmpLjJuga7kllNUrhEyIWnwcYJIyJMu6YW0JBI/4Q== 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-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@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