Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10065143imu; Wed, 5 Dec 2018 15:32:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/WOsq+PAyOx4mp7NW5dQrSQJipldtF7g1G6O0l1+7DURdPoKs01aUv6YgKhESvuVQL6U0eM X-Received: by 2002:a17:902:42e4:: with SMTP id h91mr26597179pld.18.1544052751589; Wed, 05 Dec 2018 15:32:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544052751; cv=none; d=google.com; s=arc-20160816; b=a4CSO1Y3VWzovdYM8L0OBuZjlg9woH6v04uVhOoxCcpBIPnzSo+feSSZfygKW9z9eV ZO5pEaJHuL6DjK0Aaf/NNFHtiie9XJ5bKlCrR4t3+j9Lfkw2q+qZHn+CG8vpAQAfRMKf s6K3LfCMgGiHPo6PVd1YR7Rligz2WFWsQydJzIR9jDaZigfSnHVzddc9qZOCHrwphbl8 Js6y2kB0FeFfNCl8uaVkmjQXVLL35AOyIOymYXy8GtAkaketibRORqhZnHADVnbSHXmZ +7B4ZcvZ7BZn2uX4JTErH0l5BN4/R0MwFbAf6orFHnG1jkixTQNKxtklwLuPIOt5//gx b7Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jWBMd7ioReXxeA3Hvcp5KwsvSijs7NahEDw+ApUV5tk=; b=dWkB2+oWKj8dYL4QDxk+8HqdawFxIt77Xl8pUy8qWtULYDiZX4KLNkckZ9a8JCxI28 i1JrZrdBSeAQlYinEdbGyNBaO89fJjgitNRFDc/MQSEI2m4/GgMqWsPc4EHogjpELzEM 0BPo/vtt5IsW/eBewNg6LjMye3gigOXJzBup6KTRYNP+gA+9fmEquqxpa7iaGCE0vXJA QvThPmaMPdxxKVOs9NRURN0vhckn/MovlZnMTA6bWCcq6G6xhe8ZH2tZr6WxKjK5QXEE fnYWTxpSC7EUIK2zmOY7TUl3s/i0JBk9yj4bUD7ZrLBqZXSIMRoXgkDpF1Ip1m+ZopXP ZoXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KfM172NH; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f186si22586365pfb.67.2018.12.05.15.32.16; Wed, 05 Dec 2018 15:32:31 -0800 (PST) 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=@chromium.org header.s=google header.b=KfM172NH; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728731AbeLEXbF (ORCPT + 99 others); Wed, 5 Dec 2018 18:31:05 -0500 Received: from mail-yb1-f196.google.com ([209.85.219.196]:39496 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727337AbeLEXbE (ORCPT ); Wed, 5 Dec 2018 18:31:04 -0500 Received: by mail-yb1-f196.google.com with SMTP id s15so1148692ybk.6 for ; Wed, 05 Dec 2018 15:31:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jWBMd7ioReXxeA3Hvcp5KwsvSijs7NahEDw+ApUV5tk=; b=KfM172NHyWJ6CycMcxjr1TVJ2Yq4Y48bf8SFUCu+vsv7g4V4eLGp1HapErB8/fq1/M 54TxQyJVHknxIAJIE1F+QhH7PUBYALV5zyP8vCVFLkekIeiHNEgdpTLa8G5X93JsSgbC ps3fR4I272ZnZWS/glm4WNJqpVuLnfWEXt/s0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jWBMd7ioReXxeA3Hvcp5KwsvSijs7NahEDw+ApUV5tk=; b=dXWoeGcuZkythesfRlAjOh/aApE78h7Kp/4D6G6ZY1odcwixKq0lHZ98223Ii7DR5j EFxYzVN/9GIqn5We0Tl/P0oYGcPPapIq2FxfIEjbLvrgrjVb+dsKF0y8yL45TUYykMS1 njrz5PdXRt1kinIsjFbvQruM8S5MsT1MlbNgnn4w93F9u1pVqMoid2TpBTO0yzDj9o73 ZVLUK0mjhqH6lAn0We0r/HQ469762Cbx4RHeCEkXAJTy/IFcGvmcJQi8BReva4fhMmlw /jUMx1KnhV0k/sU1UCHKjeeXWu5DUioPR2usTvyxl+unxIoCc0xhmgE6pGu0sZr1PGzO ywhA== X-Gm-Message-State: AA+aEWZpc+8Zzt/2UgBR1aAkg+DY86uhf1t/zHc8q5kAvK4OS3lPd7+h EwzKDGrgZIzHo4B2QvQXV2AOGkqOOuo= X-Received: by 2002:a0d:e0c5:: with SMTP id j188mr27317201ywe.164.1544052663309; Wed, 05 Dec 2018 15:31:03 -0800 (PST) Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com. [209.85.219.169]) by smtp.gmail.com with ESMTPSA id p71sm2607591ywg.98.2018.12.05.15.31.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 15:31:01 -0800 (PST) Received: by mail-yb1-f169.google.com with SMTP id w203so5823443ybg.3 for ; Wed, 05 Dec 2018 15:31:01 -0800 (PST) X-Received: by 2002:a25:2347:: with SMTP id j68mr17002397ybj.137.1544052660676; Wed, 05 Dec 2018 15:31:00 -0800 (PST) MIME-Version: 1.0 References: <20181130191456.GX18410@garbanzo.do-not-panic.com> <201812031312398404610@zte.com.cn> <20181203201436.GO28501@garbanzo.do-not-panic.com> In-Reply-To: <20181203201436.GO28501@garbanzo.do-not-panic.com> From: Kees Cook Date: Wed, 5 Dec 2018 15:30:48 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Re: [PATCH] proc/sysctl: fix return error for proc_doulongvec_minmax To: "Luis R. Rodriguez" , cheng.lin130@zte.com.cn Cc: Andrew Morton , "Eric W. Biederman" , LKML , "linux-fsdevel@vger.kernel.org" , zhong.weidong@zte.com.cn, wang.yi59@zte.com.cn, Michael Kerrisk Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 3, 2018 at 12:14 PM Luis Chamberlain wrote: > Since this worked before I do agree that we need to keep it working now, > and I can't think of an issue with returning 0 now. Since this is about > semantics though I'd like a bit more review from at last one more > person. > > Kees, Eric, Andrew? This is a weird one: it would return an error _AND_ still perform the write. :( I think this patch is right, and I struggle to imagine a case where removing the failure is a problem. A quick question, though, do we want to instead do the reverse? (Not update, and keep the error?) Are there any examples of doing partial writes like this in real software? The proposed change is the safest change, though... -- Kees Cook