linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wanlong Gao <wanlong.gao@gmail.com>
To: linux-mm@kvack.org
Subject: Re: [PATCH -v3] avoid null pointer access in vm_struct
Date: Wed, 24 Aug 2011 15:58:24 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110824T175141-583@post.gmane.org> (raw)
In-Reply-To: <20110821082132.28358.72280.stgit@ltc219.sdl.hitachi.co.jp>

Mitsuo Hayasaka <mitsuo.hayasaka.hu <at> hitachi.com> writes:

> 
> The /proc/vmallocinfo shows information about vmalloc allocations in vmlist
> that is a linklist of vm_struct. It, however, may access pages field of
> vm_struct where a page was not allocated. This results in a null pointer
> access and leads to a kernel panic.

> +static void insert_vmalloc_vmlist(struct vm_struct *vm)
> +{
> +	struct vm_struct *tmp, **p;
> 
> +	vm->flags &= ~VM_UNLIST;
>  	write_lock(&vmlist_lock);
>  	for (p = &vmlist; (tmp = *p) != NULL; p = &tmp->next) {
>  		if (tmp->addr >= vm->addr)
> @@ -1275,6 +1279,13 @@ static void insert_vmalloc_vm(struct vm_struct *vm,
struct vmap_area *va,
>  	write_unlock(&vmlist_lock);
>  }

Hi Mitsuo:
Is it needed to set the VM_UNLIST after vm_struct added to vmlist here?
or put it into lock protection?
Thanks
-Wanlong Gao


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2011-08-24 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-21  8:21 Mitsuo Hayasaka
2011-08-22 22:25 ` Andrew Morton
2011-08-24  4:29   ` HAYASAKA Mitsuo
2011-08-24 15:58 ` Wanlong Gao [this message]

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=loom.20110824T175141-583@post.gmane.org \
    --to=wanlong.gao@gmail.com \
    --cc=linux-mm@kvack.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