OSDN Git Service

[PATCH] binfmt_elf.c : fix checks for bad address
authorErnie Petrides <petrides@redhat.com>
Tue, 22 Aug 2006 19:57:58 +0000 (21:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 27 Aug 2006 11:26:01 +0000 (13:26 +0200)
commitc2f7024f5fa4d8cf23aa24e0b4949ba67203acac
tree580c6018f6bd4794053df7dd8e75bd094afafedc
parentd43378cb298070c0168d0b970e84ea7b7d55f79a
[PATCH] binfmt_elf.c : fix checks for bad address

Fix check for bad address; use macro instead of open-coding two checks.

Explanation from Ernie Petries in 2.6 commit :

  For background, the BAD_ADDR() macro should return TRUE if the address is
  TASK_SIZE, because that's the lowest address that is *not* valid for
  user-space mappings.  The macro was correct in binfmt_aout.c but was wrong
  for the "equal to" case in binfmt_elf.c.  There were two in-line validations
  of user-space addresses in binfmt_elf.c, which have been appropriately
  converted to use the corrected BAD_ADDR() macro in the patch you posted
  yesterday.  Note that the size checks against TASK_SIZE are okay as coded.

Note that this patch slightly differs from Ernie's in that the printk()
only got commented out instead of being removed, since a rate limited call
is expected soon.
fs/binfmt_elf.c