Bug 1477776 - torsocks disallows sched_getaffinity syscall
torsocks disallows sched_getaffinity syscall
Status: NEW
Product: Fedora
Classification: Fedora
Component: torsocks (Show other bugs)
26
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jamie Nguyen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-02 18:20 EDT by Kyle Marek
Modified: 2017-08-02 18:23 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kyle Marek 2017-08-02 18:20:09 EDT
Description of problem:
I discovered the issue while using youtube-dl through torsocks with ffmpeg installed from rpmfusion. While third party repositories are unsupported, it should not be ignored that torsocks is currently disallowing this syscall.

When ffmpeg is present on the system, youtube-dl uses it. Even when using -f best to download a single file, youtube-dl starts an ffmpeg process before it begins to download. ffmpeg inherits the syscall wrapping from torsocks. ffmpeg not being allowed to use this syscall is currently troublesome as it endlessly leaks memory until killed. A system with 16 GiB of swap is unusable for a significant amount of time once primary memory is full.

Version-Release number of selected component (if applicable):
torsocks-2.1.0-4.fc26.x86_64

How reproducible:
100%

Steps to Reproduce:
1. run: sudo dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
2. run: sudo dnf install -y ffmpeg
3. observe effects of running: ffmpeg -hide_banner -nostdin -y -f lavfi -i anullsrc -t 1 -f s16le /dev/null
4. observe effects of running: torsocks ffmpeg -hide_banner -nostdin -y -f lavfi -i anullsrc -t 1 -f s16le /dev/null

Actual results:
Lots of: 
[Aug 02 18:14:48] WARNING torsocks[2224]: [syscall] Unsupported syscall number 204. Denying the call (in tsocks_syscall() at syscall.c:465)

Memory usage rises at a constant rate.

Expected results:
Input #0, lavfi, from 'anullsrc':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_u8 (native) -> pcm_s16le (native))
Output #0, s16le, to '/dev/null':
  Metadata:
    encoder         : Lavf57.71.100
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
    Metadata:
      encoder         : Lavc57.89.100 pcm_s16le
size=     172kB time=00:00:01.00 bitrate=1411.2kbits/s speed= 267x    
video:0kB audio:172kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

Additional info:
[kmarek@youtube-dl-test ~]$ file "$(which ffmpeg)"
/usr/bin/ffmpeg: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=c1cb958a8e44766d5ac79ba345bdb47b86b13182, stripped
[kmarek@youtube-dl-test ~]$ ausyscall x86_64 --dump | grep '^204'
204	sched_getaffinity
[kmarek@youtube-dl-test ~]$ grep '204$' /usr/include/asm/unistd_64.h
#define __NR_sched_getaffinity 204
Comment 1 Kyle Marek 2017-08-02 18:23:36 EDT
Is it a bug for a program to not handle syscalls failing? (should they ever fail?)

Note You need to log in before you can comment on or make changes to this bug.