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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFxzfCxwYUcRbSyf+U7nr5GPjH4Qfine_TcY6Oxj8WQrWw@mail.gmail.com>
Date:	Tue, 24 Jan 2012 12:20:46 -0800
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Maxim Uvarov <maxim.uvarov@...cle.com>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	wim@...ana.be, stable@...r.kernel.org, Thomas.Mingarelli@...com
Subject: Re: [PATCH] hpwdt: clean up set_memory_x call for 32 bit

So I don't know who is supposed to be handling this (Wim?), but the
patch itself looks suspicious.

On Sun, Jan 15, 2012 at 8:02 PM, Maxim Uvarov <maxim.uvarov@...cle.com> wrote:
> -       set_memory_x((unsigned long)bios32_entrypoint, (2 * PAGE_SIZE));
> +       set_memory_x((unsigned long)bios32_entrypoint & PAGE_MASK, 2);

If it wasn't page-aligned to begin with, then maybe it needs three pages now?

> -                               set_memory_x((unsigned long)cru_rom_addr, cru_length);
> +                               set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK, cru_length >> PAGE_SHIFT);

Same here. If we align the start address down, we should fix up the
length. And should we not align the number of pages up?

In general, a "start/length" conversion to a "page/nr" model needs to be roughly

   len += start & ~PAGE_MASK;
   start &= PAGE_MASK;
   nr_pages = (len + PAGE_SIZE - 1) >> PAGE_SHIFT;

to do things right. But I don't know where those magic numbers come
from. Maybe the "2" is already due to the code possibly traversing a
page boundary, and has already been fixed up. Somebody who knows the
driver and the requirements should take a look at this.

                      Linus
--
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