All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] metag: off by one in setup_bootmem_node()
@ 2013-11-08  9:45 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-11-08  9:45 UTC (permalink / raw)
  To: kernel-janitors

If "nid = MAX_NUMNODES" then we write beyond the end of the node_data[]
array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/arch/metag/mm/numa.c b/arch/metag/mm/numa.c
index 9ae578c..b172aa4 100644
--- a/arch/metag/mm/numa.c
+++ b/arch/metag/mm/numa.c
@@ -34,7 +34,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
 	unsigned long pgdat_paddr;
 
 	/* Don't allow bogus node assignment */
-	BUG_ON(nid > MAX_NUMNODES || nid <= 0);
+	BUG_ON(nid >= MAX_NUMNODES || nid <= 0);
 
 	start_pfn = start >> PAGE_SHIFT;
 	end_pfn = end >> PAGE_SHIFT;

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

* [patch] metag: off by one in setup_bootmem_node()
@ 2013-11-08  9:45 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-11-08  9:45 UTC (permalink / raw)
  To: James Hogan
  Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

If "nid == MAX_NUMNODES" then we write beyond the end of the node_data[]
array.

Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

diff --git a/arch/metag/mm/numa.c b/arch/metag/mm/numa.c
index 9ae578c..b172aa4 100644
--- a/arch/metag/mm/numa.c
+++ b/arch/metag/mm/numa.c
@@ -34,7 +34,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
 	unsigned long pgdat_paddr;
 
 	/* Don't allow bogus node assignment */
-	BUG_ON(nid > MAX_NUMNODES || nid <= 0);
+	BUG_ON(nid >= MAX_NUMNODES || nid <= 0);
 
 	start_pfn = start >> PAGE_SHIFT;
 	end_pfn = end >> PAGE_SHIFT;
--
To unsubscribe from this list: send the line "unsubscribe linux-metag" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [patch] metag: off by one in setup_bootmem_node()
@ 2013-11-08 11:33   ` James Hogan
  0 siblings, 0 replies; 4+ messages in thread
From: James Hogan @ 2013-11-08 11:33 UTC (permalink / raw)
  To: kernel-janitors

On 08/11/13 09:45, Dan Carpenter wrote:
> If "nid = MAX_NUMNODES" then we write beyond the end of the node_data[]
> array.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/arch/metag/mm/numa.c b/arch/metag/mm/numa.c
> index 9ae578c..b172aa4 100644
> --- a/arch/metag/mm/numa.c
> +++ b/arch/metag/mm/numa.c
> @@ -34,7 +34,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
>  	unsigned long pgdat_paddr;
>  
>  	/* Don't allow bogus node assignment */
> -	BUG_ON(nid > MAX_NUMNODES || nid <= 0);
> +	BUG_ON(nid >= MAX_NUMNODES || nid <= 0);
>  
>  	start_pfn = start >> PAGE_SHIFT;
>  	end_pfn = end >> PAGE_SHIFT;

Thanks, Applied for v3.13.

Cheers
James


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

* Re: [patch] metag: off by one in setup_bootmem_node()
@ 2013-11-08 11:33   ` James Hogan
  0 siblings, 0 replies; 4+ messages in thread
From: James Hogan @ 2013-11-08 11:33 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

On 08/11/13 09:45, Dan Carpenter wrote:
> If "nid == MAX_NUMNODES" then we write beyond the end of the node_data[]
> array.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> 
> diff --git a/arch/metag/mm/numa.c b/arch/metag/mm/numa.c
> index 9ae578c..b172aa4 100644
> --- a/arch/metag/mm/numa.c
> +++ b/arch/metag/mm/numa.c
> @@ -34,7 +34,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
>  	unsigned long pgdat_paddr;
>  
>  	/* Don't allow bogus node assignment */
> -	BUG_ON(nid > MAX_NUMNODES || nid <= 0);
> +	BUG_ON(nid >= MAX_NUMNODES || nid <= 0);
>  
>  	start_pfn = start >> PAGE_SHIFT;
>  	end_pfn = end >> PAGE_SHIFT;

Thanks, Applied for v3.13.

Cheers
James

--
To unsubscribe from this list: send the line "unsubscribe linux-metag" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2013-11-08 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08  9:45 [patch] metag: off by one in setup_bootmem_node() Dan Carpenter
2013-11-08  9:45 ` Dan Carpenter
2013-11-08 11:33 ` James Hogan
2013-11-08 11:33   ` James Hogan

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.