diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-03-09 10:42:20 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-03-10 10:30:38 +0000 |
commit | b789116ca6111fa26c7a6d6ea22513b95c3573af (patch) | |
tree | 5f9cd896be95aee80873d5a0ecbce0d5f2c17b0d | |
parent | cb4427f1e6d04a5387f610049bdbf3785244ed16 (diff) | |
download | qtwebengine-chromium-b789116ca6111fa26c7a6d6ea22513b95c3573af.tar.gz |
[Backport] sandbox: build if glibc 2.34+ dynamic stack size is enabled
Compilation of sandbox fails when using dynamic stack size in glibc
2.34 or newer. This is because the value is not a literal anymore but
obtained through sysconf.
To avoid this, use memset to put zeros in the buffer.
Pick-to: 87-based 90-based 94-based
Change-Id: Iff7ddca815378ab1de2f3ca2d200d8db75f42dd2
Review-URL: https://chromium-review.googlesource.com/c/chromium/src/+/3436947
Cr-Commit-Position: refs/heads/main@{#967943}
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | chromium/sandbox/linux/services/credentials.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chromium/sandbox/linux/services/credentials.cc b/chromium/sandbox/linux/services/credentials.cc index ca6b5954798..c933eafd163 100644 --- a/chromium/sandbox/linux/services/credentials.cc +++ b/chromium/sandbox/linux/services/credentials.cc @@ -100,7 +100,10 @@ bool ChrootToSafeEmptyDir() { // TODO(crbug.com/1247458) Broken in MSan builds after LLVM f1bb30a4956f. clone_flags |= CLONE_VM | CLONE_VFORK | CLONE_SETTLS; - char tls_buf[PTHREAD_STACK_MIN] = {0}; + // PTHREAD_STACK_MIN can be dynamic in glibc2.34+, so it is not possible to + // zeroify tls_buf assigning { 0 } + char tls_buf[PTHREAD_STACK_MIN]; + memset(tls_buf, 0, PTHREAD_STACK_MIN); tls = tls_buf; #endif |