lkml.org 
[lkml]   [2021]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH V2] iscsi_ibft: fix crash due to KASLR physical memory remapping
Hi Mike,

st 28. 7. 2021 v 8:05 odesílatel Mike Rapoport <rppt@kernel.org> napsal:
>
> Hi,
>
> On Tue, Jul 27, 2021 at 01:14:46PM +0200, Maurizio Lombardi wrote:
> > Starting with commit a799c2bd29d19c565f37fa038b31a0a1d44d0e4d
> > memory reservations have been moved earlier during the boot process,
> > before the execution of the Kernel Address Space Layout Randomization code.
> >
> > setup_arch() calls the iscsi_ibft's find_ibft_region() function
> > to find and reserve the memory dedicated to the iBFT; this function
> > also saves a (virt) pointer to the iBFT table for later use.
>
> ^ virtual
>
> > The problem is that if KALSR is active, the physical memory gets
> > remapped somewhere else in the virtual address space and the pointer is
> > no longer valid, this will cause a kernel panic when the iscsi driver tries
> > to dereference it.
>
> Please drop "this patch" and use imperative language, e.g. "Fix this bug
> by..."
>
> > This patch fixes the bug by saving the address of the physical location
> > of the ibft; later the driver will use isa_bus_to_virt() to get
> > the correct virtual address.
> >
> > It will also simplify the code by renaming find_ibft_region()
> > to reserve_ibft_region() and removing all the wrappers.
> >
> > [ 37.764225] iBFT detected.
>
> It is better to put the crash report close to the problem description as it
> actually shows how the issue is manifested.

Thanks for the review, I will submit a V3 soon

Maurizio

\
 
 \ /
  Last update: 2021-07-28 11:40    [W:0.067 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site