Seccomp check skipped for syscall -1 in straced process and PTRACE_SYSEMU broken

Bug #1854573 reported by Timothy Baldwin
6
This bug affects 1 person
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 f086f67485c5c126bcec4b0e96ac7319a2e59ab8 which attempts to implement PTRACE_SYSEMU.

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-5.3.0-1007-aws 5.3.0-1007.8
ProcVersionSignature: User Name 5.3.0-1007.8-aws 5.3.7
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-0e88d70910be26319
Ec2AMIManifest: (unknown)
Ec2AvailabilityZone: eu-west-1b
Ec2InstanceType: a1.medium
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 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-0ubuntu27.14
Architecture: arm64
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
CRDA: N/A
CasperMD5CheckResult: skip
DistroRelease: Ubuntu 20.04
Ec2AMI: ami-035df3cfe31bdea3b
Ec2AMIManifest: (unknown)
Ec2AvailabilityZone: eu-west-1c
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
PackageArchitecture: arm64
PciMultimedia:

ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=C.UTF-8
 SHELL=/bin/bash
ProcFB:

ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.4.0-1035-aws root=UUID=fe13e7d5-0777-4e3b-9eaf-85a58e21fa9f ro console=ttyS0 nvme_core.io_timeout=4294967295
ProcVersionSignature: Ubuntu 5.4.0-1035.37-aws 5.4.78
RelatedPackageVersions:
 linux-restricted-modules-5.4.0-1035-aws N/A
 linux-backports-modules-5.4.0-1035-aws N/A
 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.asset.tag: i-05c89f713a209b22c
dmi.board.vendor: Amazon EC2
dmi.chassis.asset.tag: Amazon EC2
dmi.chassis.type: 1
dmi.chassis.vendor: Amazon EC2
dmi.modalias: dmi:bvnAmazonEC2:bvr1.0:bd11/1/2018:svnAmazonEC2:pnt4g.nano:pvr:rvnAmazonEC2:rn:rvr:cvnAmazonEC2:ct1:cvr:
dmi.product.name: t4g.nano
dmi.sys.vendor: Amazon EC2

Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote :
Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

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.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote : AudioDevicesInUse.txt

apport information

tags: added: apport-collected focal
description: updated
Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote : Dependencies.txt

apport information

Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote : Lspci.txt

apport information

Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote : ProcModules.txt

apport information

Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote : UdevDb.txt

apport information

Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote : WifiSyslog.txt

apport information

Revision history for this message
Timothy Baldwin (t-e-baldwin99) wrote : acpidump.txt

apport information

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.