Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Issue 2177513002: gpu: Avoid integer overflow when setting up client side buffers (Closed)

Created:
4 years, 5 months ago by robert.bradford
Modified:
4 years, 4 months ago
CC:
chromium-reviews, piman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

gpu: Avoid integer overflow when setting up client side buffers Use gpu::SafeAddInt32 to calculate the number of elements in the buffers whilst avoiding overflow. The code is also refactored slightly to make the setup of buffers conditional on them being supported via the new SupportsClientSideBuffers() check. BUG=629072 TEST=gpu_unittests CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Committed: https://crrev.com/d05fe0bb566dbffcef374f314403c340e4181711 Cr-Commit-Position: refs/heads/master@{#409172}

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -12 lines) Patch
M gpu/command_buffer/client/gles2_implementation.cc View 2 chunks +15 lines, -7 lines 2 comments Download
M gpu/command_buffer/client/vertex_array_object_manager.h View 1 chunk +3 lines, -0 lines 0 comments Download
M gpu/command_buffer/client/vertex_array_object_manager.cc View 2 chunks +8 lines, -5 lines 0 comments Download

Messages

Total messages: 13 (5 generated)
robert.bradford
Hi Ken, is this what you had in mind for https://bugs.chromium.org/p/chromium/issues/detail?id=629072#c7
4 years, 5 months ago (2016-07-22 14:49:09 UTC) #3
Ken Russell (switch to Gerrit)
Robert: thanks very much for this patch. We were all at SIGGRAPH this past week, ...
4 years, 4 months ago (2016-08-02 01:17:55 UTC) #5
piman
LGTM, thanks!
4 years, 4 months ago (2016-08-02 02:54:53 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2177513002/1
4 years, 4 months ago (2016-08-02 10:17:39 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 4 months ago (2016-08-02 11:19:32 UTC) #9
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/d05fe0bb566dbffcef374f314403c340e4181711 Cr-Commit-Position: refs/heads/master@{#409172}
4 years, 4 months ago (2016-08-02 11:21:13 UTC) #11
Zhenyao Mo
https://codereview.chromium.org/2177513002/diff/1/gpu/command_buffer/client/gles2_implementation.cc File gpu/command_buffer/client/gles2_implementation.cc (right): https://codereview.chromium.org/2177513002/diff/1/gpu/command_buffer/client/gles2_implementation.cc#newcode4568 gpu/command_buffer/client/gles2_implementation.cc:4568: SafeAddInt32(first, count, &num_elements); We should generate INVALID_VALUE if SafeAddInt32 ...
4 years, 4 months ago (2016-08-04 17:40:14 UTC) #12
Zhenyao Mo
4 years, 4 months ago (2016-08-04 17:41:44 UTC) #13
Message was sent while issue was closed.
On 2016/08/04 17:40:14, Zhenyao Mo wrote:
>
https://codereview.chromium.org/2177513002/diff/1/gpu/command_buffer/client/g...
> File gpu/command_buffer/client/gles2_implementation.cc (right):
> 
>
https://codereview.chromium.org/2177513002/diff/1/gpu/command_buffer/client/g...
> gpu/command_buffer/client/gles2_implementation.cc:4568: SafeAddInt32(first,
> count, &num_elements);
> We should generate INVALID_VALUE if SafeAddInt32 returns false.
> 
>
https://codereview.chromium.org/2177513002/diff/1/gpu/command_buffer/client/g...
> gpu/command_buffer/client/gles2_implementation.cc:5585: SafeAddInt32(first,
> count, &num_elements);
> Same here.

Sorry about the delayed after-the-fact review.  Just came back from Siggraph and
vacation.  I'll upload the CL to deal with the situation I pointed out.

Thanks for fixing the overflow.

Powered by Google App Engine
This is Rietveld 408576698