Messages in this thread | | | Date | Thu, 3 Mar 2011 19:46:26 +0000 | From | Al Viro <> | Subject | Re: [PATCH] Enable writing to /proc/PID/mem. |
| |
On Thu, Mar 03, 2011 at 02:38:02PM -0500, Stephen Wilson wrote: > > I haven't found any problem in this patch. But, I really believe we need > > to understand why it was marked "security hazard". Al, I guess you know it, > > right? So, can you please talk us your mention? > > I did a bit more digging trying to find why mem_write was marked a security > hazard. > > It goes back to 2.4.0-test10pre4. Unfortunately, the changelog entry is > not at all informative either: > > - disable writing to /proc/xxx/mem. Sure, it works now, but it's > still a security risk.
Think what happens if the target execs suid-root binary in the middle of your call. After you've done your check. E.g. during copy_from_user().
On the read side we actually recheck permissions after having copied into buffer and if the check fails we don't copy that buffer into userland. Not feasible on the write side...
| |