Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4747193yba; Tue, 30 Apr 2019 03:49:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyssu4DLPFfuRCvv2+zDGPRWrObnl+MrTLyAFle5hpFZxrH4qI+9LPI7AldUmrrnQLw2mD X-Received: by 2002:a17:902:b602:: with SMTP id b2mr68902006pls.293.1556621398949; Tue, 30 Apr 2019 03:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556621398; cv=none; d=google.com; s=arc-20160816; b=O77IF6gASf05KyMYlDq6FiFYNMTacFbeu+xQgAPhDV6LlUQbcFPAnufShmcHhRm65W CPJcJHJdjQnGSjFxE7S+AB6FODXUu0NjpdUGVXerEQB6HTUc9VWGWIlPM6mi9r9I01Jf fwYwMPX2TzM2/yodLq7TsN0xzfgNnpVn9NkQ7NoTXh1jFuAs78sR1nquHno3Al3/YT3n XepcZVShlQRo5ydRiOZc0ddl4Oioz8SGhux7aEOnO57wBHnUw3adSTBbVjAG4g9QFFrU ej8eJQa2HOugR0Wbcqb7ue6O4W0Am7DyGB0CRrJfhqjarIDFOb3s5U7AfAlz1YLLmU4n rj8A== 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=VmpVtnJXoZD7hpcFvy3KfMWpWjz8E7iIMZMr/p/hx08=; b=pBSQDROrKkFaHMSyyHg6HRjlX/iOa1VUfFR6urj2hVjBmG45V9tHeMW0UvJiHkUIzK 4cOb559fqwyE0RttDi/+dPDPrMcJ1QELSvOVE6oMmQNdiIp+w5hAdWiPYiyjU+u/adX3 X0xAd+EK2ytsLs2wmlJ0u25ClYV5YNs94HlTNdjWzk5xQ5MXw9g4kItwKeGQ+YgFBBQb Jk/5cdpXPxjlUurvSq/ppkSgTRIJyTldy58dsOJW2ds6+s4rMKN0UXFT9YGVOBK3DHst Bxp7SBcEnpS0DnJOai8+oqs9X+SReFH4RYoicdSIv85FyvXEFmckqJra8HWtaEnEbMnR KHTg== 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 h63si34964886pgc.404.2019.04.30.03.49.42; Tue, 30 Apr 2019 03:49:58 -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 S1727284AbfD3KrL (ORCPT + 99 others); Tue, 30 Apr 2019 06:47:11 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:44969 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbfD3KrK (ORCPT ); Tue, 30 Apr 2019 06:47:10 -0400 Received: by mail-lf1-f68.google.com with SMTP id h18so10315545lfj.11 for ; Tue, 30 Apr 2019 03:47:09 -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=VmpVtnJXoZD7hpcFvy3KfMWpWjz8E7iIMZMr/p/hx08=; b=Mzsigt0Iay9a1zb9TTpjkIZGvp44KL5sd4n3bRpVTXs+YFe5oxFZKqLrFBq5Ra5Etj Z+WCSxLm1WWRD4B7opQN2po8AX5JkGNNQgyJs7SQibqzIgxuEJvGEJl9xzj6hjZjmkxh bP+Khy4pRmJ2HK+e8A/sNg/XFgZQpL9Fk12eXq+wzrtIBVHGobfsGXGkmePJIixpx5TM TSdL7cIB8FrWX8C+naV+yI354mdLIJnCc4au81gAopTghmzzk4nkZ9Qcrgf03nFp2YaM I6mCH4c5tEMdp/GOXLLnvXjmOwq6eZTLEUFoBt3VoCVEkfG3pTZKCy6ToPhl+wwrGXwJ yQFg== X-Gm-Message-State: APjAAAWSnR6ZzKFkpBJfxU5rXVa3EWKszyhgexDSeLSLTMmFWOaQsZeY H4ISwjmDxE75jSiQSl5Xa7jK5jGP+XOMZDumczcoVTA/ X-Received: by 2002:a19:a417:: with SMTP id q23mr34990275lfc.110.1556621228264; Tue, 30 Apr 2019 03:47:08 -0700 (PDT) MIME-Version: 1.0 References: <20190429222613.13345-1-mcroce@redhat.com> In-Reply-To: <20190429222613.13345-1-mcroce@redhat.com> From: Matteo Croce Date: Tue, 30 Apr 2019 12:46:31 +0200 Message-ID: Subject: Re: [PATCH v4] proc/sysctl: add shared variables for range check To: LKML , linux-fsdevel@vger.kernel.org, Andrew Morton Cc: Kees Cook , Matthew Wilcox 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, Apr 30, 2019 at 12:26 AM Matteo Croce wrote: > > Add a const int array containing the most commonly used values, > some macros to refer more easily to the correct array member, > and use them instead of creating a local one for every object file. > Ok it seems that this simply can't be done, because there are at least two points where extra1,2 are set to a non const struct: in ip_vs_control_net_init_sysctl() it's assigned to struct netns_ipvs, while in mpls_dev_sysctl_register() it's assigned to a struct mpls_dev and a struct net. So, sadly making extra1,2 const is a no-go :( Andrew, I'm thinking to add the "sad and lame" cast in the macro, to have a single point where hide it Regards, -- Matteo Croce per aspera ad upstream