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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 27 Apr 2022 14:22:32 +0200
From:   Michal Koutný <>
To:     Shakeel Butt <>
Cc:     Vasily Averin <>, Vlastimil Babka <>,
        Roman Gushchin <>,,
        Florian Westphal <>,
        LKML <>,
        Michal Hocko <>,
        Cgroups <>,
        netdev <>,
        "David S. Miller" <>,
        Jakub Kicinski <>,
        Paolo Abeni <>
Subject: Re: [PATCH memcg v4] net: set proper memcg for net_init hooks

On Tue, Apr 26, 2022 at 10:23:32PM -0700, Shakeel Butt <> wrote:
> [...]
> >
> > +static inline struct mem_cgroup *get_mem_cgroup_from_obj(void *p)
> > +{
> > +       struct mem_cgroup *memcg;
> > +
> Do we need memcg_kmem_enabled() check here or maybe
> mem_cgroup_from_obj() should be doing memcg_kmem_enabled() instead of
> mem_cgroup_disabled() as we can have "cgroup.memory=nokmem" boot
> param.

I reckon such a guard is on the charge side and readers should treat
NULL and root_mem_group equally. Or is there a case when these two are

(I can see it's different semantics when stored in current->active_memcg
(and active_memcg() getter) but for such "outer" callers like here it
seems equal.)


Powered by blists - more mailing lists