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=-3.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,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 11002C2BA12 for ; Thu, 2 Apr 2020 16:52:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E62F820737 for ; Thu, 2 Apr 2020 16:52:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389293AbgDBQwG (ORCPT ); Thu, 2 Apr 2020 12:52:06 -0400 Received: from raptor.unsafe.ru ([5.9.43.93]:48690 "EHLO raptor.unsafe.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727412AbgDBQwG (ORCPT ); Thu, 2 Apr 2020 12:52:06 -0400 Received: from comp-core-i7-2640m-0182e6 (ip-89-102-33-211.net.upcbroadband.cz [89.102.33.211]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by raptor.unsafe.ru (Postfix) with ESMTPSA id 066E52052E; Thu, 2 Apr 2020 16:52:00 +0000 (UTC) Date: Thu, 2 Apr 2020 18:51:56 +0200 From: Alexey Gladkov To: "Eric W. Biederman" 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" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Kees Cook , Linus Torvalds , Oleg Nesterov , David Howells Subject: Re: [PATCH v10 8/9] proc: use human-readable values for hidehid Message-ID: <20200402165156.4mzenof4upvtd3lv@comp-core-i7-2640m-0182e6> References: <20200327172331.418878-1-gladkov.alexey@gmail.com> <20200327172331.418878-9-gladkov.alexey@gmail.com> <87d08pkh4u.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87d08pkh4u.fsf@x220.int.ebiederm.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.1 (raptor.unsafe.ru [5.9.43.93]); Thu, 02 Apr 2020 16:52:02 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Apr 02, 2020 at 11:05:21AM -0500, Eric W. Biederman wrote: > Alexey Gladkov writes: > > > The hidepid parameter values are becoming more and more and it becomes > > difficult to remember what each new magic number means. > > In principle I like this change. In practice I think you have just > broken ABI compatiblity with the new mount ABI. > > In particular the following line seems broken. > > > diff --git a/fs/proc/root.c b/fs/proc/root.c > > index dbcd96f07c7a..ba782d6e6197 100644 > > --- a/fs/proc/root.c > > +++ b/fs/proc/root.c > > @@ -45,7 +45,7 @@ enum proc_param { > > > > static const struct fs_parameter_spec proc_fs_parameters[] = { > > fsparam_u32("gid", Opt_gid), > > - fsparam_u32("hidepid", Opt_hidepid), > > + fsparam_string("hidepid", Opt_hidepid), > > fsparam_string("subset", Opt_subset), > > {} > > }; > > As I read fs_parser.c fs_param_is_u32 handles string inputs and turns them > into numbers, and it handles binary numbers. However fs_param_is_string > appears to only handle strings. It appears to have not capacity to turn > raw binary numbers into strings. I use result only with hidepid_u32_spec and nobody modifies param->string. I do not use internal functions here. I don’t follow how a raw number can get here ? > So I think we probably need to fix fs_param_is_string to raw binary > numbers before we can safely make this change to fs/proc/root.c > > David am I reading the fs_parser.c code correctly? If I am are you ok > with a change like the above? > > Eric > -- Rgrds, legion