Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3597418ybi; Tue, 2 Jul 2019 10:15:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwX0CM+G6Bpz2vnJAEz3VCzZZE6qBWoPes4w82aBk0DBMKDYTmHzzhiyRcnOtjHA/OXvO6K X-Received: by 2002:a17:902:694a:: with SMTP id k10mr36141931plt.255.1562087701141; Tue, 02 Jul 2019 10:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562087701; cv=none; d=google.com; s=arc-20160816; b=hIdSUwNWiRu33ESrozxborsdzOXDbtGHtlIjDmH5s/zC672BR46vy+gmDS7tWCjKqi 1hOgs2T0cs/TkYkO89itJlN2zWsmZigq4OWMJhUX7YXI2EU7QKbfsq1h/ukwGLTC/K9+ Oq747Pn2R1VKO4XPGDGbl4g5LsmwEWQt3XLUnF27TNAa84IGCkDRRCBeBvpBnTqjQn3v XEgbfWiwFZxoa4U+fPpsMnFgEWfytJuXw2u3s+mlyzg532zs7PqNq4lX2hJbGS+ihhep +NPr6S3jIOpmx4VGEtFpZ+GIRZpxsdnQwmj4geGb9zaOHw5rxAAlff6N029QvVox/QaI ibrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=hJpnw7hCIa1iclA3boS73/qi+CJie1UIDbfpV6vNFsI=; b=vQsLKpsOhbU8x82I1yzjFUL4EGxDjfg+N5GGqzqJaJrXbkQLYWeZPmCMV9lyCv7QP+ 1v+tnWB+IvY+0A+bn5m26LCqCxV52et3x80Zosf6POYBiAeCGcH5pP5Bhd8+TWG+8WRZ SlmMAgDRTcjpvBcnWWLdtU54ncVxiiW7iHqTBvsqF2W02ajqLXDa9fO84Yh5+LGTMjLt 7boxPeMTe5LFt5bRFOs13lGnDfli0lJ4xCH2jIS9Ois8sCoPdEuBKH8l2VtHYEAdXRGW 1FjYjcoJV+XaFLMbwVldzhSOIM5tHFN4/mEIasqCzaXVulJvZj1gijKXwqJZX1IoThlS kePA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=skSNF0YX; 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 l21si12978405pgk.514.2019.07.02.10.14.46; Tue, 02 Jul 2019 10:15:01 -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=skSNF0YX; 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 S1726762AbfGBRMy (ORCPT + 99 others); Tue, 2 Jul 2019 13:12:54 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40803 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726369AbfGBRMx (ORCPT ); Tue, 2 Jul 2019 13:12:53 -0400 Received: by mail-wr1-f68.google.com with SMTP id p11so18735491wre.7 for ; Tue, 02 Jul 2019 10:12:51 -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:mime-version:content-disposition :user-agent; bh=hJpnw7hCIa1iclA3boS73/qi+CJie1UIDbfpV6vNFsI=; b=skSNF0YX1iCPVBjl+LYaZx2phGmvhkrMSY9JoCHRdr0UNp74Xjc8mEYXXMo0CUJi4r KRk2nRStJw7c1HcktbPctgO6qvI61bNqvE3m8s4CsL6XuqP//mQzCmYGww9ocGk996C+ 7rDYf+05cDE+O1X8y7O37MzUtZ/nrYqbXdu07QrQSuIJrMCqnZO7L7ibcpKG1MNNUiYd HxVJTYvLLvU28SDRWL1oBs7BT3oi42UpI4CpNryq/NzhPL0tVEDBbnD7cJm+WupQgWkG pGoDmmRsq/TypsdFd+fPXwqaU+AOKAbGRlt3m0wJcMX90OphWsAsoh55cUkPZzCz2GfL 3yXQ== 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:mime-version :content-disposition:user-agent; bh=hJpnw7hCIa1iclA3boS73/qi+CJie1UIDbfpV6vNFsI=; b=nrqAgO6OzNHSjsZT3RdxJj3LITZUydtFsMwaKOl/gijHMzXaqUCU8lbghIhEi3IF77 SsyujGGwZd2EzTf3E4cBw5VWSJL1AjAEBRzKG0YuKsiwhvsHXfCQabHPxu2nEsQ46WAU zW5fCbr+JtmXC6iQyHdX5cDVtMNwVhgCXN9swBRo98hdVRzZIJ4HLt19fXA8qi9+DUjY 9fPbphII1HMRjoO17V3xvjGfhw+20TJd8YhRFdd9OP3ly/SoWQIZttINJi4Oq1r+8qOt p8jp7asfIbdxlE8BPmaSKKRdiEp7U8mlgMKF1XlDCAA/sY5gukb+LNEVRI1XbrBjoVva pAng== X-Gm-Message-State: APjAAAVvYSSIiqVh1sP0sBjXI6b1zAG5XFAHbfQ3l8AbTeMhNKNB7hah XltXeTglzYY3cvV7lFqLwQ== X-Received: by 2002:adf:e8cb:: with SMTP id k11mr23772529wrn.244.1562087571285; Tue, 02 Jul 2019 10:12:51 -0700 (PDT) Received: from avx2 ([46.53.251.222]) by smtp.gmail.com with ESMTPSA id i188sm4041407wma.27.2019.07.02.10.12.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jul 2019 10:12:50 -0700 (PDT) Date: Tue, 2 Jul 2019 20:12:48 +0300 From: Alexey Dobriyan To: mcroce@redhat.com Cc: linux-kernel@vger.kernel.org, keescook@chromium.org, atomlin@redhat.com, akpm@linux-foundation.org Subject: Re: [PATCH] proc/sysctl: add shared variables for range check Message-ID: <20190702170228.GA4404@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 > -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);