Re: [PATCH] zram: validate decompressed page size
From: Sergey Senozhatsky
Date: Thu Nov 26 2026 - 20:19:24 EST
On (26/11/26 18:44), Artem Novak wrote:
[..]
> @@ -185,6 +185,8 @@ int zcomp_decompress(struct zcomp *comp, struct zcomp_strm *zstrm,
> ret = comp->ops->decompress(comp->params, &zstrm->ctx, &req);
> if (src)
> kunmap_local(src);
> + if (!ret && req.dst_len != PAGE_SIZE)
> + ret = -EINVAL;
> return ret;
> }
Yeah, I don't think we should do this. We only ever compress PAGE_SIZE
buffers, if some backend decompresses it to a something that is not
PAGE_SIZE and doesn't signal an error via "ret" then it's a bug in the
backend and zram should not cover it up.