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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 BF6C7C43331 for ; Mon, 30 Mar 2020 22:09:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8131420675 for ; Mon, 30 Mar 2020 22:09:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8131420675 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 30D7A6B0037; Mon, 30 Mar 2020 18:09:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BE6A6B006C; Mon, 30 Mar 2020 18:09:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FAF26B006E; Mon, 30 Mar 2020 18:09:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id 0A4866B0037 for ; Mon, 30 Mar 2020 18:09:43 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DCC31180AD817 for ; Mon, 30 Mar 2020 22:09:42 +0000 (UTC) X-FDA: 76653421404.19.star56_1a8f26b1f9e50 X-HE-Tag: star56_1a8f26b1f9e50 X-Filterd-Recvd-Size: 4053 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Mar 2020 22:09:42 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id u68so9310850pfb.2 for ; Mon, 30 Mar 2020 15:09:42 -0700 (PDT) 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:user-agent; bh=j7FmspK21WqfyDNNhuaL3ZlTlaa7O+RnMjIkIEqFuiw=; b=lBWlAfWVZAH3JHr8VhPt/lxWsyfkMa1TIlrvNC4DOF8ifuWHfZrGKA2xIgiRj+dh8g KgAiyvCfjtaQ1qzOI60Omfl9rdcbEDrhyBl2Y/WP6JEbVwE7599ScpoU4i8RCEqlpCad Da61+7ojRrScEnwm2cZgTuiEGTKRiL2cK6bOqanTEPN/hdnm0NPazHvwIUY/ean8udzo 8lNGp6imi8/o3bF1lS6jMMGDizp9gIQfykk2n9/P3VegN7yjVcWtJYVdcVIcMFv2sDSB 7hj5e42+i5r/5JZUj1ocxjg1wjMjR0WyaiFYwwPC2AY8BREZB9dATCtB8KiAadO+tvrV 3igg== X-Gm-Message-State: ANhLgQ2q+BR0n6yU4elugFrzEaDTdCVsKVAZML7iAZr3OH8iIKrwSkK9 EHzm0/N9eEU7/04GMef9uP0= X-Google-Smtp-Source: ADFU+vvPzerl8j1+L7xAnyd4gLFIsKX6lP6TPO/c76Xt2g0Nx6dQq/wpEsf4qIQGjiT4CSIoeAaL8g== X-Received: by 2002:a62:1745:: with SMTP id 66mr15223339pfx.291.1585606181235; Mon, 30 Mar 2020 15:09:41 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id b133sm9608378pfb.180.2020.03.30.15.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 15:09:40 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 61A9F404B0; Mon, 30 Mar 2020 22:09:39 +0000 (UTC) Date: Mon, 30 Mar 2020 22:09:39 +0000 From: Luis Chamberlain To: "Eric W. Biederman" Cc: Michal Hocko , Vlastimil Babka , Kees Cook , Iurii Zaikin , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-mm@kvack.org, Ivan Teterevkov , David Rientjes , Matthew Wilcox , "Guilherme G . Piccoli" Subject: Re: [RFC v2 1/2] kernel/sysctl: support setting sysctl parameters from kernel command line Message-ID: <20200330220939.GW11244@42.do-not-panic.com> References: <20200325120345.12946-1-vbabka@suse.cz> <874kuc5b5z.fsf@x220.int.ebiederm.org> <20200326065829.GC27965@dhcp22.suse.cz> <87bloj2skm.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bloj2skm.fsf@x220.int.ebiederm.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Mar 26, 2020 at 07:45:13AM -0500, Eric W. Biederman wrote: > > On Wed 25-03-20 17:20:40, Eric W. Biederman wrote: > plus I want to get very far away from the incorrect idea that you > can have sysctls without compiling in proc support. That is not how > the code works, that is not how the code is tested. Agreed. > It is also worth pointing out that: > > proc_mnt = kern_mount(proc_fs_type); > for_each_sysctl_cmdline() { > ... > file = file_open_root(proc_mnt->mnt_root, proc_mnt, sysctl_path, O_WRONLY, 0); > kernel_write(file, value, value_len); > } > kern_umount(proc_mnt); > > Is not an unreasonable implementation. This: > There are problems with a persistent mount of proc in that it forces > userspace not to use any proc mount options. But a temporary mount of > proc to deal with command line options is not at all unreasonable. > Plus it looks like we can have kern_write do all of the kernel/user > buffer silliness. Is a bit of tribal knowledge worth documenting for the approach taken forward. Vlastimil can you add a little comment mentioning some of this logic? Luis