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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 50854C10F14 for ; Wed, 10 Apr 2019 22:30:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E44D20820 for ; Wed, 10 Apr 2019 22:30:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726247AbfDJWan (ORCPT ); Wed, 10 Apr 2019 18:30:43 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:42275 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbfDJWan (ORCPT ); Wed, 10 Apr 2019 18:30:43 -0400 Received: by mail-lf1-f65.google.com with SMTP id w23so3025270lfc.9 for ; Wed, 10 Apr 2019 15:30:42 -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=jgFRy3xnUP6NIgxErvxJfk2xMZ8wlFlp/Oi4ioPIets=; b=nr5AYtHazIkzmgJCdk3X4L10/itPuDxNtUeeBzTl3tPaOLKU3YZ455n0o/lXds6GUp LnoePJiZE9xMRspbS6UOZyeVkdqVbY4spqqNNiqej8rFw5Twc8t0y/R7tdwFuOz4zbem X+doImehYeQwEluLHE3pY8Hn64hE6+TPk2VQhic2d5DkPVWgNBaf6qgPfUsjHVP/kRTy 13Pau8JNHWwfEr/ElIvioRFqaXHQMIggnbFoY44jVCZgqPDxht6BZp+p1U93bb81R5BI 56hyWVtme05gz2m7EYa49IK2TieaCL4mF7uMWSvVPbeKfAiXk/+cfKcRbYebmG28S0nu uMvQ== X-Gm-Message-State: APjAAAW7LBX5evdoIzTbMM9nqwiisNqkhvAGffaWhAE2BjfuZMetAtzh NSm067aBDqGDToiPwgZRuIFQVfDh5YTPOakLle63pQ== X-Google-Smtp-Source: APXvYqx6/CJ/NTPyyMHaRFYubdEk8/EbrcDQ7QZfFKYOJ+2bNS0PkdENZCM8QhfNcTykmnEfUoKLbB/+Hy5c2QAnayk= X-Received: by 2002:ac2:4551:: with SMTP id j17mr13958827lfm.141.1554935441257; Wed, 10 Apr 2019 15:30:41 -0700 (PDT) MIME-Version: 1.0 References: <20190408220925.13077-1-mcroce@redhat.com> <20190408220925.13077-3-mcroce@redhat.com> In-Reply-To: From: Matteo Croce Date: Thu, 11 Apr 2019 00:30:05 +0200 Message-ID: Subject: Re: [PATCH 2/2] kernel: use sysctl shared variables for range check To: Kees Cook Cc: Andrew Morton , LKML , "linux-fsdevel@vger.kernel.org" , Luis Chamberlain , Alexey Dobriyan Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Apr 10, 2019 at 11:51 PM Kees Cook wrote: > > On Wed, Apr 10, 2019 at 12:24 PM Matteo Croce wrote: > > > > On Wed, Apr 10, 2019 at 8:46 PM Kees Cook wrote: > > > > > > On Mon, Apr 8, 2019 at 3:09 PM Matteo Croce wrote: > > > > > > > > Use the shared variables for range check, instead of declaring a local one > > > > in every source file. > > > > > > I was expecting this to be a tree-wide change for all the cases found > > > by patch 1's "git grep". > > > > > > > Hi Kees, > > > > I have already the whole patch ready, but I was frightened by the > > output of get_maintainer.pl, so I decided to split the patch into > > small pieces and send the first one. > > Heh, sounds fine. Normally the big tree-wide changes go via Linus just > before cutting rc1 (or rc2). This is "only" 31 source files, though, > so maybe akpm wants to take these instead? Andrew, how do you feel > about that? > FYI, this are the stats from my local repo, just to let you the size of a series with all the changes in it: $ git --no-pager log --stat --oneline linus/master acebb1f752e9 x86: use sysctl shared variables for range check arch/x86/entry/vdso/vdso32-setup.c | 7 ++----- arch/x86/kernel/itmt.c | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) 6731f419f46d s390: use sysctl shared variables for range check arch/s390/appldata/appldata_base.c | 15 +++++---------- arch/s390/kernel/topology.c | 6 ++---- 2 files changed, 7 insertions(+), 14 deletions(-) 1189495100c6 drivers: use sysctl shared variables for range check drivers/base/firmware_loader/fallback_table.c | 11 ++++------- drivers/gpu/drm/i915/i915_perf.c | 8 +++----- drivers/hv/vmbus_drv.c | 6 ++---- drivers/s390/char/sclp_async.c | 7 ++----- drivers/tty/tty_ldisc.c | 6 ++---- drivers/xen/balloon.c | 7 ++----- 6 files changed, 15 insertions(+), 30 deletions(-) bada6ce1f240 ipc: use sysctl shared variables for range check ipc/ipc_sysctl.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) 1faa590d64c5 inotify: use sysctl shared variables for range check fs/notify/inotify/inotify_user.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) ad4254677a52 security: use sysctl shared variables for range check security/keys/sysctl.c | 26 ++++++++++++-------------- security/loadpin/loadpin.c | 6 ++---- security/yama/yama_lsm.c | 3 +-- 3 files changed, 15 insertions(+), 20 deletions(-) 3d2211ab8c7c net: use sysctl shared variables for range check net/core/neighbour.c | 20 ++++++------- net/core/sysctl_net_core.c | 34 ++++++++++------------ net/dccp/sysctl.c | 16 +++++----- net/ipv4/sysctl_net_ipv4.c | 58 ++++++++++++++++++------------------- net/ipv6/addrconf.c | 6 ++-- net/ipv6/route.c | 7 ++--- net/ipv6/sysctl_net_ipv6.c | 8 ++--- net/mpls/af_mpls.c | 10 +++---- net/netfilter/ipvs/ip_vs_ctl.c | 3 +- net/rxrpc/sysctl.c | 9 +++--- net/sctp/sysctl.c | 35 ++++++++++------------ net/sunrpc/xprtrdma/transport.c | 3 +- 12 files changed, 93 insertions(+), 116 deletions(-) f20fd0e406ec kernel: use sysctl shared variables for range check kernel/pid_namespace.c | 3 +- kernel/sysctl.c | 193 ++++++++++++++++++++++----------------------- kernel/ucount.c | 6 +- 3 files changed, 98 insertions(+), 104 deletions(-) 05fc54289d17 proc/sysctl: add shared variables for range check fs/proc/proc_sysctl.c | 5 +++++ include/linux/sysctl.h | 4 ++++ 2 files changed, 9 insertions(+) -- Matteo Croce per aspera ad upstream