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 01B7DC2BA1B for ; Mon, 6 Apr 2020 14:08:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BE4CA239EC for ; Mon, 6 Apr 2020 14:08:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE4CA239EC 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 4127D8E002B; Mon, 6 Apr 2020 10:08:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C1EE8E000D; Mon, 6 Apr 2020 10:08:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B0458E002B; Mon, 6 Apr 2020 10:08:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0071.hostedemail.com [216.40.44.71]) by kanga.kvack.org (Postfix) with ESMTP id 136488E000D for ; Mon, 6 Apr 2020 10:08:41 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BC2FF8019BF8 for ; Mon, 6 Apr 2020 14:08:40 +0000 (UTC) X-FDA: 76677610800.17.jam65_11823c07d7c20 X-HE-Tag: jam65_11823c07d7c20 X-Filterd-Recvd-Size: 4879 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 14:08:40 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id d24so5952495pll.8 for ; Mon, 06 Apr 2020 07:08:40 -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=qiVBZPsdURZP1jhMxDWHye9mEvFMkZlVNadDHV0ejs4=; b=PZvRAlLClLLm54BghwrGUaEVVQzluqTGXlxjJuEC9DAsLeW1v4HyeymVDKs6WWMbj4 HYgCRNyBtoSYCDx+fCpNjOIhKmiuVSyoNaf9JHvL4AUWX4MUIiukFN22mBNTRM9D16g0 xmBVO5oUcpDMUWPno8bBpQwHOvXAcnXwvHGJN1V8tJ5PMScYyCSuDlkpFET4Moz/JkXK oAfwlbcuARRxcI9CsMOPcutGaEjhkdt4yjCal7Q7bvbo/3zDh895nT8m4imzlILrUCzG NJTCUGpm0Jw9/TQOJqCYev1k8vk0i14owwJzokGBNBjcSMkwUGLzrqoXsa+NcA6rGYde Bisw== X-Gm-Message-State: AGi0Pubq8O3tSQbXzARqGx19T+9jQcO872iBDQ1XrGkiggdMFufQxVm2 otOh7qr/hje/RGL1Enay5LY= X-Google-Smtp-Source: APiQypK4PBijtr6jrSkxbP+qg+JhVIDRUZnqmssM67o2eOuF1E9o8YpsOIerTZkbPlD0P7gpp2RFWw== X-Received: by 2002:a17:90a:aa95:: with SMTP id l21mr11323852pjq.4.1586182119271; Mon, 06 Apr 2020 07:08:39 -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 b2sm4506439pgg.77.2020.04.06.07.08.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 07:08:37 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id DD95740246; Mon, 6 Apr 2020 14:08:36 +0000 (UTC) Date: Mon, 6 Apr 2020 14:08:36 +0000 From: Luis Chamberlain To: Kees Cook Cc: Vlastimil Babka , Iurii Zaikin , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-mm@kvack.org, Ivan Teterevkov , Michal Hocko , David Rientjes , Matthew Wilcox , "Eric W . Biederman" , "Guilherme G . Piccoli" , Alexey Dobriyan , Thomas Gleixner , Greg Kroah-Hartman , Christian Brauner Subject: Re: [PATCH 1/3] kernel/sysctl: support setting sysctl parameters from kernel command line Message-ID: <20200406140836.GA11244@42.do-not-panic.com> References: <20200330115535.3215-1-vbabka@suse.cz> <20200330115535.3215-2-vbabka@suse.cz> <20200330224422.GX11244@42.do-not-panic.com> <287ac6ae-a898-3e68-c7d8-4c1d17a40db9@suse.cz> <20200402160442.GA11244@42.do-not-panic.com> <202004021017.3A23B759@keescook> <20200402205932.GM11244@42.do-not-panic.com> <202004031654.C4389A04EF@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202004031654.C4389A04EF@keescook> 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 Fri, Apr 03, 2020 at 04:57:51PM -0700, Kees Cook wrote: > On Thu, Apr 02, 2020 at 08:59:32PM +0000, Luis Chamberlain wrote: > > We modify the copied bootparams to allow new sysctls to map to old boot params? > > This strdup is so that the > command line can have '\0's injected while it steps through the args > (and for doing the . and / replacement). Please ignore the const feedback then. > > This is the least cumbersome solution I could think of. Other things > > would require things like using qemu, etc. That seems much more messsy. > > Yes. Doing an internal extension isn't testing the actual code. But it would. > > > This is an external interface (boot params), so > > > I'd rather an external driver handle that testing. We don't have a > > > common method to do that with the kernel, though. > > > > Right... which begs the question now -- how do we test this sort of > > stuff? The above would at least get us coverage while we iron something > > more generic out for boot params. > > > > > > That would test both cases with one kernel. > > > > > > > > You could then also add a bogus new sysctl which also expands to a silly > > > > raw boot param to test the wrapper you are providing. That would be the > > > > only new test syctl you would need to add. > > > > > > Sure, that seems reasonable. Supporting externally driven testing makes > > > sense for this. > > > > But again, what exactly? > > I don't think anything is needed for this series. It can be boot tested > manually. Why test it manually when it could be tested automatically with a new kconfig? Luis