Re: [PATCH] mm/nommu.c - return 0 from kobjsize with invalid objects

From: David Howells
Date: Tue Apr 22 2008 - 17:36:17 EST


Robin Getz <rgetz@xxxxxxxxxxxxxxxxxxxx> wrote:

> + if (!objp || !((page = virt_to_page(objp))) || (unsigned long)objp >= memory_end)

You should probably do the additional test before calling virt_to_page(), just
in case the illegal value you've rejected would otherwise break virt_to_page()
(not very likely, but...). For valid addresses, you've got to do all the
tests anyway.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/