mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muli Ben-Yehuda <mulix@mulix.org>
To: ak@muc.de, ak@suse.de
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 072/198] x86_64: Use a VMA for the 32bit vsyscall
Date: Tue, 12 Apr 2005 20:02:30 +0300	[thread overview]
Message-ID: <20050412170230.GD2758@granada.merseine.nu> (raw)
In-Reply-To: <200504121031.j3CAVnpl005415@shell0.pdx.osdl.net>

[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]

On Tue, Apr 12, 2005 at 03:31:43AM -0700, akpm@osdl.org wrote:

> From: Andi Kleen <ak@muc.de>
> 
> Use a real VMA to map the 32bit vsyscall page

[...]

> +/* Setup a VMA at program startup for the vsyscall page */
> +int syscall32_setup_pages(struct linux_binprm *bprm, int exstack)
> +{
> +	int npages = (VSYSCALL32_END - VSYSCALL32_BASE) >> PAGE_SHIFT;
> +	struct vm_area_struct *vma;
> +	struct mm_struct *mm = current->mm;
> +
> +	vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
> +	if (!vma)
> +		return -ENOMEM;
> +	if (security_vm_enough_memory(npages)) {
> +		kmem_cache_free(vm_area_cachep, vma);
> +		return -ENOMEM;
> +	}
> +
> +	memset(vma, 0, sizeof(struct vm_area_struct));
> +	/* Could randomize here */
> +	vma->vm_start = VSYSCALL32_BASE;
> +	vma->vm_end = VSYSCALL32_END;
> +	/* MAYWRITE to allow gdb to COW and set breakpoints */
> +	vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYEXEC|VM_MAYWRITE;

Any reason for VM_MAYEXEC to be specified twice? did you mean something else?

Cheers,
Muli
-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-04-12 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-12 10:31 akpm
2005-04-12 17:02 ` Muli Ben-Yehuda [this message]
2005-04-13 18:20   ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050412170230.GD2758@granada.merseine.nu \
    --to=mulix@mulix.org \
    --cc=ak@muc.de \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®