Status Update
Comments
na...@google.com <na...@google.com> #2
[Monorail components: Blink>MemoryAllocator]
sa...@google.com <sa...@google.com> #3
kr...@chromium.org <kr...@chromium.org> #4
Note:Adding OS=Chrome and Android since this is Blink related
Reproducible
===========
92.0.4486.2 - Canary
92.0.4484.7 - Dev
91.0.4472.19- Beta
90.0.4430.85- Stable
Bisect Information:
----------------------------
Good Build: 89.0.4325.0
Bad Build: 89.0.4326.0
Change Log:
============
Suspecting below from the change log:
================================
Change-Id: I9e15d17dcfbe907ca5df8e00a7f77851cdc31e22
Reviewed-on:
bartekn@: Requesting you to please have a look into the issue, pardon me if it has nothing to do with your changes and if possible please assign it to owner concerned.
Thanks..!!
ba...@chromium.org <ba...@chromium.org> #5
[Monorail components: -Blink>MemoryAllocator Blink>MemoryAllocator>Partition]
li...@chromium.org <li...@chromium.org> #6
We could lift this restriction, even though large allocations like that are likely to fail in many cases, on many clients. Meaning that your code has to be prepared for these allocations to fail. Sadly, much lower allocations do fail as well in a variety of cases.
However, this is not a simple constant change, since we would need to audit all the ArrayBuffer paths and make sure that we don't have any integer overflow hiding there. So it would take some time.
@reporter: Can you break down these allocations into smaller ones, and not have all memory allocated at all times? This would be required to work on 32 bit clients, and likely more or less required to work on many 64 bit ones as well, since Chrome limits the per-renderer memory footprint, and as a consequence, allocating several GB is likely to result in an Out Of Memory crash anyway.
iv...@gmail.com <iv...@gmail.com> #7
All I am asking is not to kill a website for asking a certain memory, when there is ten times that amount of memory free. Today, we have phones with 12 GB of RAM.
Could you do at least what Firefox does?
li...@chromium.org <li...@chromium.org> #8
- Per-process limits: preventing sites from unknowingly bringing a machine to its knees. A single memory leak in an iframe somewhere can end up consuming multiple GiB, in which case it's likely better to crash the tab rather than rendering the machine unusable. That being said, on a 16GiB machine, the limit is pretty high (don't remember it of the top of my head, but should be large enough for you)
- Mitigating int overflow issues: there is a long history of "int"s being used for array sizes, leading to exploitable bugs.
The second one is the reason why we need to be careful with lifting the limit. I agree with you though, we should aim at raising the limit to allow powerful web applications to take advantage of it on machines with large amounts of memory.
[Deleted User] <[Deleted User]> #9
Thanks for your time! To disable nags, add the Disable-Nags label.
For more details visit
iv...@gmail.com <iv...@gmail.com> #10
pa...@chromium.org <pa...@chromium.org> #11
We'll probably want to keep some limit. But if we can do the audit and add the tests, I can imagine that we could increase the ArrayBuffer size limit. The audit and the tests are a good idea anyway; fixes would be to use the right type everywhere (size_t, not int) and use base/numerics to make sure the arithmetic is safe.
ba...@google.com <ba...@google.com> #12
Given everything that was said above, I think a 3~4GB limit isn't unreasonable.
ha...@chromium.org <ha...@chromium.org> #13
Do we need to support 4+ GiB allocations? If yes, we need to replace int32_t with size_t, in addition to the auditing and testing.
ha...@chromium.org <ha...@chromium.org> #14
iv...@gmail.com <iv...@gmail.com> #15
yu...@chromium.org <yu...@chromium.org> #16
pa...@google.com <pa...@google.com> #17
[Deleted User] <[Deleted User]> #18
Thanks for your time! To disable nags, add the Disable-Nags label.
For more details visit
iv...@gmail.com <iv...@gmail.com> #19
[Deleted User] <[Deleted User]> #20
Thanks for your time! To disable nags, add the Disable-Nags label.
For more details visit
pa...@chromium.org <pa...@chromium.org> #21
[Deleted User] <[Deleted User]> #22
Thanks for your time! To disable nags, add the Disable-Nags label.
For more details visit
iv...@gmail.com <iv...@gmail.com> #23
The volume of RAM in devices will probably keep growing, to hundreds of gigabytes in the future. So you will have to change it at some point anyway.
ba...@chromium.org <ba...@chromium.org> #24
ai...@gmail.com <ai...@gmail.com> #25
// Allocate 65536 pages. 1 page == 64KB
const mem = new WebAssembly.Memory({initial: 65536})
// Pass the memory buffer to the Uint8Array constructor
const u8arr = new Uint8Array(mem.buffer)
ha...@google.com <ha...@google.com> #26
ba...@chromium.org <ba...@chromium.org> #27
gi...@appspot.gserviceaccount.com <gi...@appspot.gserviceaccount.com> #28
commit fd3d255e519b9dbc696e0d175744df34fff640ae
Author: danakj <danakj@chromium.org>
Date: Thu Jan 06 18:12:36 2022
Add a GN config that warns about unsafe integer narrowing.
We currently build without -Wconversion (it's not part of -Wall, see
-Wno-c++11-narrowing. This allows unsafe implicit narrowing conversions
or sign-mismatch comparisons that are likely to result in read/write
out of bounds, Undefined Behaviour, or other security breaches through
memory safety bugs.
Historically we mitigated against such bugs by artificially limiting
allocations to be < 2GB so that their sizes, indices, and offsets,
would fit within 31 bits. This allows an `int` to be misused but still
able to address the entire address space of any given allocation.
We would like to increase the allocation limit, which means we must
address the technical debt of these unsafe implicit conversions and
comparisons.
This CL introduces the prevent_unsafe_narrowing GN config, which when
enabled adds warnings to the GN target, which will produce errors in
problematic cases. Note that the config ignores the fact we also pass
-Wno-narrowing -Wno-c++11-narrowing, since -Wshorten-64-to-32 also
warns in the same scenarios, if narrowing a 64-bit integer to 32 bits
(see
R=thakis@chromium.org
Bug: 1201109
Change-Id: I54d8f2a00191594dab0cc4f6d65c96b822a2f6c4
Reviewed-on:
Reviewed-by: Yuki Yamada <yukiy@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: danakj chromium <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#956170}
[modify]
da...@chromium.org <da...@chromium.org> #29
gi...@appspot.gserviceaccount.com <gi...@appspot.gserviceaccount.com> #30
commit b198fc2d402925f11cc86c5acb1a6084c2984ae1
Author: danakj <danakj@chromium.org>
Date: Thu Jan 13 20:46:02 2022
Avoid underflow if the relative_offset is a large negative number
If the relative_offset would produce a number less than 0, return
nullptr instead of wrapping around to return a potentially incorrect
sibling.
This came up when looking for bad unsigned comparisons.
Bug: 1201109
Change-Id: I9dee1357e6f8a7bbb0b8b5e5a4978c01cb433ebe
Reviewed-on:
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: danakj chromium <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#958808}
[modify]
yu...@google.com <yu...@google.com> #31
yu...@google.com <yu...@google.com> #32
iv...@gmail.com <iv...@gmail.com> #33
Now, he wrote me, that he tried it in Firefox, and it worked. And I am shocked.
Then, I remembered this issue, which is probably the reason it crashed in Chrome. Guys, please, put more effort into fixing it, it is really important. I really appreciate your work!
ba...@chromium.org <ba...@chromium.org> #34
al...@gmail.com <al...@gmail.com> #35
ba...@chromium.org <ba...@chromium.org> #36
ba...@chromium.org <ba...@chromium.org> #37
ar...@etoro.com <ar...@etoro.com> #38
gi...@appspot.gserviceaccount.com <gi...@appspot.gserviceaccount.com> #39
commit 6a1d746dafa867af9078367317779e2789d9217c
Author: Andreas Haas <ahaas@chromium.org>
Date: Fri Apr 29 18:09:02 2022
[arraybuffer] Protect Blink from 2+GB ArrayBuffers
R=haraken@chromium.org
CC=clemensb@chromium.org, danakj@chromium.org
Bug: chromium:1201109
Change-Id: I8f393957e166c3fc4a6a5cb5e56cfec539a61511
Reviewed-on:
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#997800}
[modify]
[modify]
[modify]
gi...@appspot.gserviceaccount.com <gi...@appspot.gserviceaccount.com> #40
commit 9be133e40586ca7c170ed539fc5680a829d6bcff
Author: Andreas Haas <ahaas@chromium.org>
Date: Sat Apr 30 11:46:17 2022
Revert "[arraybuffer] Protect Blink from 2+GB ArrayBuffers"
This reverts commit 6a1d746dafa867af9078367317779e2789d9217c.
Reason for revert: Breaks Photoshop
Original change's description:
Bug: chromium:1201109
Change-Id: I79cba720a921383c64da6d78a6e1875e045ea3d1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on:
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Andreas Haas <ahaas@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#998084}
[modify]
[modify]
[modify]
gi...@appspot.gserviceaccount.com <gi...@appspot.gserviceaccount.com> #41
commit c324a89710943b2544b9049767225e337fb1e6b5
Author: Andreas Haas <ahaas@chromium.org>
Date: Thu May 05 05:53:55 2022
Reland "[arraybuffer] Protect Blink from 2+GB ArrayBuffers"
The original CL broke postmessage of bounds checks, which was used by
Photoshop to share WebAssembly memory to workers. This CL adds an
additional function that does not do the bounds check on ArrayBuffers.
R=haraken@chromium.org, adamk@chromium.org
CC=clemensb@chromium.org, danakj@chromium.org
Bug: chromium:1201109
Change-Id: I0655746061dddbbb448abb28a41f46d54f0e8e57
Reviewed-on:
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999760}
[add]
[modify]
[modify]
[add]
[add]
[modify]
[modify]
gi...@appspot.gserviceaccount.com <gi...@appspot.gserviceaccount.com> #42
commit 2441efc1406fa02b334fad353bcb19b5de6f3e87
Author: Meredith Lane <meredithl@chromium.org>
Date: Thu May 05 07:55:06 2022
Revert "Reland "[arraybuffer] Protect Blink from 2+GB ArrayBuffers""
This reverts commit c324a89710943b2544b9049767225e337fb1e6b5.
Reason for revert: Fails on Win7 build starting from
Original change's description:
Bug: chromium:1201109
Change-Id: I6ffa3adcf5615fac0f3fdfd7c011e309caae5152
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on:
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Owners-Override: Meredith Lane <meredithl@chromium.org>
Auto-Submit: Meredith Lane <meredithl@chromium.org>
Reviewed-by: Meredith Lane <meredithl@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Meredith Lane <meredithl@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999785}
[delete]
[modify]
[modify]
[delete]
[delete]
[modify]
[modify]
gi...@appspot.gserviceaccount.com <gi...@appspot.gserviceaccount.com> #43
commit 37c9cdad584891bd057ced018531840078899ae5
Author: Andreas Haas <ahaas@chromium.org>
Date: Fri May 06 04:30:34 2022
Reland^2 "[arraybuffer] Protect Blink from 2+GB ArrayBuffers"
The tests in the original CL allocated big amounts of memory, which
failed on some bots. The new CL checks if allocation succeeded or not.
Bug: chromium:1201109
Change-Id: Ib6bb6938e869788d0939fd9f66cba2003fc3efd1
Reviewed-on:
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1000244}
[add]
[delete]
[modify]
[modify]
[add]
[add]
[modify]
[modify]
ms...@chromium.org <ms...@chromium.org> #44
gi...@appspot.gserviceaccount.com <gi...@appspot.gserviceaccount.com> #45
commit 042ad65fa4ee3883a73445de66d446f258b2ffa7
Author: Kenneth Russell <kbr@chromium.org>
Date: Wed Jun 15 02:45:05 2022
Guard against too-large arrays passed to uniform*v.
Catch situations where computing the byte size of the incoming array
would overflow.
Beyond this, detect failures to allocate space in CommandBufferHelper.
In this situation, persistently lose the context client-side. Remove
DCHECKs preventing these guards from being reached.
Add new feature to disable ArrayBuffer size restrictions for testing.
Use it in the new test; it is required for it to pass.
Bug: 1316368
Bug: 1201109
Change-Id: Ic345aed296e2d9a3f44e33c4c207e12b64c4f312
Reviewed-on:
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Gregg Tavares <gman@chromium.org>
Reviewed-by: Victor Miura <vmiura@chromium.org>
Reviewed-by: Martin Kreichgauer <martinkr@google.com>
Cr-Commit-Position: refs/heads/main@{#1014267}
[modify]
[modify]
[modify]
[modify]
[modify]
[modify]
[add]
[modify]
[modify]
[modify]
[modify]
[modify]
[modify]
[modify]
[modify]
[modify]
[modify]
[modify]
[modify]
kb...@chromium.org <kb...@chromium.org> #46
kb...@chromium.org <kb...@chromium.org> #47
kb...@chromium.org <kb...@chromium.org> #48
iv...@gmail.com <iv...@gmail.com> #49
ba...@chromium.org <ba...@chromium.org> #50
We tried going in the direction that our security team proposed, that'd allow us to raise the allocator limit across the board. Upon attempting to implement, we found we needed to reevaluate what we can feasibly accomplish. You can read more details here
We did, however, reach a viable compromise that will allow us to raise the allocator limit specific to ArrayBuffers, which is what you care about. But first we'll have to harden the code around it. Here is the action plan that we follow:
1) Land the 2 GB limit check to the V8 -> C++ conversion layer.
2) Land the 2 GB limit check to places where C++ allocates ArrayBuffers.
3) Increase the memory limit of PA's ArrayBuffer partition.
1) has already been completed. 2) will happen no earlier than in Q1. 3) should be easy once the other two are completed.
je...@changehealthcare.com <je...@changehealthcare.com> #51
memory = new WebAssembly.Memory({initial: 60000,maximum: 60000});
You can even create sharedArrayBuffers in this way and you can grow them in place. 🤯
It's a bit of an odd workaround, but given it exists the security arguments in the linked document feels a bit moot?
da...@chromium.org <da...@chromium.org> #52
This keeps the large array buffers from leaking from Wasm into C++ code.
je...@changehealthcare.com <je...@changehealthcare.com> #53
const memory = new WebAssembly.Memory({initial: 60000,maximum: 60000});
const a = new Uint8Array(memory.buffer)
an use it happily (and presumably safely), why can't I
const b = new Uint8Array(3932160000) // Uncaught RangeError: Array buffer allocation failed
Obviously the plumbing is there to support 4GB ArrayBuffers since WASM added support for 4GB heap?
ha...@google.com <ha...@google.com> #54
ha...@google.com <ha...@google.com> #55
ha...@google.com <ha...@google.com> #56
is...@google.com <is...@google.com> #57
[Monorail blocked-on:
[Monorail mergedwith:
[Monorail components added to Component Tags custom field.]
iv...@gmail.com <iv...@gmail.com> #58
cl...@chromium.org <cl...@chromium.org> #59
Can you verify if this works for your webapp now?
iv...@gmail.com <iv...@gmail.com> #60
cl...@chromium.org <cl...@chromium.org> #61
ba...@google.com <ba...@google.com> #62
Thanks for continuous care, Ivan. Can you try the suggestion in
iv...@gmail.com <iv...@gmail.com> #63
I need to allocate a long Uint8Array to hold the color values of an image.
ml...@chromium.org <ml...@chromium.org> #64
With
ba...@google.com <ba...@google.com> #65
I do not know much about Webassembly, I am not using Webassembly in this case. So I dont know what the "suggestion" means :(
I should've pointed to
With
we can effectively create an Uint8Array that can e.g. be passed into the Blob API. If those checks are not already in place then it's already possible to leak such buffers into C++, no? #comment51
To clarify my understanding (and I hope security folks here can correct me if I'm wrong), I believe new Uint8Array(2146*1000*1000);
and const memory = new WebAssembly.Memory({initial: 32746,maximum: 32746}); new Uint8Array(memory.buffer);
are equivalent in terms of the security risk. IIUC work done in
The remaining difference now is the implementation complexity. The former method operates on page granularity, hence simply maps in entire pages, which is trivial. The latter operates on byte granularity, hence uses a memory allocator (PartitionAlloc), which would be more complicated to adapt to >2GB allocations. Also I should mention that PartitionAlloc is used for multiple other purposes, and we definitely don't want to increase the 2GB limit there, so that creates an additional complication.
iv...@gmail.com <iv...@gmail.com> #66
But if it is so simple, why cant you make the new Uint8Array(...) work? It works fine in Firefox.
Description
I have 24 GB of RAM, 16 GB of which is free.
I am developing a photo editor
This works very well in Firefox. I think it used to work in previous versions of Chrome, too.