0
Commit Graph

7 Commits

Author SHA1 Message Date
Jose Dapena Paz
7cc1b1d4a7 GCC: also fix StackCanary.ChangingStackCanaryCrashesOnReturn
Create NOOPT compiler specific macro, and use it both in
ResetCanaryAndReturn and in ChangingStackCanaryCrashesOnReturn. For
the latter, it fixes the unit tests in GCC.

Bug: 819294
Change-Id: I1e5e9e4434728c6b1916d43fa4c8225dd71bbcb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5014023
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1221765}
2023-11-08 18:37:28 +00:00
Jose Dapena Paz
f53786808f GCC: fix ResetCanaryAndReturn unit test
GCC does not support the attribute optnone, so ResetCanaryAndReturn
was optimized and failing to assert as expected.

For GCC it should use optimize(0) attribute.

Bug: 819294
Change-Id: I3ca2bccf1d4b0893f4b91f91c306f05454699ee4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4992982
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218980}
2023-11-02 18:22:57 +00:00
Avi Drissman
e4622aaecc Update copyright headers in base/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

An earlier version of this CL, https://crrev.com/c/3879904,
was reverted due to an issue that was resolved with
https://crrev.com/c/3881211.

No-Try: true
Bug: 1098010
Change-Id: Ibd6ffb97e66835bc299fe7b85876c3e2927b2345
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3883841
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1044747}
2022-09-08 20:36:06 +00:00
Daniel Cheng
3d1108defc Revert "Update copyright headers in base/"
This reverts commit eccb7e8107.

Reason for revert: https://crbug.com/1361092

Original change's description:
> Update copyright headers in base/
>
> The methodology used to generate this CL is documented in
> https://crbug.com/1098010#c21.
>
> No-Try: true
> Bug: 1098010
> Change-Id: Icd01cc1648eab4b0550afcff2bee17076359a132
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3879904
> Owners-Override: Avi Drissman <avi@chromium.org>
> Commit-Queue: Avi Drissman <avi@chromium.org>
> Auto-Submit: Avi Drissman <avi@chromium.org>
> Reviewed-by: Mark Mentovai <mark@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1044191}

Bug: 1098010
Change-Id: Iefdde85d3d44fabe09906cd725b39a4e0b359491
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3880811
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1044252}
2022-09-07 23:42:04 +00:00
Avi Drissman
eccb7e8107 Update copyright headers in base/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c21.

No-Try: true
Bug: 1098010
Change-Id: Icd01cc1648eab4b0550afcff2bee17076359a132
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3879904
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1044191}
2022-09-07 21:26:21 +00:00
Avi Drissman
dea3205902 Use [[maybe_unused]] in base/
This cleans up uses of ALLOW_UNUSED_LOCAL, ALLOW_UNUSED_TYPE,
and the non-standard __attribute__((unused)).

Bug: 1286390
Change-Id: I1a1c89d80556e9d460238d01aa2fba94f471a0f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3384277
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: danakj chromium <danakj@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#958834}
2022-01-13 21:31:18 +00:00
Matthew Denton
bb0b03e29b Linux: Add ability to reset stack canaries after fork
Stack protectors remain the same after forking, so reading the stack
protector in one process (e.g. a renderer) reveals to an attacker the
stack protector of the ancestor zygote and its children, including
future children.

This CL adds the capability to reset stack canaries after fork, which
requires the functions already on the call stack to be compiled without
stack protectors (or else they will use the original canary and crash
on return).

A command line flag is added to enable the behavior, which will be added
by default to the chrome command line in a future CL.

Bug: 1206626
Change-Id: I26e53c91986eda2bdf238bf912832649b7a14327
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2895917
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#904353}
2021-07-22 16:18:13 +00:00