Skip to content

Instantly share code, notes, and snippets.

@Blub
Created July 22, 2015 13:27
Show Gist options
  • Save Blub/bb55648798dc86bc056b to your computer and use it in GitHub Desktop.
Save Blub/bb55648798dc86bc056b to your computer and use it in GitHub Desktop.
libseccomp and 32 bit binaries on 64 bit hosts = bad
# cat umount.c
#include <stdio.h>
#include <sys/mount.h>
int main(int argc, char **argv) {
if (argc != 2) {
fprintf(stderr, "Dumb\n");
return 1;
}
if (umount2(argv[1], MNT_FORCE) != 0) {
perror("umount");
return 2;
}
return 0;
}
# grep Seccomp /proc/self/status
Seccomp: 2
# ls
native.umount umount.c x64.umount
# ./x64.umount /proc/cpuinfo
umount: Permission denied
# ./native.umount /proc/cpuinfo
#
# init 0
# #
@Blub
Copy link
Author

Blub commented Jul 22, 2015

x64.umount was compiled on the host (gcc --static), native.umount in the container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment