public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] proc: check vma->vm_file before dereferencing
@ 2012-10-15 15:30 Stanislav Kinsbursky
  2012-10-15 15:30 ` Cyrill Gorcunov
  2012-10-15 21:40 ` Andrew Morton
  0 siblings, 2 replies; 6+ messages in thread
From: Stanislav Kinsbursky @ 2012-10-15 15:30 UTC (permalink / raw)
  To: akpm, viro; +Cc: linux-kernel, criu, ebiederm, rientjes, gorcunov, devel

It can be equal to NULL.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
 fs/proc/base.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 144a967..74fc562 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1770,8 +1770,9 @@ static struct dentry *proc_map_files_lookup(struct inode *dir,
 	if (!vma)
 		goto out_no_vma;
 
-	result = proc_map_files_instantiate(dir, dentry, task,
-			(void *)(unsigned long)vma->vm_file->f_mode);
+	if (vma->vm_file)
+		result = proc_map_files_instantiate(dir, dentry, task,
+				(void *)(unsigned long)vma->vm_file->f_mode);
 
 out_no_vma:
 	up_read(&mm->mmap_sem);


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] proc: check vma->vm_file before dereferencing
  2012-10-15 15:30 [PATCH] proc: check vma->vm_file before dereferencing Stanislav Kinsbursky
@ 2012-10-15 15:30 ` Cyrill Gorcunov
  2012-10-15 21:40 ` Andrew Morton
  1 sibling, 0 replies; 6+ messages in thread
From: Cyrill Gorcunov @ 2012-10-15 15:30 UTC (permalink / raw)
  To: Stanislav Kinsbursky
  Cc: akpm, viro, linux-kernel, criu, ebiederm, rientjes, devel

On Mon, Oct 15, 2012 at 07:30:03PM +0400, Stanislav Kinsbursky wrote:
> It can be equal to NULL.
> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>

Thanks, Stas!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] proc: check vma->vm_file before dereferencing
  2012-10-15 15:30 [PATCH] proc: check vma->vm_file before dereferencing Stanislav Kinsbursky
  2012-10-15 15:30 ` Cyrill Gorcunov
@ 2012-10-15 21:40 ` Andrew Morton
  2012-10-15 21:52   ` Cyrill Gorcunov
  2012-10-16  7:26   ` Stanislav Kinsbursky
  1 sibling, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2012-10-15 21:40 UTC (permalink / raw)
  To: Stanislav Kinsbursky
  Cc: viro, linux-kernel, criu, ebiederm, rientjes, gorcunov, devel

On Mon, 15 Oct 2012 19:30:03 +0400
Stanislav Kinsbursky <skinsbursky@parallels.com> wrote:

> It can be equal to NULL.
> 

Please write better changelogs, so people do not have to ask questions
such as:

- Under what conditions does this bug trigger?

- In which kernel version(s)?

- Is it a post-3.6 regression?

Thanks.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] proc: check vma->vm_file before dereferencing
  2012-10-15 21:40 ` Andrew Morton
@ 2012-10-15 21:52   ` Cyrill Gorcunov
  2012-10-15 22:04     ` Andrew Morton
  2012-10-16  7:26   ` Stanislav Kinsbursky
  1 sibling, 1 reply; 6+ messages in thread
From: Cyrill Gorcunov @ 2012-10-15 21:52 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Stanislav Kinsbursky, viro, linux-kernel, criu, ebiederm,
	rientjes, devel

On Mon, Oct 15, 2012 at 02:40:48PM -0700, Andrew Morton wrote:
> On Mon, 15 Oct 2012 19:30:03 +0400
> Stanislav Kinsbursky <skinsbursky@parallels.com> wrote:
> 
> > It can be equal to NULL.
> > 
> 
> Please write better changelogs, so people do not have to ask questions
> such as:
> 
> - Under what conditions does this bug trigger?
> 
> - In which kernel version(s)?
> 
> - Is it a post-3.6 regression?

Andrew, would the following changelog be enough?

The commit 7b540d0646ce122f0ba4520412be91e530719742 switched
proc_map_files_readdir to use @f_mode directly instead of grabbing
@file reference, but same time the test for @vm_file presence was
lost leading to nil dereference. The patch brings the test back.

The all proc_map_files feature is CONFIG_CHECKPOINT_RESTORE wrapped
(which is set to 'n' by default) so the bug doesn't affect regular
kernels.

The regression is 3.7-rc1 only as far as I can tell.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] proc: check vma->vm_file before dereferencing
  2012-10-15 21:52   ` Cyrill Gorcunov
@ 2012-10-15 22:04     ` Andrew Morton
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2012-10-15 22:04 UTC (permalink / raw)
  To: Cyrill Gorcunov
  Cc: Stanislav Kinsbursky, viro, linux-kernel, criu, ebiederm,
	rientjes, devel

On Tue, 16 Oct 2012 01:52:30 +0400
Cyrill Gorcunov <gorcunov@openvz.org> wrote:

> On Mon, Oct 15, 2012 at 02:40:48PM -0700, Andrew Morton wrote:
> > On Mon, 15 Oct 2012 19:30:03 +0400
> > Stanislav Kinsbursky <skinsbursky@parallels.com> wrote:
> > 
> > > It can be equal to NULL.
> > > 
> > 
> > Please write better changelogs, so people do not have to ask questions
> > such as:
> > 
> > - Under what conditions does this bug trigger?
> > 
> > - In which kernel version(s)?
> > 
> > - Is it a post-3.6 regression?
> 
> Andrew, would the following changelog be enough?
> 
> The commit 7b540d0646ce122f0ba4520412be91e530719742 switched
> proc_map_files_readdir to use @f_mode directly instead of grabbing
> @file reference, but same time the test for @vm_file presence was
> lost leading to nil dereference. The patch brings the test back.
> 
> The all proc_map_files feature is CONFIG_CHECKPOINT_RESTORE wrapped
> (which is set to 'n' by default) so the bug doesn't affect regular
> kernels.
> 
> The regression is 3.7-rc1 only as far as I can tell.

Ah, I see, great, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] proc: check vma->vm_file before dereferencing
  2012-10-15 21:40 ` Andrew Morton
  2012-10-15 21:52   ` Cyrill Gorcunov
@ 2012-10-16  7:26   ` Stanislav Kinsbursky
  1 sibling, 0 replies; 6+ messages in thread
From: Stanislav Kinsbursky @ 2012-10-16  7:26 UTC (permalink / raw)
  To: Andrew Morton
  Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org,
	criu@openvz.org, ebiederm@xmission.com, rientjes@google.com,
	gorcunov@openvz.org, devel@openvz.org

16.10.2012 01:40, Andrew Morton пишет:
> On Mon, 15 Oct 2012 19:30:03 +0400
> Stanislav Kinsbursky <skinsbursky@parallels.com> wrote:
>
>> It can be equal to NULL.
>>
>
> Please write better changelogs, so people do not have to ask questions
> such as:
>
> - Under what conditions does this bug trigger?
>
> - In which kernel version(s)?
>
> - Is it a post-3.6 regression?
>

Sure. Sorry.

> Thanks.
>


-- 
Best regards,
Stanislav Kinsbursky

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-10-16  7:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-15 15:30 [PATCH] proc: check vma->vm_file before dereferencing Stanislav Kinsbursky
2012-10-15 15:30 ` Cyrill Gorcunov
2012-10-15 21:40 ` Andrew Morton
2012-10-15 21:52   ` Cyrill Gorcunov
2012-10-15 22:04     ` Andrew Morton
2012-10-16  7:26   ` Stanislav Kinsbursky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox