This is the test case taken from
(https://lwn.net/ml/all/cahsh6gs3eh8dfu0wq58c_lf8a4_+o6z456j7bidmcvy2aqo...@mail.gmail.com/)

--- CODE ---
#!/bin/bash

cat > /tmp/x.c << EOF
#include <stdio.h>
#include <seccomp.h>

char *syscalls[] = {
"write",
"exit_group",
};

__attribute__((noinline)) int probed(void)
{
printf("Probed\n");
return 1;
}

void apply_seccomp_filter(char **syscalls, int num_syscalls)
{
scmp_filter_ctx ctx;

ctx = seccomp_init(SCMP_ACT_ERRNO(1));
for (int i = 0; i < num_syscalls; i++) {
seccomp_rule_add(ctx, SCMP_ACT_ALLOW,
seccomp_syscall_resolve_name(syscalls[i]), 0);
}
seccomp_load(ctx);
seccomp_release(ctx);
}

int main(int argc, char *argv[])
{
int num_syscalls = sizeof(syscalls) / sizeof(syscalls[0]);

apply_seccomp_filter(syscalls, num_syscalls);

probed();

return 0;
}
EOF

cat > /tmp/trace.bt << EOF
uretprobe:/tmp/x:probed
{
    printf("ret=%d\n", retval);
}
EOF

gcc -o /tmp/x /tmp/x.c -lseccomp

/usr/bin/bpftrace /tmp/trace.bt &

sleep 5 # wait for uretprobe attach
/tmp/x

pkill bpftrace

rm /tmp/x /tmp/x.c /tmp/trace.bt


** Changed in: linux (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/2098759

Title:
  Processes crash when attaching uretprobes to processes running in
  Docker

Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Oracular:
  Triaged

Bug description:
  SRU Justification:

  Impact: When attaching uretprobes to processes running in Docker, the
  observed processes crash

  This was reported to LKML in
  
https://lwn.net/ml/all/cahsh6gs3eh8dfu0wq58c_lf8a4_+o6z456j7bidmcvy2aqo...@mail.gmail.com/

  Fix: Fixed upstream in Linux Kernel commit cf6cb56ef244 ("seccomp:
  passthrough uretprobe systemcall without filtering"). Merged to stable
  6.12, 6.13 trees.

  Testcase: The original report thread includes a reproduction script.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2098759/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to