Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 729046 - dev-util/ltrace: [TEST] test ltrace.minor/attach-process blocked by Yama
Summary: dev-util/ltrace: [TEST] test ltrace.minor/attach-process blocked by Yama
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Marek Szuba
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2020-06-21 20:31 UTC by Toralf Förster
Modified: 2021-07-13 12:13 UTC (History)
0 users

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


Attachments
emerge-info.txt (emerge-info.txt,14.58 KB, text/plain)
2020-06-21 20:31 UTC, Toralf Förster
Details
dev-util:ltrace-0.7.3_p4-r1:20200621-202322.log (dev-util:ltrace-0.7.3_p4-r1:20200621-202322.log,62.25 KB, text/plain)
2020-06-21 20:31 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,17.95 KB, text/plain)
2020-06-21 20:31 UTC, Toralf Förster
Details
environment (environment,63.80 KB, text/plain)
2020-06-21 20:31 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,13.61 KB, application/x-bzip)
2020-06-21 20:31 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,14.84 KB, application/x-bzip)
2020-06-21 20:31 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,24.45 KB, application/x-bzip)
2020-06-21 20:31 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2020-06-21 20:31:27 UTC
Running ./ltrace.main/system_calls.exp ...
Running ./ltrace.minor/attach-process.exp ...
FAIL: test case execution failed
exec env LD_LIBRARY_PATH=/var/tmp/portage/dev-util/ltrace-0.7.3_p4-r1/work/ltrace-0.7.3/testsuite/ltrace.minor /var/tmp/portage/dev-util/ltrace-0.7.3_p4-r1/work/ltrace-0.7.3/testsuite/../ltrace -o /var/tmp/portage/dev-util/ltrace-0.7.3_p4-r1/temp/lt-DF8thWnn2c.ltrace -S -p 1117Cannot attach to pid 1117: Operation not permitted
    while executing
exec env LD_LIBRARY_PATH=/var/tmp/portage/dev-util/ltrace-0.7.3_p4-r1/work/ltrace-0.7.3/testsuite/ltrace.minor /var/tmp/portage/dev-util/ltrace-0.7.3_...

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_systemd-test-20200620-211522

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-10.1.0 *
Available Python interpreters, in order of preference:
  [1]   python3.7
  [2]   python3.9 (fallback)
  [3]   python3.8 (fallback)
  [4]   python2.7 (fallback)

  timestamp(s) of HEAD at this tinderbox image:
/var/db/repos/gentoo	Sun 21 Jun 2020 08:05:29 PM UTC

emerge -qpvO dev-util/ltrace
[ebuild  N    ] dev-util/ltrace-0.7.3_p4-r1  USE="test -debug (-selinux) -unwind"
Comment 1 Toralf Förster gentoo-dev 2020-06-21 20:31:33 UTC
Created attachment 645562 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2020-06-21 20:31:36 UTC
Created attachment 645564 [details]
dev-util:ltrace-0.7.3_p4-r1:20200621-202322.log
Comment 3 Toralf Förster gentoo-dev 2020-06-21 20:31:39 UTC
Created attachment 645566 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2020-06-21 20:31:41 UTC
Created attachment 645568 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2020-06-21 20:31:44 UTC
Created attachment 645570 [details]
etc.portage.tbz2
Comment 6 Toralf Förster gentoo-dev 2020-06-21 20:31:48 UTC
Created attachment 645572 [details]
logs.tbz2
Comment 7 Toralf Förster gentoo-dev 2020-06-21 20:31:51 UTC
Created attachment 645574 [details]
temp.tbz2
Comment 8 Toralf Förster gentoo-dev 2020-06-21 20:32:21 UTC
FWIW there's bug 688526 too but this looks different at a first glance.
Comment 9 Sergei Trofimovich (RETIRED) gentoo-dev 2020-06-21 20:38:19 UTC
Looks similar. Is it deterministically failing if you try again?
Comment 10 Toralf Förster gentoo-dev 2020-06-24 09:51:54 UTC
(In reply to Sergei Trofimovich from comment #9)
> Looks similar. Is it deterministically failing if you try again?

at *this* image - yes (but I do currently have only 1 test image running)
Comment 11 Marek Szuba archtester gentoo-dev 2021-07-12 15:30:20 UTC
I think I've reproduced this.
Toralf: What have you got in /proc/sys/kernel/yama/ptrace_scope ?
Comment 12 Larry the Git Cow gentoo-dev 2021-07-13 11:21:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea8a4b3bcf6a0a57f7cdb8e4d37ff62d099cb6a4

commit ea8a4b3bcf6a0a57f7cdb8e4d37ff62d099cb6a4
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2021-07-13 10:57:54 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2021-07-13 11:20:54 +0000

    dev-util/ltrace: skip the attach-process test
    
    On modern kernels with the Yama security module enabled the default
    ptrace behaviour is that a process must have a predefined relationship
    with the inferior it wants to call ``PTRACE_ATTACH`` on, with two
    additional modes restricting process tracing even more; for details see
    [1]. As a result, unless Yama is explicitly reset to classic ptrace
    permissions the ltrace attach-process test fails due to
    insufficient permissions - regardless of the sandbox, or even when the
    test suite is run manually with no involvement of a Gentoo package
    manager.
    
    We could in principle modify the test in question to be compatible with
    restricted-ptrace mode, however it would still fail on systems with
    Yama in admin-attach and no-attach mode. Between that and requiring the
    user to reconfigure Yama prior to running this test being IMHO a Bad
    Idea, just don't bother with this test at all.
    
    [1] https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
    
    Closes: https://bugs.gentoo.org/729046
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 dev-util/ltrace/ltrace-0.7.3.6.1.ebuild   | 4 ++++
 dev-util/ltrace/ltrace-0.7.3_p4-r1.ebuild | 4 ++++
 2 files changed, 8 insertions(+)
Comment 13 Toralf Förster gentoo-dev 2021-07-13 12:13:47 UTC
(In reply to Marek Szuba from comment #11)
> Toralf: What have you got in /proc/sys/kernel/yama/ptrace_scope ?

There's no file at the build host - and the image is chanined with bubblewrap