Package: coreutils
Version: 8.5-1
Severity: normal

Hi,

I wanted to extract the vdso segment, but dd can't work in
/proc/self/mem.

% grep vdso /proc/$$/maps
00100000-00103000 r-xp 00000000 00:00 0          [vdso]

% strace -o /tmp/dd.st dd if=/proc/$$/mem of=/tmp/vdso 
skip=$((0x00100000/4096)) bs=4k count=1
dd: `/proc/25302/mem': cannot skip to specified offset
dd: reading `/proc/25302/mem': Operation not permitted
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.0120592 s, 0.0 kB/s

2406  01:07:20.898686 execve("/bin/dd", ["dd", "if=/proc/25302/mem", 
"of=/tmp/vdso", "skip=256", "bs=4k", "count=1"], ["HOME=/home/joerg", 
"DISPLAY=:0", "XAUTHORITY=/home/joerg/.Xauthori"..., 
"PATH=/home/joerg/bin:/usr/lib/cc"..., "LANG=de_DE.UTF-8", 
"EDITOR=/usr/bin/xjed", "TERM=xterm", "WINDOWID=48234511", 
"XTERM_VERSION=XTerm(270)", "XTERM_LOCALE=de_DE.UTF-8", "LOGNAME=joerg", 
"XTERM_SHELL=/bin/zsh-beta", "SHLVL=1", "PWD=/home/joerg", 
"OLDPWD=/mnt/firewire/Musik", "CFLAGS=-O2 -fPIC -fPIE -Wall -Wf"..., 
"CXXFLAGS=-O2 -fPIC -fPIE -Wall -"..., "LDFLAGS=-Wl,-zrelro,-pie", 
"GREP_OPTIONS=--colour=auto", "LESS=-ij3MRSWz-2", "LESSOPEN=|lesspipe %s", 
"PAGER=less", "TZ=:Europe/Berlin", "LS_COLORS=no=00:fi=00:di=01;34:l"..., 
"LC_ALL=C", "_=/usr/bin/strace"]) = 0 <0.018381>
2406  01:07:20.918837 brk(0)            = 0x1062d000 <0.000036>
2406  01:07:20.919153 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such 
file or directory) <0.000083>
2406  01:07:20.919492 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x48020000 <0.000043>
2406  01:07:20.919714 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such 
file or directory) <0.000041>
2406  01:07:20.919945 open("/etc/ld.so.cache", O_RDONLY) = 3 <0.000071>
2406  01:07:20.920220 fstat64(3, {st_dev=makedev(8, 4), st_ino=1108917, 
st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, 
st_blocks=144, st_size=72151, st_atime=2011/06/17-15:54:30, 
st_mtime=2011/06/17-15:54:30, st_ctime=2011/06/17-15:54:30}) = 0 <0.000030>
2406  01:07:20.920517 mmap(NULL, 72151, PROT_READ, MAP_PRIVATE, 3, 0) = 
0x48023000 <0.000036>
2406  01:07:20.920639 close(3)          = 0 <0.000025>
2406  01:07:20.920761 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such 
file or directory) <0.000037>
2406  01:07:20.920943 open("/lib/powerpc-linux-gnu/librt.so.1", O_RDONLY) = 3 
<0.000110>
2406  01:07:20.921168 read(3, 
"\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\32 \0\0\0004"..., 512) = 
512 <0.000037>
2406  01:07:20.921372 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x48035000 <0.000032>
2406  01:07:20.921545 fstat64(3, {st_dev=makedev(8, 4), st_ino=97776, 
st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, 
st_blocks=72, st_size=34908, st_atime=2011/06/17-15:42:32, 
st_mtime=2011/06/13-01:50:07, st_ctime=2011/06/17-15:42:40}) = 0 <0.000026>
2406  01:07:20.921781 mmap(0xffd7000, 98812, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffd7000 <0.000034>
2406  01:07:20.921907 mprotect(0xffdf000, 61440, PROT_NONE) = 0 <0.000042>
2406  01:07:20.922073 mmap(0xffee000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0xffee000 <0.000059>
2406  01:07:20.939573 close(3)          = 0 <0.000042>
2406  01:07:20.939788 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such 
file or directory) <0.000074>
2406  01:07:20.940092 open("/lib/powerpc-linux-gnu/libc.so.6", O_RDONLY) = 3 
<0.000075>
2406  01:07:20.940289 read(3, 
"\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\372\220\0\0\0004"..., 
512) = 512 <0.000035>
2406  01:07:20.940488 fstat64(3, {st_dev=makedev(8, 4), st_ino=97742, 
st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, 
st_blocks=2936, st_size=1499344, st_atime=2011/06/17-15:42:32, 
st_mtime=2011/06/13-01:50:06, st_ctime=2011/06/17-15:42:40}) = 0 <0.000029>
2406  01:07:20.940741 mmap(0xfe46000, 1574176, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xfe46000 <0.000050>
2406  01:07:20.940888 mprotect(0xffaf000, 65536, PROT_NONE) = 0 <0.000044>
2406  01:07:20.941043 mmap(0xffbf000, 20480, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x169000) = 0xffbf000 <0.000072>
2406  01:07:20.941274 mmap(0xffc4000, 9504, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffc4000 <0.000039>
2406  01:07:20.941458 close(3)          = 0 <0.000025>
2406  01:07:20.941595 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such 
file or directory) <0.000062>
2406  01:07:20.941812 open("/lib/powerpc-linux-gnu/libpthread.so.0", O_RDONLY) 
= 3 <0.000059>
2406  01:07:20.942072 read(3, 
"\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0Qp\0\0\0004"..., 512) = 
512 <0.000035>
2406  01:07:20.942272 fstat64(3, {st_dev=makedev(8, 4), st_ino=97844, 
st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, 
st_blocks=264, st_size=131160, st_atime=2011/06/17-15:42:32, 
st_mtime=2011/06/13-01:50:07, st_ctime=2011/06/17-15:42:40}) = 0 <0.000027>
2406  01:07:20.942506 mmap(0xfe0b000, 172528, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xfe0b000 <0.000042>
2406  01:07:20.942639 mprotect(0xfe23000, 61440, PROT_NONE) = 0 <0.000043>
2406  01:07:20.942762 mmap(0xfe32000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0xfe32000 <0.000049>
2406  01:07:20.954729 mmap(0xfe34000, 4592, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xfe34000 <0.000111>
2406  01:07:20.955170 close(3)          = 0 <0.000032>
2406  01:07:20.955442 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x48036000 <0.000039>
2406  01:07:20.955759 mprotect(0xfe32000, 4096, PROT_READ) = 0 <0.000054>
2406  01:07:20.956532 mprotect(0xffbf000, 16384, PROT_READ) = 0 <0.000062>
2406  01:07:20.956768 mprotect(0xffee000, 4096, PROT_READ) = 0 <0.000039>
2406  01:07:20.956935 mprotect(0x48021000, 4096, PROT_READ) = 0 <0.000037>
2406  01:07:20.957111 munmap(0x48023000, 72151) = 0 <0.000117>
2406  01:07:20.957344 set_tid_address(0x48036168) = 2406 <0.000026>
2406  01:07:20.957449 get_robust_list(0x48036170, 0xc, 0xbfdd4b00) = 0 
<0.000021>
2406  01:07:20.957546 futex(0xbfdd49a8, 
FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 0) = -1 EINVAL 
(Invalid argument) <0.000026>
2406  01:07:20.957750 rt_sigaction(SIGRTMIN, {0xfe10070, [], SA_SIGINFO}, NULL, 
8) = 0 <0.000036>
2406  01:07:20.958104 rt_sigaction(SIGRT_1, {0xfe0fc00, [], 
SA_RESTART|SA_SIGINFO}, NULL, 8) = 0 <0.000030>
2406  01:07:20.958542 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 
<0.000025>
2406  01:07:20.958699 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, 
rlim_max=RLIM_INFINITY}) = 0 <0.000024>
2406  01:07:20.959130 rt_sigaction(SIGUSR1, NULL, {SIG_DFL, [], 0}, 8) = 0 
<0.000029>
2406  01:07:20.959347 rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0 
<0.000023>
2406  01:07:20.959516 rt_sigaction(SIGUSR1, {0x10001270, [INT USR1], 0}, NULL, 
8) = 0 <0.000022>
2406  01:07:20.959677 rt_sigaction(SIGINT, {0x10001260, [INT USR1], 
SA_NODEFER|SA_RESETHAND}, NULL, 8) = 0 <0.000020>
2406  01:07:20.960313 brk(0)            = 0x1062d000 <0.000034>
2406  01:07:20.960458 brk(0x1064e000)   = 0x1064e000 <0.000037>
2406  01:07:20.960769 open("/proc/25302/mem", O_RDONLY|O_LARGEFILE) = 3 
<0.000098>
2406  01:07:20.961066 dup2(3, 0)        = 0 <0.000032>
2406  01:07:20.961195 close(3)          = 0 <0.000022>
2406  01:07:20.961309 _llseek(0, 0, [0], SEEK_CUR) = 0 <0.000024>
2406  01:07:20.961425 open("/tmp/vdso", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 
0666) = 3 <0.000065>
2406  01:07:20.961584 dup2(3, 1)        = 1 <0.000022>
2406  01:07:20.961678 close(3)          = 0 <0.000021>
2406  01:07:20.961858 ioctl(0, MGSL_IOCSTXIDLE or MTIOCGET or 
SNDCTL_MIDI_MPUCMD, 0xbfdd4588) = -1 ENOTTY (Inappropriate ioctl for device) 
<0.000033>
2406  01:07:20.962414 _llseek(0, 1048576, [1048576], SEEK_CUR) = 0 <0.000024>
2406  01:07:20.962581 fstat64(0, {st_dev=makedev(0, 3), st_ino=6138359, 
st_mode=S_IFREG|0600, st_nlink=1, st_uid=1000, st_gid=100, st_blksize=1024, 
st_blocks=0, st_size=0, st_atime=2011/06/19-01:01:32, 
st_mtime=2011/06/19-01:01:32, st_ctime=2011/06/19-01:01:32}) = 0 <0.000028>
2406  01:07:20.963085 write(2, "dd: ", 4) = 4 <0.000827>
2406  01:07:20.964239 write(2, "`/proc/25302/mem': cannot skip t"..., 50) = 50 
<0.000718>
2406  01:07:20.965186 write(2, "\n", 1) = 1 <0.002266>
2406  01:07:20.967699 read(0, 0x1062e000, 4096) = -1 EPERM (Operation not 
permitted) <0.000043>
2406  01:07:20.967946 write(2, "dd: ", 4) = 4 <0.002929>
2406  01:07:20.971172 write(2, "reading `/proc/25302/mem'", 25) = 25 <0.000775>
2406  01:07:20.972263 write(2, ": Operation not permitted", 25) = 25 <0.000688>
2406  01:07:20.973217 write(2, "\n", 1) = 1 <0.005276>
2406  01:07:20.978749 close(0)          = 0 <0.000035>
2406  01:07:20.978900 close(1)          = 0 <0.000023>
2406  01:07:20.979174 write(2, "0+0 records in\n0+0 records out\n", 31) = 31 
<0.002080>
2406  01:07:20.984953 write(2, "0 bytes (0 B) copied", 20) = 20 <0.000337>
2406  01:07:20.985785 write(2, ", 0.0172077 s, 0.0 kB/s\n", 24) = 24 <0.000550>
2406  01:07:20.986594 close(2)          = 0 <0.000028>
2406  01:07:20.986807 exit_group(1)     = ?

I don't know, why dd thinks something went wrong. llseek() and fstat64()
didn't return an error. Accessing the file with Ruby yields the expected
result.

Bye, Jörg.

-- System Information:
Debian Release: unstable/experimental
  APT prefers unstable
  APT policy: (900, 'unstable'), (700, 'experimental')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.39.ledtest-dirty
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages coreutils depends on:
ii  libacl1                      2.2.49-5    Access control list shared library
ii  libattr1                     1:2.4.44-3  Extended attribute shared library
ii  libc6                        2.13-7      Embedded GNU C Library: Shared lib
ii  libselinux1                  2.0.98-1+b1 SELinux runtime shared libraries

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information

Attachment: signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP

Reply via email to