lkml.org 
[lkml]   [2022]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -next] [RFC] scsi: ses: fix slab-out-of-bounds in ses_enclosure_data_process
From
Date

> After analysis on vmcore, it was found that the line "desc_ptr[len] =
> '\0';" has slab-out-of-bounds problem in ses_enclosure_data_process.
> In ses_enclosure_data_process, "desc_ptr" point to "buf", so it have
> to be limited in the memory of "buf", however. although there is
> "desc_ptr >= buf + page7_len" judgment, it does not work because
> "desc_ptr + 4 + len" may bigger than "buf + page7_len", which will
> lead to slab-out-of-bounds problem.
>
> Fix it by using judging desc_ptr cross the border or not after
> "desc_ptr += 4".

FWIW, I tested this change and I am still getting KASAN errors from ses.

--
Martin K. Petersen Oracle Linux Engineering

\
 
 \ /
  Last update: 2022-08-02 02:02    [W:0.056 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site