Stupid Q regarding reading /proc/PID/mem, etc

From: Calin A. Culianu
Date: Tue Dec 30 2003 - 17:52:11 EST



I have a probably annoying/dumb question:

Why does reading something that you don't have permission for from
/proc/PID, such as, oh /proc/PID/mem (normally unless you own PID you
can't read that even on lax systems) return -ESRCH to userland? You'd
think it should return -EPERM right?

>From fs/proc/base.c::mem_read():

if (!MAY_PTRACE(task) || !may_ptrace_attach(task))
return -ESRCH;

Why not -EPERM?

-Calin



-
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/