* Re: mm: BUG in mempolicy's sp_insert
@ 2013-02-26 11:39 ` Hillf Danton
0 siblings, 0 replies; 21+ messages in thread
From: Hillf Danton @ 2013-02-26 11:39 UTC (permalink / raw)
To: Sasha Levin
Cc: KOSAKI Motohiro, Andrew Morton, Hugh Dickins, Mel Gorman,
Dave Jones, linux-mm, linux-kernel@vger.kernel.org, Hillf Danton
On Tue, Feb 26, 2013 at 9:54 AM, Sasha Levin <sasha.levin@oracle.com> wrote:
> On 02/25/2013 08:52 PM, KOSAKI Motohiro wrote:
>> On Mon, Feb 25, 2013 at 8:30 AM, Sasha Levin <sasha.levin@oracle.com> wrote:
>>> Hi all,
>>>
>>> While fuzzing with trinity inside a KVM tools guest running latest -next kernel,
>>> I've stumbled on the following BUG:
>>>
>>> [13551.830090] ------------[ cut here ]------------
>>> [13551.830090] kernel BUG at mm/mempolicy.c:2187!
>>> [13551.830090] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
>>
>> Unfortunately, I didn't reproduce this. I'll try it tonight.
>
> I've actually managed to reproduce it again since then, so it's not a one time
> fluke (which is a good sign a I guess).
>
> It did require about an hour of fuzzing just mm with trinity.
>
Insert new node after updating node in tree.
Hillf
--- a/mm/mempolicy.c Tue Feb 26 19:33:20 2013
+++ b/mm/mempolicy.c Tue Feb 26 19:35:38 2013
@@ -2391,8 +2391,8 @@ restart:
*mpol_new = *n->policy;
atomic_set(&mpol_new->refcnt, 1);
sp_node_init(n_new, n->end, end, mpol_new);
- sp_insert(sp, n_new);
n->end = start;
+ sp_insert(sp, n_new);
n_new = NULL;
mpol_new = NULL;
break;
--
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 1/2] mempolicy: fix wrong sp_node insertion
2013-02-26 11:39 ` Hillf Danton
@ 2013-02-28 5:25 ` kosaki.motohiro
-1 siblings, 0 replies; 21+ messages in thread
From: kosaki.motohiro @ 2013-02-28 5:25 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, Sasha Levin, Andrew Morton, Hugh Dickins, Mel Gorman,
Dave Jones, Hillf Danton, KOSAKI Motohiro
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
From: Hillf Danton <dhillf@gmail.com>
n->end is accessed in sp_insert(). Thus it should be update
before calling sp_insert(). This mistake may make kernel panic.
Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
mm/mempolicy.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 31d2663..868d08f 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2391,8 +2391,8 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start,
*mpol_new = *n->policy;
atomic_set(&mpol_new->refcnt, 1);
sp_node_init(n_new, n->end, end, mpol_new);
- sp_insert(sp, n_new);
n->end = start;
+ sp_insert(sp, n_new);
n_new = NULL;
mpol_new = NULL;
break;
--
1.7.1
--
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>
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 1/2] mempolicy: fix wrong sp_node insertion
@ 2013-02-28 5:25 ` kosaki.motohiro
0 siblings, 0 replies; 21+ messages in thread
From: kosaki.motohiro @ 2013-02-28 5:25 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, Sasha Levin, Andrew Morton, Hugh Dickins, Mel Gorman,
Dave Jones, Hillf Danton, KOSAKI Motohiro
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
From: Hillf Danton <dhillf@gmail.com>
n->end is accessed in sp_insert(). Thus it should be update
before calling sp_insert(). This mistake may make kernel panic.
Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
mm/mempolicy.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 31d2663..868d08f 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2391,8 +2391,8 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start,
*mpol_new = *n->policy;
atomic_set(&mpol_new->refcnt, 1);
sp_node_init(n_new, n->end, end, mpol_new);
- sp_insert(sp, n_new);
n->end = start;
+ sp_insert(sp, n_new);
n_new = NULL;
mpol_new = NULL;
break;
--
1.7.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 2/2] mempolicy: fix typo
2013-02-26 11:39 ` Hillf Danton
@ 2013-02-28 5:25 ` kosaki.motohiro
-1 siblings, 0 replies; 21+ messages in thread
From: kosaki.motohiro @ 2013-02-28 5:25 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, Sasha Levin, Andrew Morton, Hugh Dickins, Mel Gorman,
Dave Jones, Hillf Danton, KOSAKI Motohiro
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Currently, n_new is wrongly initialized. start and end parameter
are inverted. Let's fix it.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
mm/mempolicy.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 868d08f..7431001 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2390,7 +2390,7 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start,
*mpol_new = *n->policy;
atomic_set(&mpol_new->refcnt, 1);
- sp_node_init(n_new, n->end, end, mpol_new);
+ sp_node_init(n_new, end, n->end, mpol_new);
n->end = start;
sp_insert(sp, n_new);
n_new = NULL;
--
1.7.1
--
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>
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 2/2] mempolicy: fix typo
@ 2013-02-28 5:25 ` kosaki.motohiro
0 siblings, 0 replies; 21+ messages in thread
From: kosaki.motohiro @ 2013-02-28 5:25 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, Sasha Levin, Andrew Morton, Hugh Dickins, Mel Gorman,
Dave Jones, Hillf Danton, KOSAKI Motohiro
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Currently, n_new is wrongly initialized. start and end parameter
are inverted. Let's fix it.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
mm/mempolicy.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 868d08f..7431001 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2390,7 +2390,7 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start,
*mpol_new = *n->policy;
atomic_set(&mpol_new->refcnt, 1);
- sp_node_init(n_new, n->end, end, mpol_new);
+ sp_node_init(n_new, end, n->end, mpol_new);
n->end = start;
sp_insert(sp, n_new);
n_new = NULL;
--
1.7.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH 2/2] mempolicy: fix typo
2013-02-28 5:25 ` kosaki.motohiro
@ 2013-02-28 23:54 ` Andrew Morton
-1 siblings, 0 replies; 21+ messages in thread
From: Andrew Morton @ 2013-02-28 23:54 UTC (permalink / raw)
To: kosaki.motohiro
Cc: linux-kernel, linux-mm, Sasha Levin, Hugh Dickins, Mel Gorman,
Dave Jones, Hillf Danton, KOSAKI Motohiro
On Thu, 28 Feb 2013 00:25:07 -0500
kosaki.motohiro@gmail.com wrote:
> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>
> Currently, n_new is wrongly initialized. start and end parameter
> are inverted. Let's fix it.
>
> ...
>
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -2390,7 +2390,7 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start,
>
> *mpol_new = *n->policy;
> atomic_set(&mpol_new->refcnt, 1);
> - sp_node_init(n_new, n->end, end, mpol_new);
> + sp_node_init(n_new, end, n->end, mpol_new);
> n->end = start;
> sp_insert(sp, n_new);
> n_new = NULL;
huh. What were the runtime effects of this problem?
--
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>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 2/2] mempolicy: fix typo
@ 2013-02-28 23:54 ` Andrew Morton
0 siblings, 0 replies; 21+ messages in thread
From: Andrew Morton @ 2013-02-28 23:54 UTC (permalink / raw)
To: kosaki.motohiro
Cc: linux-kernel, linux-mm, Sasha Levin, Hugh Dickins, Mel Gorman,
Dave Jones, Hillf Danton, KOSAKI Motohiro
On Thu, 28 Feb 2013 00:25:07 -0500
kosaki.motohiro@gmail.com wrote:
> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>
> Currently, n_new is wrongly initialized. start and end parameter
> are inverted. Let's fix it.
>
> ...
>
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -2390,7 +2390,7 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start,
>
> *mpol_new = *n->policy;
> atomic_set(&mpol_new->refcnt, 1);
> - sp_node_init(n_new, n->end, end, mpol_new);
> + sp_node_init(n_new, end, n->end, mpol_new);
> n->end = start;
> sp_insert(sp, n_new);
> n_new = NULL;
huh. What were the runtime effects of this problem?
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 2/2] mempolicy: fix typo
2013-02-28 23:54 ` Andrew Morton
@ 2013-03-01 1:28 ` KOSAKI Motohiro
-1 siblings, 0 replies; 21+ messages in thread
From: KOSAKI Motohiro @ 2013-03-01 1:28 UTC (permalink / raw)
To: Andrew Morton
Cc: LKML, linux-mm@kvack.org, Sasha Levin, Hugh Dickins, Mel Gorman,
Dave Jones, Hillf Danton
On Thu, Feb 28, 2013 at 6:54 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Thu, 28 Feb 2013 00:25:07 -0500
> kosaki.motohiro@gmail.com wrote:
>
>> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>
>> Currently, n_new is wrongly initialized. start and end parameter
>> are inverted. Let's fix it.
>>
>> ...
>>
>> --- a/mm/mempolicy.c
>> +++ b/mm/mempolicy.c
>> @@ -2390,7 +2390,7 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start,
>>
>> *mpol_new = *n->policy;
>> atomic_set(&mpol_new->refcnt, 1);
>> - sp_node_init(n_new, n->end, end, mpol_new);
>> + sp_node_init(n_new, end, n->end, mpol_new);
>> n->end = start;
>> sp_insert(sp, n_new);
>> n_new = NULL;
>
> huh. What were the runtime effects of this problem?
I think passed policy don't effect correctly. No big issue because nobody
uses route except Dave Jones testcase. (remember, until very recently,
this route has kernel crash bug and nobody have been hit.)
--
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>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 2/2] mempolicy: fix typo
@ 2013-03-01 1:28 ` KOSAKI Motohiro
0 siblings, 0 replies; 21+ messages in thread
From: KOSAKI Motohiro @ 2013-03-01 1:28 UTC (permalink / raw)
To: Andrew Morton
Cc: LKML, linux-mm@kvack.org, Sasha Levin, Hugh Dickins, Mel Gorman,
Dave Jones, Hillf Danton
On Thu, Feb 28, 2013 at 6:54 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Thu, 28 Feb 2013 00:25:07 -0500
> kosaki.motohiro@gmail.com wrote:
>
>> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>
>> Currently, n_new is wrongly initialized. start and end parameter
>> are inverted. Let's fix it.
>>
>> ...
>>
>> --- a/mm/mempolicy.c
>> +++ b/mm/mempolicy.c
>> @@ -2390,7 +2390,7 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start,
>>
>> *mpol_new = *n->policy;
>> atomic_set(&mpol_new->refcnt, 1);
>> - sp_node_init(n_new, n->end, end, mpol_new);
>> + sp_node_init(n_new, end, n->end, mpol_new);
>> n->end = start;
>> sp_insert(sp, n_new);
>> n_new = NULL;
>
> huh. What were the runtime effects of this problem?
I think passed policy don't effect correctly. No big issue because nobody
uses route except Dave Jones testcase. (remember, until very recently,
this route has kernel crash bug and nobody have been hit.)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: mm: BUG in mempolicy's sp_insert
2013-02-26 11:39 ` Hillf Danton
@ 2013-02-28 5:26 ` KOSAKI Motohiro
-1 siblings, 0 replies; 21+ messages in thread
From: KOSAKI Motohiro @ 2013-02-28 5:26 UTC (permalink / raw)
To: Hillf Danton
Cc: Sasha Levin, Andrew Morton, Hugh Dickins, Mel Gorman, Dave Jones,
linux-mm, linux-kernel@vger.kernel.org
> Insert new node after updating node in tree.
Thanks. you are right. I could reproduce and verified.
--
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>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: mm: BUG in mempolicy's sp_insert
@ 2013-02-28 5:26 ` KOSAKI Motohiro
0 siblings, 0 replies; 21+ messages in thread
From: KOSAKI Motohiro @ 2013-02-28 5:26 UTC (permalink / raw)
To: Hillf Danton
Cc: Sasha Levin, Andrew Morton, Hugh Dickins, Mel Gorman, Dave Jones,
linux-mm, linux-kernel@vger.kernel.org
> Insert new node after updating node in tree.
Thanks. you are right. I could reproduce and verified.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: mm: BUG in mempolicy's sp_insert
2013-02-28 5:26 ` KOSAKI Motohiro
@ 2013-02-28 6:53 ` Hillf Danton
-1 siblings, 0 replies; 21+ messages in thread
From: Hillf Danton @ 2013-02-28 6:53 UTC (permalink / raw)
To: KOSAKI Motohiro
Cc: Sasha Levin, Andrew Morton, Hugh Dickins, Mel Gorman, Dave Jones,
linux-mm, linux-kernel@vger.kernel.org
On Thu, Feb 28, 2013 at 1:26 PM, KOSAKI Motohiro
<kosaki.motohiro@jp.fujitsu.com> wrote:
>> Insert new node after updating node in tree.
>
> Thanks. you are right. I could reproduce and verified.
Thank you too;) pleasure to do minor work for you.
btw, how about your belly now? fully recovered?
Hillf
--
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>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: mm: BUG in mempolicy's sp_insert
@ 2013-02-28 6:53 ` Hillf Danton
0 siblings, 0 replies; 21+ messages in thread
From: Hillf Danton @ 2013-02-28 6:53 UTC (permalink / raw)
To: KOSAKI Motohiro
Cc: Sasha Levin, Andrew Morton, Hugh Dickins, Mel Gorman, Dave Jones,
linux-mm, linux-kernel@vger.kernel.org
On Thu, Feb 28, 2013 at 1:26 PM, KOSAKI Motohiro
<kosaki.motohiro@jp.fujitsu.com> wrote:
>> Insert new node after updating node in tree.
>
> Thanks. you are right. I could reproduce and verified.
Thank you too;) pleasure to do minor work for you.
btw, how about your belly now? fully recovered?
Hillf
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: mm: BUG in mempolicy's sp_insert
2013-02-28 6:53 ` Hillf Danton
@ 2013-03-01 1:30 ` KOSAKI Motohiro
-1 siblings, 0 replies; 21+ messages in thread
From: KOSAKI Motohiro @ 2013-03-01 1:30 UTC (permalink / raw)
To: Hillf Danton
Cc: Sasha Levin, Andrew Morton, Hugh Dickins, Mel Gorman, Dave Jones,
linux-mm, linux-kernel@vger.kernel.org
On Thu, Feb 28, 2013 at 1:53 AM, Hillf Danton <dhillf@gmail.com> wrote:
> On Thu, Feb 28, 2013 at 1:26 PM, KOSAKI Motohiro
> <kosaki.motohiro@jp.fujitsu.com> wrote:
>>> Insert new node after updating node in tree.
>>
>> Thanks. you are right. I could reproduce and verified.
>
> Thank you too;) pleasure to do minor work for you.
>
> btw, how about your belly now? fully recovered?
Yup. I could learned US health care a bit. =)
--
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>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: mm: BUG in mempolicy's sp_insert
@ 2013-03-01 1:30 ` KOSAKI Motohiro
0 siblings, 0 replies; 21+ messages in thread
From: KOSAKI Motohiro @ 2013-03-01 1:30 UTC (permalink / raw)
To: Hillf Danton
Cc: Sasha Levin, Andrew Morton, Hugh Dickins, Mel Gorman, Dave Jones,
linux-mm, linux-kernel@vger.kernel.org
On Thu, Feb 28, 2013 at 1:53 AM, Hillf Danton <dhillf@gmail.com> wrote:
> On Thu, Feb 28, 2013 at 1:26 PM, KOSAKI Motohiro
> <kosaki.motohiro@jp.fujitsu.com> wrote:
>>> Insert new node after updating node in tree.
>>
>> Thanks. you are right. I could reproduce and verified.
>
> Thank you too;) pleasure to do minor work for you.
>
> btw, how about your belly now? fully recovered?
Yup. I could learned US health care a bit. =)
^ permalink raw reply [flat|nested] 21+ messages in thread