Seccomp check skipped for syscall -1 in straced process and PTRACE_SYSEMU broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Incomplete
|
Undecided
|
Unassigned | ||
linux-aws (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
If system call number -1 is called and the process is being traced with PTRACE_SYSCALL, for example by strace, the seccomp check is skipped and -ENOSYS is returned unconditionally (unless altered by the tracer), rather than carrying out action specified in the seccomp filter.
The consequence of this is that it is not possible to reliably strace a seccomp based implementation of a foreign system call interface in which r7/x8 is permitted to be -1 on entry to a system call.
I have traced this bug to commit f086f67485c5c12
Contrary to x86-64 and the man ptrace page which states "For PTRACE_SYSEMU, continue and stop on entry to the next system call, which will not be executed.", on PTRACE_SYSEMU skips the current system call and stops on entry to the next system call.
ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: linux-image-
ProcVersionSign
Uname: Linux 5.3.0-1007-aws aarch64
ApportVersion: 2.20.11-0ubuntu8.2
Architecture: arm64
Date: Sat Nov 30 13:38:28 2019
Ec2AMI: ami-0e88d70910b
Ec2AMIManifest: (unknown)
Ec2Availability
Ec2InstanceType: a1.medium
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=C.UTF-8
SHELL=/bin/bash
SourcePackage: linux-aws
UpgradeStatus: Upgraded to eoan on 2019-11-09 (21 days ago)
---
ProblemType: Bug
AlsaDevices: Error: command ['ls', '-l', '/dev/snd/'] failed with exit code 2: ls: cannot access '/dev/snd/': No such file or directory
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
ApportVersion: 2.20.11-
Architecture: arm64
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
CRDA: N/A
CasperMD5CheckR
DistroRelease: Ubuntu 20.04
Ec2AMI: ami-035df3cfe31
Ec2AMIManifest: (unknown)
Ec2Availability
Ec2InstanceType: t4g.nano
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
Lspci-vt:
-[0000:00]-+-00.0 Amazon.com, Inc. Device 0200
+-01.0 Amazon.com, Inc. Device 8250
+-04.0 Amazon.com, Inc. Device 8061
\-05.0 Amazon.com, Inc. Elastic Network Adapter (ENA)
Lsusb: Error: command ['lsusb'] failed with exit code 1:
Lsusb-t:
Lsusb-v: Error: command ['lsusb', '-v'] failed with exit code 1:
MachineType: Amazon EC2 t4g.nano
Package: linux-aws 5.4.0.1035.36
PackageArchitec
PciMultimedia:
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=C.UTF-8
SHELL=/bin/bash
ProcFB:
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
RelatedPackageV
linux-
linux-
linux-firmware N/A
RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
Tags: focal ec2-images
Uname: Linux 5.4.0-1035-aws aarch64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: N/A
_MarkForUpload: True
dmi.bios.date: 11/1/2018
dmi.bios.vendor: Amazon EC2
dmi.bios.version: 1.0
dmi.board.
dmi.board.vendor: Amazon EC2
dmi.chassis.
dmi.chassis.type: 1
dmi.chassis.vendor: Amazon EC2
dmi.modalias: dmi:bvnAmazonEC
dmi.product.name: t4g.nano
dmi.sys.vendor: Amazon EC2
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1854573
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.