Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3606411ybi; Tue, 2 Jul 2019 10:22:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqySUHfzvL18dSx2JVStwSxVlWtL5VtLfOFJ7ekRp6KBkegRHYti2VEY10Bi4tVkD4Pfn76M X-Received: by 2002:a17:902:8548:: with SMTP id d8mr28266273plo.100.1562088170666; Tue, 02 Jul 2019 10:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562088170; cv=none; d=google.com; s=arc-20160816; b=W9VZSZPNx3Ck9sNcrqB2BK5tBEW7pZjwDBKSThq8qKkQ0EIn2zmwEE42g/C1CNaUWk EtgWYKQ9lqxK/AifqiLEphC01cZckO80+DXql0OCeB8cd2K+ZZaoUDcLrfaKIe5ylT3r mrK2pln3mw34NeIhTQos8FVGu6AuGu1Jd6wXdLubjuOBeH9G8n4OItRmYUfA6TUstZoa leeDNK26yDYPT+1B6B+pmUjVbuCQHQuUkOj6p65uOpPGSvQUe2jyWjdshDN8Tw0Jn2RX TQcNgXAEzCUoWZJkayXITKTheK6ixvc7eIZcX59w+nlFGeVuRLQoCX4ItcOcxpTb/CxF 52Aw== 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; bh=gvnDOFwx6G7d+yAjk4B98e8llL7nNglDsAedEdiJxn8=; b=KlrB+HeiBMqatYYEYxE7Q1wDtgZNNTpO0rdZooOZT9RlyP1W3gIjfTeQPY+qcwimkd zr7umZwWOV5ljR8lKgYozR5XIsPuL0Ba8Yd0y0AppPx7EMbwt0Wa/AXigPKL9w9bcFPF 7DkEGZX3Q/gNCQSGtcQurw1c1HYKJe44YAngRhyOeCsG88Vb7jk/bNH5U1I3TU6oso2K 9sM+voyD6cKrzWs3K0l+HfoYyyQ1HY250+NJLYDdDgfLkXNyd20xbMVbMK4Kft/2V54B zYzDQ+Y3m1lXkGe6FvXPG5v0tu1DiWHoZ0B2gcXpYRnfl8lxP16hYDXnv8TxVeo62IVf Jd8A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4si14129677pfi.34.2019.07.02.10.22.33; Tue, 02 Jul 2019 10:22:50 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726457AbfGBRWM (ORCPT + 99 others); Tue, 2 Jul 2019 13:22:12 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:36577 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfGBRWM (ORCPT ); Tue, 2 Jul 2019 13:22:12 -0400 Received: by mail-lf1-f68.google.com with SMTP id q26so11996500lfc.3 for ; Tue, 02 Jul 2019 10:22:10 -0700 (PDT) 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=gvnDOFwx6G7d+yAjk4B98e8llL7nNglDsAedEdiJxn8=; b=s3pCEKVbe33vUaxqf1Z4S0zG+PHeCnDsJLTuriwoIGW9YQm951Z68+IqvGZHOl/LWo 6ZUsc/7gj5H7nyyy7kt5mkEEN+jmwAvbP8zYV8BMpgpT7WTfppn1Cfbn5dGckLOcG8fE vS5Q2Fr89x9N6qiSk+rY+xaRmrdfmx/DsglBv4nkw3MLXGtdLsQIAElWJ2zFNhran3rx wR4ezgrS6t//Os2bSY34No1k07XiG7FNtj8wfWqEk7MW5TCuqn2LCPDIqk1CGbacZCi3 wzUcViGJ56VuBIIAXMWagVaN76Z1mLhQt3ZVym48D/b7GfcTgLhzzL6g4FLDVmorZIqP J6Fw== X-Gm-Message-State: APjAAAWsB5qR0SiXYUPYo+RKq+VCIfCjp6md/vwQVcA9O+j4lbkXDJ0l p55zAQ8u4UOntvSEV0hvr9jjObp623P5VhLlOX5Yxw== X-Received: by 2002:a19:48c5:: with SMTP id v188mr803228lfa.69.1562088130005; Tue, 02 Jul 2019 10:22:10 -0700 (PDT) MIME-Version: 1.0 References: <20190702170228.GA4404@avx2> In-Reply-To: <20190702170228.GA4404@avx2> From: Matteo Croce Date: Tue, 2 Jul 2019 19:21:33 +0200 Message-ID: Subject: Re: [PATCH] proc/sysctl: add shared variables for range check To: Alexey Dobriyan Cc: LKML , Kees Cook , Aaron Tomlin , Andrew Morton 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 Tue, Jul 2, 2019 at 7:13 PM Alexey Dobriyan wrote: > > > -static long zero; > > static long long_max = LONG_MAX; > > > > struct ctl_table epoll_table[] = { > > @@ -301,7 +300,7 @@ struct ctl_table epoll_table[] = { > > .maxlen = sizeof(max_user_watches), > > .mode = 0644, > > .proc_handler = proc_doulongvec_minmax, > > - .extra1 = &zero, > > + .extra1 = SYSCTL_ZERO, > > .extra2 = &long_max, > > This looks wrong: proc_doulongvec_minmax() expects "long"s. > The whole patch needs rechecking. > > > +/* shared constants to be used in various sysctls */ > > +const =======>int<========== sysctl_vals[] = { 0, 1, INT_MAX }; > > +EXPORT_SYMBOL(sysctl_vals); Yes, you're right, that chunk must be dropped. Anyway I've checked the patch, this was the only long field touched. Regards, -- Matteo Croce per aspera ad upstream