lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 30 Apr 2019 11:08:22 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Matteo Croce <mcroce@...hat.com>
Cc:     Matthew Wilcox <willy@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v4] proc/sysctl: add shared variables for range check

On Tue, Apr 30, 2019 at 9:30 AM Matteo Croce <mcroce@...hat.com> wrote:
>
> On Tue, Apr 30, 2019 at 6:08 PM Matthew Wilcox <willy@...radead.org> wrote:
> >
> > 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@...hat.com> wrote:
> > > > On Tue, Apr 30, 2019 at 12:26 AM Matteo Croce <mcroce@...hat.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);
>
> Indeed. I followed the same code path until I found this:
>
>  167                        ipvs->drop_rate = 0;
>  168                        ipvs->sysctl_drop_packet = 1;
>
> so I think that this can't be done like this.

Ah, dang. Yeah, I missed that too.

> Mind if I send a v5 without the const qualifier? At least to know the
> kbuildbot opinion.

Yeah, I think that's likely best.

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ