mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* mincore returning -ENOMEM instead of -EFAULT
@ 2007-02-23 22:58 Joel Becker
  2007-02-23 23:11 ` [PATCH] mm/mincore: Return EFAULT when passed an invalid address Joel Becker
  2007-02-25 23:06 ` mincore returning -ENOMEM instead of -EFAULT Linus Torvalds
  0 siblings, 2 replies; 5+ messages in thread
From: Joel Becker @ 2007-02-23 22:58 UTC (permalink / raw)
  To: linux-kernel, Linus Torvalds

Linus,
	Your fix in commit 2f77d107050abc14bc393b34bdb7b91cf670c250
modifies sys_mincore() to return -ENOMEM instead of -EFAULT on a totally
bogus address.  Was this intentional, or is it something that should be
fixed up?

-       /* check the output buffer whilst holding the lock */
-       error = -EFAULT;
-       down_read(&current->mm->mmap_sem);
+       /* ..and we need to be passed a valid user-space range */
+       if (!access_ok(VERIFY_READ, (void __user *) start, len))
+               return -ENOMEM;

Joel

-- 

"Nobody loves me,
 Nobody seems to care.
 Troubles and worries, people,
 You know I've had my share."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

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

end of thread, other threads:[~2007-02-25 23:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-23 22:58 mincore returning -ENOMEM instead of -EFAULT Joel Becker
2007-02-23 23:11 ` [PATCH] mm/mincore: Return EFAULT when passed an invalid address Joel Becker
2007-02-24  1:05   ` Hugh Dickins
2007-02-24  3:13     ` Joel Becker
2007-02-25 23:06 ` mincore returning -ENOMEM instead of -EFAULT Linus Torvalds

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

Powered by JetHome