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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090917152227.GA8817@lenovo>
Date:	Thu, 17 Sep 2009 19:22:27 +0400
From:	Cyrill Gorcunov <gorcunov@...il.com>
To:	Tim Abbott <tabbott@...lice.com>
Cc:	x86@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
	Sam Ravnborg <sam@...nborg.org>,
	Anders Kaseorg <andersk@...lice.com>
Subject: Re: [PATCH v3 1/5] x86: fix fragile computation of vsyscall address

[Tim Abbott - Wed, Sep 16, 2009 at 04:44:26PM -0400]
|
| From: Anders Kaseorg <andersk@...lice.com>
| 
| Previously, the address of the vsyscall page (VSYSCALL_PHYS_ADDR,
| VSYSCALL_VIRT_ADDR) was computed by arithmetic on the address of the
| last section.  This leads to bugs when new sections are inserted, such
| as the one fixed by commit d312ceda567ab91acd756cde95ac5fbc6b40ed40.
| Let's compute it from the current address instead.
| 
| Signed-off-by: Anders Kaseorg <andersk@...lice.com>
| ---
|  arch/x86/kernel/vmlinux.lds.S |   19 +++++++------------
|  1 files changed, 7 insertions(+), 12 deletions(-)
| 
| diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
| index 0ccb57d..b96ca47 100644
| --- a/arch/x86/kernel/vmlinux.lds.S
| +++ b/arch/x86/kernel/vmlinux.lds.S
| @@ -135,24 +135,21 @@ SECTIONS
|  #ifdef CONFIG_X86_64
|  
|  #define VSYSCALL_ADDR (-10*1024*1024)
| -#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data) + SIZEOF(.data) + \
| -                            PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
| -#define VSYSCALL_VIRT_ADDR ((ADDR(.data) + SIZEOF(.data) + \
| -                            PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
|  
| -#define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR)
| +#define VLOAD_OFFSET (VSYSCALL_ADDR - __vsyscall_0 + LOAD_OFFSET)
|  #define VLOAD(x) (ADDR(x) - VLOAD_OFFSET)
|  
| -#define VVIRT_OFFSET (VSYSCALL_ADDR - VSYSCALL_VIRT_ADDR)
| +#define VVIRT_OFFSET (VSYSCALL_ADDR - __vsyscall_0)
|  #define VVIRT(x) (ADDR(x) - VVIRT_OFFSET)
|  
| +	. = ALIGN(4096);

Hi Tim, it seems there should be PAGE_SIZE, or I miss something?
(great work btw!)

| +	__vsyscall_0 = .;
| +
...

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