lkml.org 
[lkml]   [2022]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Coverity: zram_recompress(): OVERRUN
On Fri, Nov 11, 2022 at 09:26:31AM +0900, Sergey Senozhatsky wrote:
> On (22/11/10 08:47), coverity-bot wrote:
> > *** CID 1527270: (OVERRUN)
> > drivers/block/zram/zram_drv.c:1727 in zram_recompress()
> > 1721 zstrm = zcomp_stream_get(zram->comps[prio]);
> > 1722 src = kmap_atomic(page);
> > 1723 ret = zcomp_compress(zstrm, src, &comp_len_new);
> > 1724 kunmap_atomic(src);
> > 1725
> > 1726 if (ret) {
> > vvv CID 1527270: (OVERRUN)
> > vvv Overrunning array "zram->comps" of 4 8-byte elements at element index 4 (byte offset 39) using index "prio" (which evaluates to 4).
>
> Hmm... I don't really see how prio can evaluate to 4.

Yeah, I agree. This looks like a false positive. I'm not sure why
Coverity triggered for it. Looking at the extended report, it seems to
not have any idea that prio_max is correctly bounded.

Sorry for the noise!

--
Kees Cook

\
 
 \ /
  Last update: 2022-11-11 04:15    [W:0.079 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site