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]
Date:	Fri, 3 Oct 2008 12:25:52 +0300
From:	"Kirill A. Shutemov" <kirill@...temov.name>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] x86_64: Implement personality ADDR_LIMIT_32BIT

On Fri, Oct 03, 2008 at 10:02:44AM +0200, Ingo Molnar wrote:
> 
> * Kirill A. Shutemov <kirill@...temov.name> wrote:
> 
> > -	/* for MAP_32BIT mappings we force the legact mmap base */
> > -	if (!test_thread_flag(TIF_IA32) && (flags & MAP_32BIT))
> > +	/* for MAP_32BIT mappings and ADDR_LIMIT_32BIT personality we force the
> > +	 * legact mmap base
> > +	 */
> 
> please use the customary multi-line comment style:
> 
>   /*
>    * Comment .....
>    * ...... goes here:
>    */
> 
> and you might use the opportunity to fix the s/legact/legacy typo as 
> well.

Ok, I'll fix it.

> 
> but more generally, we already have ADDR_LIMIT_3GB support on x86.

Does ADDR_LIMIT_3GB really work?

$ cat 1.c
#include <stdio.h>
#include <sys/personality.h>
#include <sys/ipc.h>
#include <sys/shm.h>

#define ADDR_LIMIT_3GB 0x8000000

int main(void)
{
        int id;
        void *shm;

        personality(ADDR_LIMIT_3GB);

        id = shmget(0x123456, 1, IPC_CREAT | 0600);
        shm = shmat(id, NULL, 0);
        printf("shm: %p\n", shm);
        shmdt(shm);

        return 0;
}
$ gcc -Wall 1.c
$ sudo ./a.out 
shm: 0x7f4fca755000

> Why 
> should support for ADDR_LIMIT_32BIT be added?

It's useful for user mode qemu when you try emulate 32-bit target on 
x86_64. For example, if shmat(2) return addres above 32-bit, target will
get SIGSEGV on access to it.

-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.com/

Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ