lkml.org 
[lkml]   [1996]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject/proc/<pid>/mem unreadable (was strace and linux 1.3.97)


On Mon, 29 Apr 1996, Aaron Ucko wrote:

> I'm not sure if this problem occurred in older kernels, as I don't use
> strace extremely frequently, but when I tried to run strace version 3.0.8
> (the latest, AFAIK) under Linux 1.3.97, only the strings in the initial
> exec were dereferenced. The only recent changes I've made to my
> predominantly Red Hat 3.0.3 system were kernel upgrades, and I know this
> version of strace worked a few kernel versions ago.

The same happened to me. The problem is that strace accesses the tracee's
memory through /proc/<pid>/mem but as of 1.3.96 any read from processes
different from the one which owns the memory fail with EACCES.
Here is the relevant piece of code from linux/fs/proc/mem.c in function
mem_read:


if (count < 0)
return -EINVAL;
pid = inode->i_ino;
pid >>= 16;
! if (pid != current->pid)
! return -EACCES;
tsk = current;
addr = file->f_pos;
count = check_range(tsk, addr, count);
if (count < 0)
return count;
tmp = buf;

Can anyone out there tell me if there is any reason for this new behavior?

TIA
Guille



\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.068 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site