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: <20130523143229.GF2779@redhat.com>
Date:	Thu, 23 May 2013 10:32:29 -0400
From:	Vivek Goyal <vgoyal@...hat.com>
To:	HATAYAMA Daisuke <d.hatayama@...fujitsu.com>
Cc:	ebiederm@...ssion.com, akpm@...ux-foundation.org, cpw@....com,
	kumagai-atsushi@....nes.nec.co.jp, lisa.mitchell@...com,
	kexec@...ts.infradead.org, linux-kernel@...r.kernel.org,
	zhangyanfei@...fujitsu.com, jingbai.ma@...com, linux-mm@...ck.org,
	riel@...hat.com, walken@...gle.com, hughd@...gle.com,
	kosaki.motohiro@...fujitsu.com
Subject: Re: [PATCH v8 7/9] vmcore: Allow user process to remap ELF note
 segment buffer

On Thu, May 23, 2013 at 02:25:36PM +0900, HATAYAMA Daisuke wrote:
> Now ELF note segment has been copied in the buffer on vmalloc
> memory. To allow user process to remap the ELF note segment buffer
> with remap_vmalloc_page, the corresponding VM area object has to have
> VM_USERMAP flag set.
> 
> Signed-off-by: HATAYAMA Daisuke <d.hatayama@...fujitsu.com>

Looks good to me.

Acked-by: Vivek Goyal <vgoyal@...hat.com>

Vivek

> ---
> 
>  fs/proc/vmcore.c |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
> index 937709d..9de4d91 100644
> --- a/fs/proc/vmcore.c
> +++ b/fs/proc/vmcore.c
> @@ -375,6 +375,7 @@ static int __init merge_note_headers_elf64(char *elfptr, size_t *elfsz,
>  	Elf64_Ehdr *ehdr_ptr;
>  	Elf64_Phdr phdr;
>  	u64 phdr_sz = 0, note_off;
> +	struct vm_struct *vm;
>  
>  	ehdr_ptr = (Elf64_Ehdr *)elfptr;
>  
> @@ -391,6 +392,12 @@ static int __init merge_note_headers_elf64(char *elfptr, size_t *elfsz,
>  	if (!*notes_buf)
>  		return -ENOMEM;
>  
> +	/* Allow users to remap ELF note segment buffer on vmalloc
> +	 * memory using remap_vmalloc_range. */
> +	vm = find_vm_area(*notes_buf);
> +	BUG_ON(!vm);
> +	vm->flags |= VM_USERMAP;
> +
>  	rc = copy_notes_elf64(ehdr_ptr, *notes_buf);
>  	if (rc < 0)
>  		return rc;
> @@ -554,6 +561,7 @@ static int __init merge_note_headers_elf32(char *elfptr, size_t *elfsz,
>  	Elf32_Ehdr *ehdr_ptr;
>  	Elf32_Phdr phdr;
>  	u64 phdr_sz = 0, note_off;
> +	struct vm_struct *vm;
>  
>  	ehdr_ptr = (Elf32_Ehdr *)elfptr;
>  
> @@ -570,6 +578,12 @@ static int __init merge_note_headers_elf32(char *elfptr, size_t *elfsz,
>  	if (!*notes_buf)
>  		return -ENOMEM;
>  
> +	/* Allow users to remap ELF note segment buffer on vmalloc
> +	 * memory using remap_vmalloc_range. */
> +	vm = find_vm_area(*notes_buf);
> +	BUG_ON(!vm);
> +	vm->flags |= VM_USERMAP;
> +
>  	rc = copy_notes_elf32(ehdr_ptr, *notes_buf);
>  	if (rc < 0)
>  		return rc;
--
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