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

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2018-05-29 07:51:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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):

How reproducible:

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':
    encoder         : Lavf57.71.100
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
      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?)
Comment 2 Fedora End Of Life 2018-05-03 04:26:43 EDT
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Comment 3 Fedora End Of Life 2018-05-29 07:51:38 EDT
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 4 Kyle Marek 2018-05-29 10:46:30 EDT
Fixed in Fedora 28: torsocks-2.2.0-1.fc28.x86_64

See upstream fix: https://gitweb.torproject.org/torsocks.git/commit/src/lib/syscall.c?id=e389c99937a35815e2752952634cc80c3aaf1d4e

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