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] [day] [month] [year] [list]
Date:	Tue, 16 Jul 2013 15:55:36 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Parag Warudkar <parag.lkml@...il.com>
Cc:	Josh Triplett <josh@...htriplett.org>,
	LKML <linux-kernel@...r.kernel.org>, linux-acpi@...r.kernel.org
Subject: Re: [PATCH] BGRT: Don't ioremap if image address is in System RAM
 (was: Re: BGRT Pointer in System RAM)

On Tue, Jul 16, 2013 at 3:15 PM, Parag Warudkar <parag.lkml@...il.com> wrote:
> On Mon, Jul 15, 2013 at 8:00 PM, Parag Warudkar <parag.lkml@...il.com> wrote:
>> On Mon, Jul 15, 2013 at 7:56 PM, Parag Warudkar <parag.lkml@...il.com> wrote:
>>> On Mon, Jul 15, 2013 at 7:04 PM, Josh Triplett <josh@...htriplett.org> wrote:
>>>
>>>> We do need to handle the case of a valid pointer into memory that e820
>>>> calls system RAM, as well as the case of a valid pointer into memory
>>>> reserved for the BIOS or similar, but not the case of an invalid
>>>> pointer.
>>>
>>> Would that be as simple as
>>>
>>>                      page_is_ram(
>>
>> Damn shortcuts -
>>                         virt_addr = phys_to_virt(image->base_address);
>>                         if(page_is_ram(virt_to_page(virt_addr))) {
>>                             //direct read from virt addr
>>                         }
>>
>> Would that suffice for the System RAM case or some other MM trickery
>> is involved?
>
> Ok, so I played around with it a bit and the following patch works
> fine on my system. (I.E. image size is reasonable, cat
> /sys/firmware/acpi/bgrt/image > img.bmp generates a valid,
> non-distorted bitmap, which it did before too, btw as despite of the
> ioremap WARN_ON the ioremap seems to succeed if !(is_ram &&
> pfn_valid(pfn) && !PageReserved.)
>

How reliable is this?  That is, is there any guarantee that nothing
will have overwritten the image in memory before this code runs?

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ