Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1930462ybx; Sat, 2 Nov 2019 08:58:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsObf/p0ZNDGeqswimLzUxpmRgA79NgLQ3SPdijeRWKlzCTjlihYgf9A+I77OXBBiGPtaB X-Received: by 2002:a50:9a85:: with SMTP id p5mr15537774edb.223.1572710326515; Sat, 02 Nov 2019 08:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572710326; cv=none; d=google.com; s=arc-20160816; b=YlILUDgQJ5tWZMUcujCtVV9S8HubBoAJq3YYll2RtH41Za6z2KuaQxcjNXLeP/chL5 HfDBzqoOGrW/QuVYpapidG1vFaYkfKXLDNUVQZbqPLmTS7R1XUyulYA1qlKY64rq7D+X d4gyhrO+FIqZXzpIFYyEbl4FHNNffcfS9s4HIzusUeVMjI1kXsC4NN+/Crmvikh+cRpL W5Q5bYc6J/Co6KDVDZsz2lCLX66CqKC5Na1Kd/NrImS1aBHSuJ2/hy/Ie+e2IWgu6noJ 7x8BH7rH21/EG9RMql7c2b1sEbAKE0Em9AX7xcBcFiBPqSUvexDZwdPFfvhozXrmyBNE R32A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iHgA3aOgWjIxl0qn62I+cGe5Q1kSJeNXPkSnAw6wxo0=; b=y8uZN1u7urIIEIcn+leT6DVZaIPX6ZYm92VR/6RmGJPBwXXp08NTOG0Q2U30Ls6JV8 76R7nxPerkUiAKX0BU1WHLwQNhpF37nZRnCHsEU+eTZt6fu6wq1mQNzDcG82R8j/P1tI w5cJksXDJIrZtelQythrleBs5FFiJtmDoW89crxQUYqBosb9qGokDOa3om1pSV3th5Xd z5fU4gQdTEmgPIxPAHLEVLB2pzwS08QjI7XBC9lVbLbgLwDjcSULPusloT1nKyrhZnYO IhR0DxKDv8jefKMHD/dzAmvzYCKLLvamctyTG8MVwdi6X72LwPkABqd6eqa9IzFS9WPl 0z1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b9CXeZ0K; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k43si2883643edb.150.2019.11.02.08.58.21; Sat, 02 Nov 2019 08:58:46 -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=@gmail.com header.s=20161025 header.b=b9CXeZ0K; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726757AbfKBPzm (ORCPT + 99 others); Sat, 2 Nov 2019 11:55:42 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40437 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726454AbfKBPzm (ORCPT ); Sat, 2 Nov 2019 11:55:42 -0400 Received: by mail-wm1-f68.google.com with SMTP id f3so774311wmc.5 for ; Sat, 02 Nov 2019 08:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iHgA3aOgWjIxl0qn62I+cGe5Q1kSJeNXPkSnAw6wxo0=; b=b9CXeZ0Kt9j/VH0zPJp+WpaNlnTomuRQN/Ywv/yTp6vEpPUyLZqh/qmMDVUBC0qNGC jh2KFZTh2PAYQeCQXsPZNfPxTl2WQ6eno4QTYnTOn5YDzOfx2NO+REB661RIN/iZm/CF d4Cl2Doe4X0nF1ecI6JCm5gPFO+MXsMcaOKAROqGraRSLUlA4+wBIk47KDbObwdYpAuG ypkkpcnbQJGN/Kr2RwG1MQAxpfpbM5iJTI3QiBae4xxER0fluC+xu/kCfrZF/5z+Vt8M GV8CpKEyJczB6lANsrsDUlXywNxxurdEN9sz1to/tEF2mzQMcanfXlAHIY5MEGwPJ90K Soug== 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=iHgA3aOgWjIxl0qn62I+cGe5Q1kSJeNXPkSnAw6wxo0=; b=qCekb6Pm9pbBwwoBAfTmoHzwsmjGlgMtnwsF2Km2pmipSaxfyYsk6kPQcovekIGagi tO2dCl8h6ghwkUcHZKtWz4sLcapkmkBeUQb2TSGzP/gbHdZz/ShaAIVnXnUkSKeEoqP4 B741c1h+WIIFgX5o6PqQYZoS8JBZu6XiQKNxR202+HUQYw6lQe322gURnwBjWubnXVpx 0dbHt24Jg42BaXI/MBWnc/xfP1AoTi3HX8QqK66vw/xcGhDvNxuv/o6S9JN6Y5IK0yNE c0fgKHkYzdOnnvwwmw1m/LHVtRL8eIa69IEi977N0ff/XfvpVLZmpwo5lTx89jDDktpm afGQ== X-Gm-Message-State: APjAAAUqrcAirhFzABIE5IL8FzCLqzu2eSCTOvLyM38dW37f/sDm2VZe tLcrH7Fs89XAvsePXlJpMw== X-Received: by 2002:a1c:9601:: with SMTP id y1mr14907470wmd.157.1572710140068; Sat, 02 Nov 2019 08:55:40 -0700 (PDT) Received: from avx2 ([46.53.250.90]) by smtp.gmail.com with ESMTPSA id g184sm13984243wma.8.2019.11.02.08.55.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Nov 2019 08:55:39 -0700 (PDT) Date: Sat, 2 Nov 2019 18:55:36 +0300 From: Alexey Dobriyan To: Andrew Morton Cc: Chris Down , Johannes Weiner , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] kernel: sysctl: make drop_caches write-only Message-ID: <20191102155536.GA10251@avx2> References: <20191031221602.9375-1-hannes@cmpxchg.org> <20191031162825.a545a5d4d8567368501769bd@linux-foundation.org> <20191101110901.GB690103@chrisdown.name> <20191101144540.GA12808@cmpxchg.org> <20191101115950.bb88d49849bfecb1af0a88bf@linux-foundation.org> <20191101192405.GA866154@chrisdown.name> <20191101122920.798a6d61b2725da8cfe80549@linux-foundation.org> <20191101123544.c9b0024a1e8f5ddf63148b48@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191101123544.c9b0024a1e8f5ddf63148b48@linux-foundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 01, 2019 at 12:35:44PM -0700, Andrew Morton wrote: > On Fri, 1 Nov 2019 12:29:20 -0700 Andrew Morton wrote: > > > > Either change is an upgrade from the current situation, at least. I prefer > > > towards whatever makes the API the least confusing, which appears to be > > > Johannes' original change, but I'd support a patch which always set it to > > > 0 instead if it was deemed safer. > > > > On the other hand.. As I mentioned earlier, if someone's code is > > failing because of the permissions change, they can chmod > > /proc/sys/vm/drop_caches at boot time and be happy. They have no such > > workaround if their software misbehaves due to a read always returning > > "0". > > I lied. I can chmod things in /proc but I can't chmod things in > /proc/sys/vm. Huh, why did we do that? To conserve memory! It was in 2007. For the record I support 0200 on vm.drop_caches. commit 77b14db502cb85a031fe8fde6c85d52f3e0acb63 [PATCH] sysctl: reimplement the sysctl proc support +static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr) +{ + struct inode *inode = dentry->d_inode; + int error; + + if (attr->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID)) + return -EPERM;