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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5bd3761f-217d-45bb-bcd2-797f82c8a44f@suse.cz>
Date: Mon, 19 Feb 2024 10:17:33 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Suren Baghdasaryan <surenb@...gle.com>
Cc: akpm@...ux-foundation.org, kent.overstreet@...ux.dev, mhocko@...e.com,
 hannes@...xchg.org, roman.gushchin@...ux.dev, mgorman@...e.de,
 dave@...olabs.net, willy@...radead.org, liam.howlett@...cle.com,
 corbet@....net, void@...ifault.com, peterz@...radead.org,
 juri.lelli@...hat.com, catalin.marinas@....com, will@...nel.org,
 arnd@...db.de, tglx@...utronix.de, mingo@...hat.com,
 dave.hansen@...ux.intel.com, x86@...nel.org, peterx@...hat.com,
 david@...hat.com, axboe@...nel.dk, mcgrof@...nel.org, masahiroy@...nel.org,
 nathan@...nel.org, dennis@...nel.org, tj@...nel.org, muchun.song@...ux.dev,
 rppt@...nel.org, paulmck@...nel.org, pasha.tatashin@...een.com,
 yosryahmed@...gle.com, yuzhao@...gle.com, dhowells@...hat.com,
 hughd@...gle.com, andreyknvl@...il.com, keescook@...omium.org,
 ndesaulniers@...gle.com, vvvvvv@...gle.com, gregkh@...uxfoundation.org,
 ebiggers@...gle.com, ytcoode@...il.com, vincent.guittot@...aro.org,
 dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
 bristot@...hat.com, vschneid@...hat.com, cl@...ux.com, penberg@...nel.org,
 iamjoonsoo.kim@....com, 42.hyeyoo@...il.com, glider@...gle.com,
 elver@...gle.com, dvyukov@...gle.com, shakeelb@...gle.com,
 songmuchun@...edance.com, jbaron@...mai.com, rientjes@...gle.com,
 minchan@...gle.com, kaleshsingh@...gle.com, kernel-team@...roid.com,
 linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
 iommu@...ts.linux.dev, linux-arch@...r.kernel.org,
 linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
 linux-modules@...r.kernel.org, kasan-dev@...glegroups.com,
 cgroups@...r.kernel.org
Subject: Re: [PATCH v3 32/35] codetag: debug: skip objext checking when it's
 for objext itself

On 2/19/24 02:04, Suren Baghdasaryan wrote:
> On Fri, Feb 16, 2024 at 6:39 PM Vlastimil Babka <vbabka@...e.cz> wrote:
>>
>> On 2/12/24 22:39, Suren Baghdasaryan wrote:
>> > objext objects are created with __GFP_NO_OBJ_EXT flag and therefore have
>> > no corresponding objext themselves (otherwise we would get an infinite
>> > recursion). When freeing these objects their codetag will be empty and
>> > when CONFIG_MEM_ALLOC_PROFILING_DEBUG is enabled this will lead to false
>> > warnings. Introduce CODETAG_EMPTY special codetag value to mark
>> > allocations which intentionally lack codetag to avoid these warnings.
>> > Set objext codetags to CODETAG_EMPTY before freeing to indicate that
>> > the codetag is expected to be empty.
>> >
>> > Signed-off-by: Suren Baghdasaryan <surenb@...gle.com>
>> > ---
>> >  include/linux/alloc_tag.h | 26 ++++++++++++++++++++++++++
>> >  mm/slab.h                 | 25 +++++++++++++++++++++++++
>> >  mm/slab_common.c          |  1 +
>> >  mm/slub.c                 |  8 ++++++++
>> >  4 files changed, 60 insertions(+)
>> >
>> > diff --git a/include/linux/alloc_tag.h b/include/linux/alloc_tag.h
>> > index 0a5973c4ad77..1f3207097b03 100644
>>
>> ...
>>
>> > index c4bd0d5348cb..cf332a839bf4 100644
>> > --- a/mm/slab.h
>> > +++ b/mm/slab.h
>> > @@ -567,6 +567,31 @@ static inline struct slabobj_ext *slab_obj_exts(struct slab *slab)
>> >  int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s,
>> >                       gfp_t gfp, bool new_slab);
>> >
>> > +
>> > +#ifdef CONFIG_MEM_ALLOC_PROFILING_DEBUG
>> > +
>> > +static inline void mark_objexts_empty(struct slabobj_ext *obj_exts)
>> > +{
>> > +     struct slabobj_ext *slab_exts;
>> > +     struct slab *obj_exts_slab;
>> > +
>> > +     obj_exts_slab = virt_to_slab(obj_exts);
>> > +     slab_exts = slab_obj_exts(obj_exts_slab);
>> > +     if (slab_exts) {
>> > +             unsigned int offs = obj_to_index(obj_exts_slab->slab_cache,
>> > +                                              obj_exts_slab, obj_exts);
>> > +             /* codetag should be NULL */
>> > +             WARN_ON(slab_exts[offs].ref.ct);
>> > +             set_codetag_empty(&slab_exts[offs].ref);
>> > +     }
>> > +}
>> > +
>> > +#else /* CONFIG_MEM_ALLOC_PROFILING_DEBUG */
>> > +
>> > +static inline void mark_objexts_empty(struct slabobj_ext *obj_exts) {}
>> > +
>> > +#endif /* CONFIG_MEM_ALLOC_PROFILING_DEBUG */
>> > +
>>
>> I assume with alloc_slab_obj_exts() moved to slub.c, mark_objexts_empty()
>> could move there too.
> 
> No, I think mark_objexts_empty() belongs here. This patch introduced
> the function and uses it. Makes sense to me to keep it all together.

Hi,

here I didn't mean moving between patches, but files. alloc_slab_obj_exts()
in slub.c means all callers of mark_objexts_empty() are in slub.c so it
doesn't need to be in slab.h

Also same thing with mark_failed_objexts_alloc() and
handle_failed_objexts_alloc() in patch 34/35.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ