Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 395791 - media-video/mplayer-1.0_rc4_p20111215: Xv driver fails to initialize due to (denied) RWX memory allocation
Summary: media-video/mplayer-1.0_rc4_p20111215: Xv driver fails to initialize due to (...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-23 09:39 UTC by Sven Vermeulen (RETIRED)
Modified: 2011-12-23 16:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Vermeulen (RETIRED) gentoo-dev 2011-12-23 09:39:02 UTC
On a hardened system with PaX/grSec both the current ~amd64 version of mplayer as well as the stable one fail when trying to view a video using the Xv driver. The output is as follows:

Player SVN-r34445-4.5.3 (C) 2000-2011 MPlayer Team

Playing /home/swift/Downloads/DSCN9539.MOV.
libavformat file format detected.
[lavf] stream 0: video (mjpeg), -vid 0
[lavf] stream 1: audio (pcm_u8), -aid 0, -alang eng
VIDEO:  [jpeg]  320x240  24bpp  15.000 fps  2167.6 kbps (264.6 kbyte/s)
Clip info:
 creation_time: 2011-12-20 13:54:15
 comment: NIKON DIGITAL CAMERA
 comment-eng: NIKON DIGITAL CAMERA
[VO_XV] It seems there is no Xvideo support for your video card available.
[VO_XV] Run 'xvinfo' to verify its Xv support and read
[VO_XV] DOCS/HTML/en/video.html#xv!
[VO_XV] See 'mplayer -vo help' for other (non-xv) video out drivers.
[VO_XV] Try -vo x11.
LLVM ERROR: Allocation failed when allocating new memory in the JIT
Can't allocate RWX Memory: Operation not permitted

As the error message sais, it tries to allocate RWX memory :

mmap(NULL, 524288, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EPERM (Operation not permitted)
write(2, "LLVM ERROR: Allocation failed wh"..., 119) = 119
exit_group(1)                           = ?

Reproducible: Always




Portage 2.1.10.41 (hardened/linux/amd64/selinux, gcc-4.5.3, glibc-2.13-r4, 3.0.4-hardened-r4 x86_64)
=================================================================
System uname: Linux-3.0.4-hardened-r4-x86_64-Intel-R-_Core-TM-_i5_CPU_M_430_@_2.27GHz-with-gentoo-2.0.3
Timestamp of tree: Thu, 22 Dec 2011 18:00:01 +0000
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.1.4-r3
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.10.3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.4.5, 4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo sjvermeu hardened-dev
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA Broadcom skype-eula AdobeFlash-10.1 Oracle-BCLA-JavaSE google-talkplugin"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en nl fr"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/swift/Development/Centralized/gentoo.overlay /home/swift/Development/Centralized/hardened-dev"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X amd64 apng berkdb bzip2 cairo cli cracklib crypt cups cxx dbus device-mapper dri dvd dynamic gdbm gnutls gpg graphviz gtk hardened iconv imap jpeg justify mmx modules mp3 mudflap multilib ncurses nls nptl nptlonly nsplugin ogg open_perms openmp pam pax_kernel pcre png policykit pppd qemu qt3support readline sasl selinux session smime smtp sse sse2 ssl sysfs tcpd ubac udev unicode urandom v4l2 vde vorbis xetex xorg xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en nl fr" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv nouveau" XFCE_PLUGINS="menu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-23 13:45:27 UTC
At request of kallamej (on #gentoo-hardened) I rebuild mesa with USE="-llvm". The result is a bit different, but mplayer still wants to allocate RWX memory and crashes:

MPlayer SVN-r34445-4.5.3 (C) 2000-2011 MPlayer Team

Playing /home/swift/Downloads/DSCN9539.MOV.
libavformat file format detected.
[lavf] stream 0: video (mjpeg), -vid 0
[lavf] stream 1: audio (pcm_u8), -aid 0, -alang eng
VIDEO:  [jpeg]  320x240  24bpp  15.000 fps  2167.6 kbps (264.6 kbyte/s)
Clip info:
 creation_time: 2011-12-20 13:54:15
 comment: NIKON DIGITAL CAMERA                             
 comment-eng: NIKON DIGITAL CAMERA                             
[VO_XV] It seems there is no Xvideo support for your video card available.
[VO_XV] Run 'xvinfo' to verify its Xv support and read
[VO_XV] DOCS/HTML/en/video.html#xv!
[VO_XV] See 'mplayer -vo help' for other (non-xv) video out drivers.
[VO_XV] Try -vo x11.
[gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==========================================================================
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 7875 Hz, 1 ch, u8, 0.0 kbit/0.00% (ratio: 0->7875)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [alsa] 48000Hz 1ch u8 (1 bytes per sample)
Starting playback...
Movie-Aspect is undefined - no prescaling applied.
VO: [gl_nosw] 320x240 => 320x240 Planar 422P 


MPlayer interrupted by signal 11 in module: decode video
- MPlayer crashed by bad usage of CPU/FPU/RAM.
  Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
  disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.

Strace still shows:

mmap(NULL, 10485760, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EPERM (Operation not permitted)
--- {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xffffffffffffffff} (Segmentation fault) ---
write(2, "\n\nMPlayer interrupted by signal "..., 59) = 59
write(2, "- MPlayer crashed by bad usage o"..., 196) = 196
write(2, "- MPlayer crashed. This shouldn'"..., 335) = 335
ioctl(0, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B38400 opost isig icanon echo ...}) = 0

Other video drivers (like x11) work.
Comment 2 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-23 16:18:54 UTC
As mentioned by Zorry, the mesa gallium driver uses RWX mappings. The classic driver doesn't.