All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>,
	bhutchings@solarflare.com, linux-mm@kvack.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: mpol_to_str revisited.
Date: Mon, 8 Oct 2012 11:15:52 -0400	[thread overview]
Message-ID: <20121008151552.GA10881@redhat.com> (raw)
In-Reply-To: <20121008150949.GA15130@redhat.com>

On Mon, Oct 08, 2012 at 11:09:49AM -0400, Dave Jones wrote:
 > Last month I sent in 80de7c3138ee9fd86a98696fd2cf7ad89b995d0a to remove
 > a user triggerable BUG in mempolicy.
 > 
 > Ben Hutchings pointed out to me that my change introduced a potential leak
 > of stack contents to userspace, because none of the callers check the return value.
 > 
 > This patch adds the missing return checking, and also clears the buffer beforehand.
 > 
 > Reported-by: Ben Hutchings <bhutchings@solarflare.com>
 > Cc: stable@kernel.org
 > Signed-off-by: Dave Jones <davej@redhat.com>
 > 
 > --- 
 > unanswered question: why are the buffer sizes here different ? which is correct?

A further unanswered question is how the state got so screwed up that we hit that
default case at all.  Looking at the original report: https://lkml.org/lkml/2012/9/6/356
What's in RAX looks suspiciously like left-over slab poison.

If pol->mode was poisoned, that smells like we have a race where policy is getting freed
while another process is reading it.

Am I missing something, or is there no locking around that at all ?

	Dave

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Dave Jones <davej@redhat.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>,
	bhutchings@solarflare.com, linux-mm@kvack.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: mpol_to_str revisited.
Date: Mon, 8 Oct 2012 11:15:52 -0400	[thread overview]
Message-ID: <20121008151552.GA10881@redhat.com> (raw)
In-Reply-To: <20121008150949.GA15130@redhat.com>

On Mon, Oct 08, 2012 at 11:09:49AM -0400, Dave Jones wrote:
 > Last month I sent in 80de7c3138ee9fd86a98696fd2cf7ad89b995d0a to remove
 > a user triggerable BUG in mempolicy.
 > 
 > Ben Hutchings pointed out to me that my change introduced a potential leak
 > of stack contents to userspace, because none of the callers check the return value.
 > 
 > This patch adds the missing return checking, and also clears the buffer beforehand.
 > 
 > Reported-by: Ben Hutchings <bhutchings@solarflare.com>
 > Cc: stable@kernel.org
 > Signed-off-by: Dave Jones <davej@redhat.com>
 > 
 > --- 
 > unanswered question: why are the buffer sizes here different ? which is correct?

A further unanswered question is how the state got so screwed up that we hit that
default case at all.  Looking at the original report: https://lkml.org/lkml/2012/9/6/356
What's in RAX looks suspiciously like left-over slab poison.

If pol->mode was poisoned, that smells like we have a race where policy is getting freed
while another process is reading it.

Am I missing something, or is there no locking around that at all ?

	Dave


  reply	other threads:[~2012-10-08 15:15 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 15:09 mpol_to_str revisited Dave Jones
2012-10-08 15:09 ` Dave Jones
2012-10-08 15:15 ` Dave Jones [this message]
2012-10-08 15:15   ` Dave Jones
2012-10-08 20:46   ` David Rientjes
2012-10-08 20:46     ` David Rientjes
2012-10-08 20:35 ` David Rientjes
2012-10-08 20:35   ` David Rientjes
2012-10-08 20:52   ` Dave Jones
2012-10-08 20:52     ` Dave Jones
2012-10-16  0:48     ` David Rientjes
2012-10-16  0:48       ` David Rientjes
2012-10-09  0:33 ` Ben Hutchings
2012-10-16  2:34 ` KOSAKI Motohiro
2012-10-16  2:34   ` KOSAKI Motohiro
2012-10-16  3:58   ` David Rientjes
2012-10-16  3:58     ` David Rientjes
2012-10-16  5:10     ` KOSAKI Motohiro
2012-10-16  5:10       ` KOSAKI Motohiro
2012-10-16  6:10       ` David Rientjes
2012-10-16  6:10         ` David Rientjes
2012-10-16 23:39         ` KOSAKI Motohiro
2012-10-16 23:39           ` KOSAKI Motohiro
2012-10-17  0:12           ` David Rientjes
2012-10-17  0:12             ` David Rientjes
2012-10-17  0:31             ` [patch for-3.7] mm, mempolicy: fix printing stack contents in numa_maps David Rientjes
2012-10-17  0:31               ` David Rientjes
2012-10-17  1:38               ` KOSAKI Motohiro
2012-10-17  1:38                 ` KOSAKI Motohiro
2012-10-17  1:49                 ` David Rientjes
2012-10-17  1:49                   ` David Rientjes
2012-10-17  1:53                   ` KOSAKI Motohiro
2012-10-17  1:53                     ` KOSAKI Motohiro
2012-10-17  4:05               ` Dave Jones
2012-10-17  4:05                 ` Dave Jones
2012-10-17  5:24                 ` David Rientjes
2012-10-17  5:24                   ` David Rientjes
2012-10-17  5:42                   ` Kamezawa Hiroyuki
2012-10-17  5:42                     ` Kamezawa Hiroyuki
2012-10-17  8:49                     ` KOSAKI Motohiro
2012-10-17  8:49                       ` KOSAKI Motohiro
2012-10-17 19:50                       ` David Rientjes
2012-10-17 19:50                         ` David Rientjes
2012-10-17 21:05                         ` KOSAKI Motohiro
2012-10-17 21:05                           ` KOSAKI Motohiro
2012-10-17 21:27                           ` David Rientjes
2012-10-17 21:27                             ` David Rientjes
2012-10-17 18:14                   ` Dave Jones
2012-10-17 18:14                     ` Dave Jones
2012-10-17 19:21                     ` David Rientjes
2012-10-17 19:21                       ` David Rientjes
2012-10-17 19:32                       ` Dave Jones
2012-10-17 19:32                         ` Dave Jones
2012-10-17 19:38                         ` David Rientjes
2012-10-17 19:38                           ` David Rientjes
2012-10-17 19:45                           ` Dave Jones
2012-10-17 19:45                             ` Dave Jones
2012-10-17 20:28                             ` [patch for-3.7] mm, mempolicy: avoid taking mutex inside spinlock when reading numa_maps David Rientjes
2012-10-17 20:28                               ` David Rientjes
2012-10-17 21:31                               ` [patch for-3.7 v2] " David Rientjes
2012-10-17 21:31                                 ` David Rientjes
2012-10-18  4:06                                 ` Kamezawa Hiroyuki
2012-10-18  4:06                                   ` Kamezawa Hiroyuki
2012-10-18  4:14                                   ` Linus Torvalds
2012-10-18  4:14                                     ` Linus Torvalds
2012-10-18  4:41                                     ` Kamezawa Hiroyuki
2012-10-18  4:41                                       ` Kamezawa Hiroyuki
2012-10-18  4:34                                   ` Kamezawa Hiroyuki
2012-10-18  4:34                                     ` Kamezawa Hiroyuki
2012-10-18 20:03                                     ` David Rientjes
2012-10-18 20:03                                       ` David Rientjes
2012-10-19  8:35                                       ` [patch for-3.7 v3] mm, mempolicy: hold task->mempolicy refcount while " Kamezawa Hiroyuki
2012-10-19  8:35                                         ` Kamezawa Hiroyuki
2012-10-19  9:28                                         ` David Rientjes
2012-10-19  9:28                                           ` David Rientjes
2012-10-22  2:47                                           ` Kamezawa Hiroyuki
2012-10-22  2:47                                             ` Kamezawa Hiroyuki
2012-10-22 20:55                                             ` Andrew Morton
2012-10-22 20:55                                               ` Andrew Morton
2012-10-22 20:56                                             ` David Rientjes
2012-10-22 20:56                                               ` David Rientjes
2012-10-19 19:15                                         ` KOSAKI Motohiro
2012-10-19 19:15                                           ` KOSAKI Motohiro
2012-10-19  6:51                                     ` [patch for-3.7 v2] mm, mempolicy: avoid taking mutex inside spinlock when " KOSAKI Motohiro
2012-10-19  6:51                                       ` KOSAKI Motohiro
2012-10-18  4:35                                   ` David Rientjes
2012-10-18  4:35                                     ` David Rientjes
2012-10-24 23:30                   ` [patch for-3.7] mm, mempolicy: fix printing stack contents in numa_maps Sasha Levin
2012-10-24 23:30                     ` Sasha Levin
2012-10-24 23:34                     ` David Rientjes
2012-10-24 23:34                       ` David Rientjes
2012-10-24 23:37                       ` Sasha Levin
2012-10-24 23:37                         ` Sasha Levin
2012-10-25  0:08                         ` David Rientjes
2012-10-25  0:08                           ` David Rientjes
2012-10-25  0:54                           ` KOSAKI Motohiro
2012-10-25  0:54                             ` KOSAKI Motohiro
2012-10-25  1:15                             ` David Rientjes
2012-10-25  1:15                               ` David Rientjes
2012-10-25 12:19                           ` Peter Zijlstra
2012-10-25 12:19                             ` Peter Zijlstra
2012-10-25 14:39                             ` Peter Zijlstra
2012-10-25 14:39                               ` Peter Zijlstra
2012-10-25 17:23                               ` Sasha Levin
2012-10-25 17:23                                 ` Sasha Levin
2012-10-25 20:22                               ` David Rientjes
2012-10-25 20:22                                 ` David Rientjes
2012-10-25 23:09                               ` Linus Torvalds
2012-10-25 23:09                                 ` Linus Torvalds
2012-10-26  8:48                                 ` Peter Zijlstra
2012-10-26  8:48                                   ` Peter Zijlstra
2012-10-31 18:29                                   ` Sasha Levin
2012-10-31 18:29                                     ` Sasha Levin
2012-11-21  0:59                                     ` Sasha Levin
2012-11-21  0:59                                       ` Sasha Levin
2012-10-17  1:33             ` mpol_to_str revisited KOSAKI Motohiro
2012-10-17  1:33               ` KOSAKI Motohiro

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=20121008151552.GA10881@redhat.com \
    --to=davej@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhutchings@solarflare.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.