[MPlayer-users] player xvidix driver bug prevents normal user from using i

T mlist4suntong at yahoo.com
Thu Oct 12 01:25:23 CEST 2006


Hi, 

when I tried to use the xvidix driver for mplayer, I get
"Error occurred during pci scan: Operation not permitted" error for 
normal user, but root is ok. 

Michael from gmane.linux.distributions.grml.user helped me to track down the
problem. The command 'strace -f -o /tmp/mplayer mplayer -dr -vo xvidix ...'
reveals that:

 [...]
 10541 open("/usr/lib/mplayer/vidix/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 5
 10541 fstat64(5, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
 10541 fcntl64(5, F_SETFD, FD_CLOEXEC)   = 0
 10541 getdents64(5, /* 13 entries */, 4096) = 464
 10541 futex(0xb77a9070, FUTEX_WAKE, 2147483647) = 0
 10541 open("/usr/lib/mplayer/vidix/mga_vid.so", O_RDONLY) = 6
 10541 read(6, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360\7\0"..., 512) = 512
 10541 fstat64(6, {st_mode=S_IFREG|0644, st_size=10500, ...}) = 0
 10541 mmap2(NULL, 13836, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 6, 0) = 0xb5fcb000
 10541 mmap2(0xb5fce000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 6, 0x2) = 0xb5fce000
 10541 close(6)                          = 0
 10541 open("/etc/ld.so.cache", O_RDONLY) = 6
 10541 fstat64(6, {st_mode=S_IFREG|0644, st_size=67617, ...}) = 0
 10541 mmap2(NULL, 67617, PROT_READ, MAP_PRIVATE, 6, 0) = 0xb5fba000
 10541 close(6)                          = 0
 10541 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
 10541 open("/usr/lib/libdha.so.1.0", O_RDONLY) = 6
 10541 read(6, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\324"..., 512) = 512
 10541 fstat64(6, {st_mode=S_IFREG|0644, st_size=224000, ...}) = 0
 10541 mmap2(NULL, 222872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 6, 0) = 0xb5f83000
 10541 mmap2(0xb5fad000, 53248, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 6, 0x2a) = 0xb5fad000
 10541 close(6)                          = 0
 10541 munmap(0xb5fba000, 67617)         = 0
 10541 open("/dev/dhahelper", O_RDWR|O_LARGEFILE) = -1 ENOENT (No such file or directory)
 10541 iopl(0x3)                         = -1 EPERM (Operation not permitted)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ There !!!
 10541 write(1, "[mga] Error occurred during pci "..., 62) = 62
 10541 munmap(0xb5fcb000, 13836)         = 0
 10541 munmap(0xb5f83000, 222872)        = 0
 10541 open("/usr/lib/mplayer/vidix/mach64_vid.so", O_RDONLY) = 6
 [...]
 10541 open("/dev/dhahelper", O_RDWR|O_LARGEFILE) = -1 ENOENT (No such file or directory)
 10541 iopl(0x3)                         = -1 EPERM (Operation not permitted)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ There !!!
 10541 write(1, "[radeon] Error occurred during p"..., 65) = 65
 10541 munmap(0xb7fb2000, 27900)         = 0
 10541 munmap(0xb5f87000, 222872)        = 0
 [...]

Compare with what root get:

 [...]
 10751 iopl(0x3)                         = 0
 10751 iopl(0)                           = 0
 10751 write(1, "[radeon] Found chip: RV280 [Rade"..., 44) = 44
 10751 uname({sys="Linux", node="cxmr.dyndns.org", ...}) = 0
 10751 socket(PF_FILE, SOCK_STREAM, 0)   = 6
 [...]

seems vidix is userspace working with IO which requires root
privileges (http://www.die.net/doc/linux/man/man2/iopl.2.html).

Following his advice, I tred to deactivate the pci scan via specifying the
driver manually, but that failed too:

 $ mplayer -v -v -v -v -dr -vo xvidix:radeon_vid.so -fixed-vo ...
 vosub_vidix: vidix_preinit(radeon_vid.so) was called
 [radeon] Error occurred during pci scan: Operation not permitted
 [VO_SUB_VIDIX] Couldn't find working VIDIX driver.
 Error opening/initializing the selected video_out (-vo) device.

Failing this, I tried to chmod mplayer with suid set, but that won't work
either:

 $ ls -l /usr/bin/mplayer
 -rwsr-x--- 1 root video 3943448 08-02 11:44 /usr/bin/mplayer

 $ strace -f -eopen,iopl -o /tmp/mplayer mplayer -dr -vo xvidix test.mpg
 $ grep iopl /tmp/mplayer
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)
 3929  iopl(0x3)                         = -1 EPERM (Operation not permitted)

I've now run out of ideas. Please help. 

thanks a lot


-- 
Tong (remove underscore(s) to reply)
  http://xpt.sourceforge.net/





More information about the MPlayer-users mailing list