Skip to content

Commit 30e481b

Browse files
asankahmibrunin
authored andcommitted
[Backport] Security bug 1161379
Manual backport of patch originally reviewed on https://chromium-review.googlesource.com/c/chromium/src/+/2600386: [privacy_budget] Remove unnecessary kCanvasReadback metrics. The identifiability metrics recorded under kCanvasReadback surface type used two conflicting sources as inputs: the CanvasRenderingContext type, and the paint-op digest. There are known collisions between resulting IdentifiableSurface values from the two sources, which makes it impossible to losslessly separate the two during analysis. While the fact that a canvas readback happened is interesting, it doesn't help determine the observed diversity of clients. Hence this change removes one of those sources: the CanvasRenderingContext type. Bug: 1161379 Change-Id: I770cb631c9c4afe4c36d1b129aaf61410db25d43 Commit-Queue: Asanka Herath <[email protected]> Reviewed-by: Caleb Raitto <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Cr-Commit-Position: refs/heads/master@{#847480} Reviewed-by: Jüri Valdmann <[email protected]>
1 parent 0b6e11f commit 30e481b

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

chromium/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,6 @@ ImageBitmap* OffscreenCanvas::transferToImageBitmap(
222222
"ImageBitmap construction failed");
223223
}
224224

225-
RecordIdentifiabilityMetric(
226-
blink::IdentifiableSurface::FromTypeAndToken(
227-
blink::IdentifiableSurface::Type::kCanvasReadback,
228-
context_ ? context_->GetContextType()
229-
: CanvasRenderingContext::kContextTypeUnknown),
230-
0);
231-
232225
return image;
233226
}
234227

chromium/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
#include "third_party/blink/public/common/features.h"
3939
#include "third_party/blink/public/common/privacy_budget/identifiability_metric_builder.h"
4040
#include "third_party/blink/public/common/privacy_budget/identifiability_metrics.h"
41-
#include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h"
42-
#include "third_party/blink/public/common/privacy_budget/identifiable_surface.h"
4341
#include "third_party/blink/public/platform/platform.h"
4442
#include "third_party/blink/public/platform/task_type.h"
4543
#include "third_party/blink/renderer/bindings/modules/v8/rendering_context.h"
@@ -682,13 +680,6 @@ ImageData* CanvasRenderingContext2D::getImageData(
682680
int sw,
683681
int sh,
684682
ExceptionState& exception_state) {
685-
const IdentifiableSurface surface = IdentifiableSurface::FromTypeAndToken(
686-
IdentifiableSurface::Type::kCanvasReadback, GetContextType());
687-
if (IdentifiabilityStudySettings::Get()->ShouldSample(surface)) {
688-
blink::IdentifiabilityMetricBuilder(ukm_source_id_)
689-
.Set(surface, 0)
690-
.Record(ukm_recorder_);
691-
}
692683
return BaseRenderingContext2D::getImageData(sx, sy, sw, sh, exception_state);
693684
}
694685

chromium/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4667,16 +4667,6 @@ void WebGLRenderingContextBase::readPixels(
46674667
GLenum format,
46684668
GLenum type,
46694669
MaybeShared<DOMArrayBufferView> pixels) {
4670-
if (IdentifiabilityStudySettings::Get()->ShouldSample(
4671-
blink::IdentifiableSurface::Type::kCanvasReadback)) {
4672-
const auto& ukm_params = GetUkmParameters();
4673-
blink::IdentifiabilityMetricBuilder(ukm_params.source_id)
4674-
.Set(blink::IdentifiableSurface::FromTypeAndToken(
4675-
blink::IdentifiableSurface::Type::kCanvasReadback,
4676-
GetContextType()),
4677-
0)
4678-
.Record(ukm_params.ukm_recorder);
4679-
}
46804670
ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), 0);
46814671
}
46824672

0 commit comments

Comments
 (0)