All of lore.kernel.org
 help / color / mirror / Atom feed
* re: mm/mpol: Make MPOL_LOCAL a real policy
@ 2012-05-21 13:38 Dan Carpenter
  2012-09-27 20:06 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-05-21 13:38 UTC (permalink / raw)
  To: a.p.zijlstra; +Cc: linux-kernel

Hello Peter Zijlstra,

The patch 03ed7b538ca0: "mm/mpol: Make MPOL_LOCAL a real policy" from 
Mar 19, 2012, leads to the following warning:
mm/mempolicy.c:2591 mpol_parse_str()
	 error: buffer overflow 'policy_modes' 5 <= 5

mm/mempolicy.c
  2590          for (mode = 0; mode < MPOL_MAX; mode++) {
  2591                  if (!strcmp(str, policy_modes[mode])) {
  2592                          break;
  2593                  }
  2594          }

The problem is that MPOL_NOOP is not defined in policy_modes[] so we
search past the end of the array.

regards,
dan carpenter


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

* Re: mm/mpol: Make MPOL_LOCAL a real policy
  2012-05-21 13:38 mm/mpol: Make MPOL_LOCAL a real policy Dan Carpenter
@ 2012-09-27 20:06 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2012-09-27 20:06 UTC (permalink / raw)
  To: a.p.zijlstra; +Cc: linux-mm

Whatever happened with this?   It's a small read past the end of the
array, but probably it should be fixed.

regards,
dan carpenter

On Mon, May 21, 2012 at 04:38:39PM +0300, Dan Carpenter wrote:
> Hello Peter Zijlstra,
> 
> The patch 03ed7b538ca0: "mm/mpol: Make MPOL_LOCAL a real policy" from 
> Mar 19, 2012, leads to the following warning:
> mm/mempolicy.c:2591 mpol_parse_str()
> 	 error: buffer overflow 'policy_modes' 5 <= 5
> 
> mm/mempolicy.c
>   2590          for (mode = 0; mode < MPOL_MAX; mode++) {
>   2591                  if (!strcmp(str, policy_modes[mode])) {
>   2592                          break;
>   2593                  }
>   2594          }
> 
> The problem is that MPOL_NOOP is not defined in policy_modes[] so we
> search past the end of the array.
> 
> regards,
> dan carpenter

--
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] 2+ messages in thread

end of thread, other threads:[~2012-09-27 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-21 13:38 mm/mpol: Make MPOL_LOCAL a real policy Dan Carpenter
2012-09-27 20:06 ` Dan Carpenter

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.