-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Brave Ads base::Time::FromLocalExplode
always returns false
from Linux sandbox on non UTC+0 timezones
#20169
Labels
Comments
25 tasks
The corresponding PR has been merged. This issue can be closed. |
tmancey
changed the title
base::Time::FromLocalExpolode always returns false from Linux sandbox on non UTC+0 timezone
Fix Apr 13, 2023
base::Time::FromLocalExplode
always returns false
from Linux sandbox on non UTC+0 timezones
tmancey
changed the title
Fix
Fix Brave Ads Apr 13, 2023
base::Time::FromLocalExplode
always returns false
from Linux sandbox on non UTC+0 timezonesbase::Time::FromLocalExplode
always returns false
from Linux sandbox on non UTC+0 timezones
Blocked until ads has moved to the browser process 100% |
CHECKs were triggered so brave/brave-core#20627 removes those CHECKs. |
Closing as won't fix |
@aseren are we sure the linked bugs are related because they are 14 years old? |
Resolved by #39307 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
base::Time::FromLocalExpolode
uses libcmktime
call which requires access to/etc/timezone
file: https://source.chromium.org/chromium/chromium/src/+/main:base/time/time_exploded_posix.cc;l=107?q=time_exploded_pos&ss=chromiumBut access to filesystem is restricted from sandbox, so
mktime
uses UTC+0 timezone.The problem is that
base::Time::FromLocalExpolode
verifies the results ofmktime
usingbase::Time::LocalExpolode
function which uses local timezone (not UTC+0), because it calls libclocaltime_r
function. In factlocaltime_r
function call is intercepted in browser process thus returns time in local timezone. See:https://bugs.chromium.org/p/chromium/issues/detail?id=16800
https://codereview.chromium.org/165011
https://source.chromium.org/chromium/chromium/src/+/main:sandbox/linux/services/libc_interceptor.cc;l=225?q=libc_interce&ss=chromium
So if local timezone is not UTC+0 then verification step fails and
base::Time::FromLocalExpolode
always returns false here:https://source.chromium.org/chromium/chromium/src/+/main:base/time/time_exploded_posix.cc;l=283?q=time_exploded_pos&ss=chromium
The text was updated successfully, but these errors were encountered: