Skip to content

Commit

Permalink
Merge bitcoin#24340: util: Add missing unlinkat to syscall sandbox
Browse files Browse the repository at this point in the history
fa45597 util: Add missing unlinkat to syscall sandbox (MarcoFalke)

Pull request description:

  This will be needed for g++-12 (after libstdc++6 12-20220206).

  Steps to reproduce:

  ```
  gdb --args ./src/bitcoind -sandbox=log-and-abort -regtest
  ./src/bitcoin-cli -regtest -named createwallet wallet_name=a descriptors=false
  ./src/bitcoin-cli -regtest stop
  ```

  BT:

  ```
  Thread 1 "b-shutoff" received signal SIGSYS, Bad system call.
  0x00007ffff79564f7 in unlinkat () from /lib/x86_64-linux-gnu/libc.so.6
  (gdb) bt
  #0  0x00007ffff79564f7 in unlinkat () from /lib/x86_64-linux-gnu/libc.so.6
  dashpay#1  0x00007ffff7cc7335 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  dashpay#2  0x00007ffff7cc94e3 in std::filesystem::remove_all(std::filesystem::__cxx11::path const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  dashpay#3  0x00005555559d4918 in wallet::BerkeleyEnvironment::Flush (this=0x7fffc4005160, fShutdown=<optimized out>) at /usr/include/c++/12/bits/fs_path.h:595
  dashpay#4  0x000055555592c058 in wallet::StopWallets (context=...) at /usr/include/c++/12/bits/shared_ptr_base.h:1665
  dashpay#5  0x00005555556617ca in Shutdown (node=...) at ./src/init.cpp:293
  dashpay#6  0x000055555563ada6 in AppInit (argv=<optimized out>, argc=<optimized out>, node=...) at ./src/bitcoind.cpp:249
  dashpay#7  main (argc=<optimized out>, argv=<optimized out>) at ./src/bitcoind.cpp:273

ACKs for top commit:
  laanwj:
    Code review ACK fa45597

Tree-SHA512: e80a38828f8656040954c9befa2d1c9d5170e204dc09c61031633349897f51ccd85cc5c99a089c4726d7f5237875cd9ed3fa8ef864cd6c1c8a2b8250b392d57f
  • Loading branch information
MarcoFalke committed Feb 15, 2022
2 parents 493b115 + fa45597 commit 444b6b3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/util/syscall_sandbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ class SeccompPolicyBuilder
allowed_syscalls.insert(__NR_statfs); // get filesystem statistics
allowed_syscalls.insert(__NR_statx); // get file status (extended)
allowed_syscalls.insert(__NR_unlink); // delete a name and possibly the file it refers to
allowed_syscalls.insert(__NR_unlinkat); // delete relative to a directory file descriptor
}

void AllowFutex()
Expand Down

0 comments on commit 444b6b3

Please sign in to comment.