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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZvGPWaXm26iq-8TI@skv.local>
Date: Mon, 23 Sep 2024 18:55:05 +0300
From: Andrey Skvortsov <andrej.skvortzov@...il.com>
To: Sergey Senozhatsky <senozhatsky@...omium.org>
Cc: Venkat Rao Bagalkote <venkat88@...ux.vnet.ibm.com>,
	Minchan Kim <minchan@...nel.org>, Jens Axboe <axboe@...nel.dk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
	stable@...r.kernel.org
Subject: Re: [PATCH] zram: don't free statically defined names

Hi Sergey,

On 24-09-24 00:47, Sergey Senozhatsky wrote:
> ** Re-sending properly, somehow I managed to badly mess up
>    the headers the first time, sorry ***
> 
> 
> On (24/09/24 00:34), Sergey Senozhatsky wrote:
> > On (24/09/23 11:02), Andrey Skvortsov wrote:
> > >     for (prio = ZRAM_SECONDARY_COMP; prio < ZRAM_MAX_COMPS; prio++) {
> > > -           kfree(zram->comp_algs[prio]);
> > > +           /* Do not free statically defined compression algorithms */
> >
> > We probably don't really need this comment.
> >
> > > +           if (zram->comp_algs[prio] != default_compressor)
> > > +                   kfree(zram->comp_algs[prio]);
> > >             zram->comp_algs[prio] = NULL;
> > >     }
> >
> > OK, so... I wonder how do you get a `default_compressor` on a
> > non-ZRAM_PRIMARY_COMP prio.  May I ask what's your reproducer?
> >
> > I didn't expect `default_compressor` on ZRAM_SECONDARY_COMP
> > and below.  As far as I can tell, we only do this:
> >
> >       comp_algorithm_set(zram, ZRAM_PRIMARY_COMP, default_compressor);
> >
> > in zram_reset_device() and zram_add().  So, how does it end up in
> > ZRAM_SECONDARY_COMP...
> 
> Ugh, I know what's happening.  You don't have CONFIG_ZRAM_MULTI_COMP
> so that ZRAM_PRIMARY_COMP and ZRAM_SECONDARY_COMP are the same thing.
> Yeah, that all makes sense now, I haven't thought about it.

yes, I don't have CONFIG_ZRAM_MULTI_COMP set. I'll include your
comment into commit description for v2.

> Can you please send v2 (with the feedback resolved).

-- 
Best regards,
Andrey Skvortsov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ