linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Kees Cook <keescook@chromium.org>
Cc: Matteo Croce <mcroce@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v4] proc/sysctl: add shared variables for range check
Date: Tue, 30 Apr 2019 09:08:13 -0700	[thread overview]
Message-ID: <20190430160813.GI13796@bombadil.infradead.org> (raw)
In-Reply-To: <CAGXu5j+qejH0c9fG=TwmSyK0FkaiNidgqYZrqgKPf4D_=u2k8A@mail.gmail.com>

On Tue, Apr 30, 2019 at 08:42:42AM -0700, Kees Cook wrote:
> On Tue, Apr 30, 2019 at 3:47 AM Matteo Croce <mcroce@redhat.com> wrote:
> > On Tue, Apr 30, 2019 at 12:26 AM Matteo Croce <mcroce@redhat.com> 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.
> 
> Why can't these be converted to const also? I don't see the pointer
> changing anywhere. They're created in one place and never changed.

That's not true; I thought the same thing, but you need to see how
they're used in the functions they're called.

proc_do_defense_mode(struct ctl_table *table, int write,
        struct netns_ipvs *ipvs = table->extra2;
                        update_defense_level(ipvs);
static void update_defense_level(struct netns_ipvs *ipvs)
        spin_lock(&ipvs->dropentry_lock);

  reply	other threads:[~2019-04-30 16:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 22:26 [PATCH v4] proc/sysctl: add shared variables for range check Matteo Croce
2019-04-29 23:44 ` kbuild test robot
2019-04-29 23:59 ` kbuild test robot
2019-04-30 10:46 ` Matteo Croce
2019-04-30 15:42   ` Kees Cook
2019-04-30 16:08     ` Matthew Wilcox [this message]
2019-04-30 16:29       ` Matteo Croce
2019-04-30 18:08         ` Kees Cook
2019-04-30 13:17 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190430160813.GI13796@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcroce@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).