diff --git a/chromium-101.0.4951.41-libxml-unbundle.patch b/chromium-101.0.4951.41-libxml-unbundle.patch deleted file mode 100644 index 5699bc8..0000000 --- a/chromium-101.0.4951.41-libxml-unbundle.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/build/linux/unbundle/libxml.gn -+++ b/build/linux/unbundle/libxml.gn -@@ -19,6 +19,7 @@ static_library("libxml_utils") { - ":xml_reader", - ":xml_writer", - "//base/test:test_support", -+ "//services/data_decoder:lib", - "//services/data_decoder:xml_parser_fuzzer_deps", - ] - sources = [ diff --git a/chromium-102.0.5005.61-iwyu-add-utility-for-std-exchange.patch b/chromium-102.0.5005.61-iwyu-add-utility-for-std-exchange.patch deleted file mode 100644 index 3bc4693..0000000 --- a/chromium-102.0.5005.61-iwyu-add-utility-for-std-exchange.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9dd0503835dc875807ab63efb1f477bffed2a852 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Mon, 25 Apr 2022 23:18:30 +0000 -Subject: [PATCH] IWYU: add utility for std::exchange - -Bug: 957519 -Change-Id: I307d520fdc34d2452018ed32a505e7e519739410 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3604643 -Reviewed-by: Wez -Commit-Queue: Stephan Hartmann -Cr-Commit-Position: refs/heads/main@{#995855} ---- - base/third_party/symbolize/symbolize.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/base/third_party/symbolize/symbolize.h b/base/third_party/symbolize/symbolize.h -index 99029a968d5..278078f6071 100644 ---- a/base/third_party/symbolize/symbolize.h -+++ b/base/third_party/symbolize/symbolize.h -@@ -61,6 +61,7 @@ - #ifdef HAVE_SYMBOLIZE - - #include -+#include - - #if defined(__ELF__) // defined by gcc - #if defined(__OpenBSD__) diff --git a/chromium-102.0.5005.61-remove-no-opaque-pointers-flag.patch b/chromium-102.0.5005.61-remove-no-opaque-pointers-flag.patch deleted file mode 100644 index a8eba73..0000000 --- a/chromium-102.0.5005.61-remove-no-opaque-pointers-flag.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- chromium-102.0.5005.61/build/config/compiler/BUILD.gn.orig 2022-05-19 10:35:52.991415777 +0000 -+++ chromium-102.0.5005.61/build/config/compiler/BUILD.gn 2022-05-19 10:36:11.102017131 +0000 -@@ -1538,15 +1538,6 @@ config("default_warnings") { - cflags += [ "-Wno-deprecated-non-prototype" ] - } - -- if (!is_nacl && !(is_chromeos || -- default_toolchain == "//build/toolchain/cros:target")) { -- # TODO(https://crbug.com/1316298): Re-enable once test failure is figured out -- cflags += [ -- "-Xclang", -- "-no-opaque-pointers", -- ] -- } -- - if (is_fuchsia) { - # TODO(https://bugs.chromium.org/p/fuchsia/issues/detail?id=77383) - cflags += [ "-Wno-deprecated-copy" ] diff --git a/chromium-104.0.5112.79-remove-no-opaque-pointers-flag.patch b/chromium-104.0.5112.79-remove-no-opaque-pointers-flag.patch deleted file mode 100644 index 9bd434a..0000000 --- a/chromium-104.0.5112.79-remove-no-opaque-pointers-flag.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- chromium-104.0.5112.57/build/config/compiler/BUILD.gn.orig 2022-07-26 08:11:54.192788877 +0000 -+++ chromium-104.0.5112.57/build/config/compiler/BUILD.gn 2022-07-26 08:12:10.019328155 +0000 -@@ -1540,15 +1540,6 @@ config("default_warnings") { - cflags += [ "-Wno-unqualified-std-cast-call" ] - } - -- if (!is_nacl && !(is_chromeos || -- default_toolchain == "//build/toolchain/cros:target")) { -- # TODO(https://crbug.com/1322823): Remove flags once potential miscompile is investigated. -- cflags += [ -- "-Xclang", -- "-no-opaque-pointers", -- ] -- } -- - if (is_fuchsia) { - # TODO(https://bugs.chromium.org/p/fuchsia/issues/detail?id=77383) - cflags += [ "-Wno-deprecated-copy" ] diff --git a/chromium-104.0.5112.79-roll-src-third_party-ffmpeg.patch b/chromium-104.0.5112.79-roll-src-third_party-ffmpeg.patch deleted file mode 100644 index e739b40..0000000 --- a/chromium-104.0.5112.79-roll-src-third_party-ffmpeg.patch +++ /dev/null @@ -1,333 +0,0 @@ -From 6e554a30893150793c2638e3689cf208ffc8e375 Mon Sep 17 00:00:00 2001 -From: Dale Curtis -Date: Sat, 2 Apr 2022 05:13:53 +0000 -Subject: [PATCH] Roll src/third_party/ffmpeg/ 574c39cce..32b2d1d526 (1125 - commits) - -https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/574c39cce323..32b2d1d526 - -Created with: - roll-dep src/third_party/ffmpeg - -Fixed: 1293918 -Cq-Include-Trybots: luci.chromium.try:mac_chromium_asan_rel_ng,linux_chromium_asan_rel_ng,linux_chromium_chromeos_asan_rel_ng -Change-Id: I41945d0f963e3d1f65940067bac22f63b68e37d2 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3565647 -Auto-Submit: Dale Curtis -Reviewed-by: Dan Sanders -Commit-Queue: Dale Curtis -Cr-Commit-Position: refs/heads/main@{#988253} ---- - .../clear_key_cdm/ffmpeg_cdm_audio_decoder.cc | 29 ++++++++++--------- - media/ffmpeg/ffmpeg_common.cc | 11 +++---- - media/filters/audio_file_reader.cc | 9 +++--- - media/filters/audio_file_reader_unittest.cc | 6 ++-- - .../filters/audio_video_metadata_extractor.cc | 11 +++++-- - .../filters/ffmpeg_aac_bitstream_converter.cc | 7 +++-- - ...ffmpeg_aac_bitstream_converter_unittest.cc | 2 +- - media/filters/ffmpeg_audio_decoder.cc | 13 +++++---- - 8 files changed, 51 insertions(+), 37 deletions(-) - -diff --git a/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc b/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc -index e4fc3f460e2..9b1ad9f7675 100644 ---- a/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc -+++ b/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc -@@ -74,7 +74,7 @@ void CdmAudioDecoderConfigToAVCodecContext( - codec_context->sample_fmt = AV_SAMPLE_FMT_NONE; - } - -- codec_context->channels = config.channel_count; -+ codec_context->ch_layout.nb_channels = config.channel_count; - codec_context->sample_rate = config.samples_per_second; - - if (config.extra_data) { -@@ -124,8 +124,8 @@ void CopySamples(cdm::AudioFormat cdm_format, - case cdm::kAudioFormatPlanarS16: - case cdm::kAudioFormatPlanarF32: { - const int decoded_size_per_channel = -- decoded_audio_size / av_frame.channels; -- for (int i = 0; i < av_frame.channels; ++i) { -+ decoded_audio_size / av_frame.ch_layout.nb_channels; -+ for (int i = 0; i < av_frame.ch_layout.nb_channels; ++i) { - memcpy(output_buffer, av_frame.extended_data[i], - decoded_size_per_channel); - output_buffer += decoded_size_per_channel; -@@ -185,13 +185,14 @@ bool FFmpegCdmAudioDecoder::Initialize( - // Success! - decoding_loop_ = std::make_unique(codec_context_.get()); - samples_per_second_ = config.samples_per_second; -- bytes_per_frame_ = codec_context_->channels * config.bits_per_channel / 8; -+ bytes_per_frame_ = -+ codec_context_->ch_layout.nb_channels * config.bits_per_channel / 8; - output_timestamp_helper_ = - std::make_unique(config.samples_per_second); - is_initialized_ = true; - - // Store initial values to guard against midstream configuration changes. -- channels_ = codec_context_->channels; -+ channels_ = codec_context_->ch_layout.nb_channels; - av_sample_format_ = codec_context_->sample_fmt; - - return true; -@@ -291,17 +292,19 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer( - for (auto& frame : audio_frames) { - int decoded_audio_size = 0; - if (frame->sample_rate != samples_per_second_ || -- frame->channels != channels_ || frame->format != av_sample_format_) { -+ frame->ch_layout.nb_channels != channels_ || -+ frame->format != av_sample_format_) { - DLOG(ERROR) << "Unsupported midstream configuration change!" - << " Sample Rate: " << frame->sample_rate << " vs " -- << samples_per_second_ << ", Channels: " << frame->channels -- << " vs " << channels_ << ", Sample Format: " << frame->format -- << " vs " << av_sample_format_; -+ << samples_per_second_ -+ << ", Channels: " << frame->ch_layout.nb_channels << " vs " -+ << channels_ << ", Sample Format: " << frame->format << " vs " -+ << av_sample_format_; - return cdm::kDecodeError; - } - - decoded_audio_size = av_samples_get_buffer_size( -- nullptr, codec_context_->channels, frame->nb_samples, -+ nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, - codec_context_->sample_fmt, 1); - if (!decoded_audio_size) - continue; -@@ -320,9 +323,9 @@ bool FFmpegCdmAudioDecoder::OnNewFrame( - size_t* total_size, - std::vector>* audio_frames, - AVFrame* frame) { -- *total_size += av_samples_get_buffer_size(nullptr, codec_context_->channels, -- frame->nb_samples, -- codec_context_->sample_fmt, 1); -+ *total_size += av_samples_get_buffer_size( -+ nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, -+ codec_context_->sample_fmt, 1); - audio_frames->emplace_back(av_frame_clone(frame)); - return true; - } -diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc -index 87ca8969626..76f03d6608e 100644 ---- a/media/ffmpeg/ffmpeg_common.cc -+++ b/media/ffmpeg/ffmpeg_common.cc -@@ -345,10 +345,11 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, - codec_context->sample_fmt, codec_context->codec_id); - - ChannelLayout channel_layout = -- codec_context->channels > 8 -+ codec_context->ch_layout.nb_channels > 8 - ? CHANNEL_LAYOUT_DISCRETE -- : ChannelLayoutToChromeChannelLayout(codec_context->channel_layout, -- codec_context->channels); -+ : ChannelLayoutToChromeChannelLayout( -+ codec_context->ch_layout.u.mask, -+ codec_context->ch_layout.nb_channels); - - int sample_rate = codec_context->sample_rate; - switch (codec) { -@@ -401,7 +402,7 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, - extra_data, encryption_scheme, seek_preroll, - codec_context->delay); - if (channel_layout == CHANNEL_LAYOUT_DISCRETE) -- config->SetChannelsForDiscrete(codec_context->channels); -+ config->SetChannelsForDiscrete(codec_context->ch_layout.nb_channels); - - #if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO) - // These are bitstream formats unknown to ffmpeg, so they don't have -@@ -470,7 +471,7 @@ void AudioDecoderConfigToAVCodecContext(const AudioDecoderConfig& config, - - // TODO(scherkus): should we set |channel_layout|? I'm not sure if FFmpeg uses - // said information to decode. -- codec_context->channels = config.channels(); -+ codec_context->ch_layout.nb_channels = config.channels(); - codec_context->sample_rate = config.samples_per_second(); - - if (config.extra_data().empty()) { -diff --git a/media/filters/audio_file_reader.cc b/media/filters/audio_file_reader.cc -index 5f257bdfaa6..e1be5aa9a5b 100644 ---- a/media/filters/audio_file_reader.cc -+++ b/media/filters/audio_file_reader.cc -@@ -113,14 +113,15 @@ bool AudioFileReader::OpenDecoder() { - - // Verify the channel layout is supported by Chrome. Acts as a sanity check - // against invalid files. See http://crbug.com/171962 -- if (ChannelLayoutToChromeChannelLayout(codec_context_->channel_layout, -- codec_context_->channels) == -+ if (ChannelLayoutToChromeChannelLayout( -+ codec_context_->ch_layout.u.mask, -+ codec_context_->ch_layout.nb_channels) == - CHANNEL_LAYOUT_UNSUPPORTED) { - return false; - } - - // Store initial values to guard against midstream configuration changes. -- channels_ = codec_context_->channels; -+ channels_ = codec_context_->ch_layout.nb_channels; - audio_codec_ = CodecIDToAudioCodec(codec_context_->codec_id); - sample_rate_ = codec_context_->sample_rate; - av_sample_format_ = codec_context_->sample_fmt; -@@ -223,7 +224,7 @@ bool AudioFileReader::OnNewFrame( - if (frames_read < 0) - return false; - -- const int channels = frame->channels; -+ const int channels = frame->ch_layout.nb_channels; - if (frame->sample_rate != sample_rate_ || channels != channels_ || - frame->format != av_sample_format_) { - DLOG(ERROR) << "Unsupported midstream configuration change!" -diff --git a/media/filters/audio_file_reader_unittest.cc b/media/filters/audio_file_reader_unittest.cc -index 2aba7927a31..1f45a50cace 100644 ---- a/media/filters/audio_file_reader_unittest.cc -+++ b/media/filters/audio_file_reader_unittest.cc -@@ -121,11 +121,11 @@ class AudioFileReaderTest : public testing::Test { - EXPECT_FALSE(reader_->Open()); - } - -- void RunTestFailingDecode(const char* fn) { -+ void RunTestFailingDecode(const char* fn, int expect_read = 0) { - Initialize(fn); - EXPECT_TRUE(reader_->Open()); - std::vector> decoded_audio_packets; -- EXPECT_EQ(reader_->Read(&decoded_audio_packets), 0); -+ EXPECT_EQ(reader_->Read(&decoded_audio_packets), expect_read); - } - - void RunTestPartialDecode(const char* fn) { -@@ -219,7 +219,7 @@ TEST_F(AudioFileReaderTest, AAC_ADTS) { - } - - TEST_F(AudioFileReaderTest, MidStreamConfigChangesFail) { -- RunTestFailingDecode("midstream_config_change.mp3"); -+ RunTestFailingDecode("midstream_config_change.mp3", 42624); - } - #endif - -diff --git a/media/filters/audio_video_metadata_extractor.cc b/media/filters/audio_video_metadata_extractor.cc -index 185819eb936..69ff508c221 100644 ---- a/media/filters/audio_video_metadata_extractor.cc -+++ b/media/filters/audio_video_metadata_extractor.cc -@@ -113,6 +113,15 @@ bool AudioVideoMetadataExtractor::Extract(DataSource* source, - if (!stream) - continue; - -+ void* display_matrix = -+ av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr); -+ if (display_matrix) { -+ rotation_ = VideoTransformation::FromFFmpegDisplayMatrix( -+ static_cast(display_matrix)) -+ .rotation; -+ info.tags["rotate"] = base::NumberToString(rotation_); -+ } -+ - // Extract dictionary from streams also. Needed for containers that attach - // metadata to contained streams instead the container itself, like OGG. - ExtractDictionary(stream->metadata, &info.tags); -@@ -255,8 +264,6 @@ void AudioVideoMetadataExtractor::ExtractDictionary(AVDictionary* metadata, - if (raw_tags->find(tag->key) == raw_tags->end()) - (*raw_tags)[tag->key] = tag->value; - -- if (ExtractInt(tag, "rotate", &rotation_)) -- continue; - if (ExtractString(tag, "album", &album_)) - continue; - if (ExtractString(tag, "artist", &artist_)) -diff --git a/media/filters/ffmpeg_aac_bitstream_converter.cc b/media/filters/ffmpeg_aac_bitstream_converter.cc -index 6f231c85729..ca5e5fb927d 100644 ---- a/media/filters/ffmpeg_aac_bitstream_converter.cc -+++ b/media/filters/ffmpeg_aac_bitstream_converter.cc -@@ -195,14 +195,15 @@ bool FFmpegAACBitstreamConverter::ConvertPacket(AVPacket* packet) { - if (!header_generated_ || codec_ != stream_codec_parameters_->codec_id || - audio_profile_ != stream_codec_parameters_->profile || - sample_rate_index_ != sample_rate_index || -- channel_configuration_ != stream_codec_parameters_->channels || -+ channel_configuration_ != -+ stream_codec_parameters_->ch_layout.nb_channels || - frame_length_ != header_plus_packet_size) { - header_generated_ = - GenerateAdtsHeader(stream_codec_parameters_->codec_id, - 0, // layer - stream_codec_parameters_->profile, sample_rate_index, - 0, // private stream -- stream_codec_parameters_->channels, -+ stream_codec_parameters_->ch_layout.nb_channels, - 0, // originality - 0, // home - 0, // copyrighted_stream -@@ -214,7 +215,7 @@ bool FFmpegAACBitstreamConverter::ConvertPacket(AVPacket* packet) { - codec_ = stream_codec_parameters_->codec_id; - audio_profile_ = stream_codec_parameters_->profile; - sample_rate_index_ = sample_rate_index; -- channel_configuration_ = stream_codec_parameters_->channels; -+ channel_configuration_ = stream_codec_parameters_->ch_layout.nb_channels; - frame_length_ = header_plus_packet_size; - } - -diff --git a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc -index 1fd4c5ccd7d..f59bcd8fdaf 100644 ---- a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc -+++ b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc -@@ -34,7 +34,7 @@ class FFmpegAACBitstreamConverterTest : public testing::Test { - memset(&test_parameters_, 0, sizeof(AVCodecParameters)); - test_parameters_.codec_id = AV_CODEC_ID_AAC; - test_parameters_.profile = FF_PROFILE_AAC_MAIN; -- test_parameters_.channels = 2; -+ test_parameters_.ch_layout.nb_channels = 2; - test_parameters_.extradata = extradata_header_; - test_parameters_.extradata_size = sizeof(extradata_header_); - } -diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc -index 6a56c675f7d..4615fdeb3fb 100644 ---- a/media/filters/ffmpeg_audio_decoder.cc -+++ b/media/filters/ffmpeg_audio_decoder.cc -@@ -28,7 +28,7 @@ namespace media { - - // Return the number of channels from the data in |frame|. - static inline int DetermineChannels(AVFrame* frame) { -- return frame->channels; -+ return frame->ch_layout.nb_channels; - } - - // Called by FFmpeg's allocation routine to allocate a buffer. Uses -@@ -231,7 +231,7 @@ bool FFmpegAudioDecoder::OnNewFrame(const DecoderBuffer& buffer, - // Translate unsupported into discrete layouts for discrete configurations; - // ffmpeg does not have a labeled discrete configuration internally. - ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout( -- codec_context_->channel_layout, codec_context_->channels); -+ codec_context_->ch_layout.u.mask, codec_context_->ch_layout.nb_channels); - if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED && - config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE) { - channel_layout = CHANNEL_LAYOUT_DISCRETE; -@@ -348,11 +348,11 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) { - // Success! - av_sample_format_ = codec_context_->sample_fmt; - -- if (codec_context_->channels != config.channels()) { -+ if (codec_context_->ch_layout.nb_channels != config.channels()) { - MEDIA_LOG(ERROR, media_log_) - << "Audio configuration specified " << config.channels() - << " channels, but FFmpeg thinks the file contains " -- << codec_context_->channels << " channels"; -+ << codec_context_->ch_layout.nb_channels << " channels"; - ReleaseFFmpegResources(); - state_ = DecoderState::kUninitialized; - return false; -@@ -403,7 +403,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, - if (frame->nb_samples <= 0) - return AVERROR(EINVAL); - -- if (s->channels != channels) { -+ if (s->ch_layout.nb_channels != channels) { - DLOG(ERROR) << "AVCodecContext and AVFrame disagree on channel count."; - return AVERROR(EINVAL); - } -@@ -436,7 +436,8 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, - ChannelLayout channel_layout = - config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE - ? CHANNEL_LAYOUT_DISCRETE -- : ChannelLayoutToChromeChannelLayout(s->channel_layout, s->channels); -+ : ChannelLayoutToChromeChannelLayout(s->ch_layout.u.mask, -+ s->ch_layout.nb_channels); - - if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) { - DLOG(ERROR) << "Unsupported channel layout."; diff --git a/chromium-104.0.5112.79-tflite-system-zlib.patch b/chromium-104.0.5112.79-tflite-system-zlib.patch deleted file mode 100644 index 91ef572..0000000 --- a/chromium-104.0.5112.79-tflite-system-zlib.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc -+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc -@@ -21,8 +21,8 @@ limitations under the License. - #include "absl/status/status.h" // from @com_google_absl - #include "absl/strings/str_format.h" // from @com_google_absl - #include "absl/strings/string_view.h" // from @com_google_absl --#include "contrib/minizip/ioapi.h" --#include "contrib/minizip/unzip.h" -+#include "third_party/zlib/contrib/minizip/ioapi.h" -+#include "third_party/zlib/contrib/minizip/unzip.h" - #include "flatbuffers/flatbuffers.h" // from @flatbuffers - #include "tensorflow/lite/schema/schema_generated.h" - #include "tensorflow_lite_support/cc/common.h" ---- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc -+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc -@@ -19,8 +19,8 @@ limitations under the License. - #include - #include - --#include "contrib/minizip/ioapi.h" --#include "contrib/minizip/zip.h" -+#include "third_party/zlib/contrib/minizip/ioapi.h" -+#include "third_party/zlib/contrib/minizip/zip.h" - #include "flatbuffers/flatbuffers.h" // from @flatbuffers - #include "tensorflow/lite/schema/schema_generated.h" - #include "tensorflow_lite_support/cc/common.h" ---- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc -+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "contrib/minizip/ioapi.h" -+#include "third_party/zlib/contrib/minizip/ioapi.h" - - namespace tflite { - namespace metadata { ---- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h -+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "contrib/minizip/ioapi.h" -+#include "third_party/zlib/contrib/minizip/ioapi.h" - - namespace tflite { - namespace metadata { ---- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc -+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "contrib/minizip/ioapi.h" -+#include "third_party/zlib/contrib/minizip/ioapi.h" - - namespace tflite { - namespace metadata { ---- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h -+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "contrib/minizip/ioapi.h" -+#include "third_party/zlib/contrib/minizip/ioapi.h" - - namespace tflite { - namespace metadata { diff --git a/chromium-105.0.5195.102-angle-wayland-include-protocol.patch b/chromium-105.0.5195.102-angle-wayland-include-protocol.patch deleted file mode 100644 index 1245b17..0000000 --- a/chromium-105.0.5195.102-angle-wayland-include-protocol.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -upr third_party/angle.orig/BUILD.gn third_party/angle/BUILD.gn ---- third_party/angle.orig/BUILD.gn 2022-08-17 19:38:11.000000000 +0000 -+++ third_party/angle/BUILD.gn 2022-08-18 11:04:09.061751111 +0000 -@@ -489,6 +489,12 @@ config("angle_vulkan_wayland_config") { - if (angle_enable_vulkan && angle_use_wayland && - defined(vulkan_wayland_include_dirs)) { - include_dirs = vulkan_wayland_include_dirs -+ } else if (angle_enable_vulkan && angle_use_wayland) { -+ include_dirs = [ -+ "$wayland_gn_dir/src/src", -+ "$wayland_gn_dir/include/src", -+ "$wayland_gn_dir/include/protocol", -+ ] - } - } - -@@ -1073,6 +1079,7 @@ if (angle_use_wayland) { - include_dirs = [ - "$wayland_dir/egl", - "$wayland_dir/src", -+ "$wayland_gn_dir/include/protocol", - ] - } - -diff -upr third_party/angle.orig/src/third_party/volk/BUILD.gn third_party/angle/src/third_party/volk/BUILD.gn ---- third_party/angle.orig/src/third_party/volk/BUILD.gn 2022-08-17 19:38:12.000000000 +0000 -+++ third_party/angle/src/third_party/volk/BUILD.gn 2022-08-18 11:04:36.499828006 +0000 -@@ -21,6 +21,9 @@ source_set("volk") { - configs += [ "$angle_root:angle_no_cfi_icall" ] - public_deps = [ "$angle_vulkan_headers_dir:vulkan_headers" ] - if (angle_use_wayland) { -- include_dirs = [ "$wayland_dir/src" ] -+ include_dirs = [ -+ "$wayland_dir/src", -+ "$wayland_gn_dir/include/protocol", -+ ] - } - } diff --git a/chromium-109.0.5414.119-REVERT-roll-src-third_party-ffmpeg-m106.patch b/chromium-109.0.5414.119-REVERT-roll-src-third_party-ffmpeg-m106.patch deleted file mode 100644 index b2a1137..0000000 --- a/chromium-109.0.5414.119-REVERT-roll-src-third_party-ffmpeg-m106.patch +++ /dev/null @@ -1,55 +0,0 @@ -From ded379824f5de39357b6b1894578101aba5cdf05 Mon Sep 17 00:00:00 2001 -From: Eugene Zemtsov -Date: Fri, 29 Jul 2022 04:41:04 +0000 -Subject: [PATCH] Roll src/third_party/ffmpeg/ 880df5ede..b71ecd02b (279 - commits) - -https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/880df5ede50a..b71ecd02b479 - -$ git log 880df5ede..b71ecd02b --date=short --no-merges --format='%ad %ae %s' -2022-07-27 eugene Roll for M106 -2022-07-25 andreas.rheinhardt avcodec/x86/pngdsp: Remove obsolete ff_add_bytes_l2_mmx() -2022-07-22 andreas.rheinhardt avcodec/hevcdec: Output MD5-message in one piece -2022-07-24 epirat07 configure: properly require libx264 if enabled -2022-07-24 zane avformat/argo_cvg: expose loop/reverb/checksum via metadata -(...) -2022-05-03 leo.izen avcodec/libjxldec: properly tag output colorspace -2022-06-25 ffmpeg avfilter/Makefile: always make colorspace.o -2022-03-02 brad avutil/ppc/cpu: Use proper header for OpenBSD PPC CPU detection -2022-06-24 jamrial avformat/http: include version.h -2022-05-16 mbonda-at-nvidia.com AV1 VDPAU hwaccel Decode support - -Created with: - roll-dep src/third_party/ffmpeg - -ffmpeg usage fix: - Switch from AVFrame::pkt_duration to AVFrame::duration, - AVFrame::pkt_duration is deprecated - -Bug: 1344646 -Change-Id: Iaa3abf48ef81dae6d282bca8f0fa2a8dffeeba25 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3788638 -Reviewed-by: Will Cassella -Commit-Queue: Eugene Zemtsov -Cr-Commit-Position: refs/heads/main@{#1029623} ---- - media/filters/audio_file_reader.cc | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/media/filters/audio_file_reader.cc b/media/filters/audio_file_reader.cc -index e1be5aa9a5b..951c003956f 100644 ---- a/media/filters/audio_file_reader.cc -+++ b/media/filters/audio_file_reader.cc -@@ -243,10 +243,10 @@ bool AudioFileReader::OnNewFrame( - // silence from being output. In the case where we are also discarding some - // portion of the packet (as indicated by a negative pts), we further want to - // adjust the duration downward by however much exists before zero. -- if (audio_codec_ == AudioCodec::kAAC && frame->pkt_duration) { -+ if (audio_codec_ == AudioCodec::kAAC && frame->duration) { - const base::TimeDelta pkt_duration = ConvertFromTimeBase( - glue_->format_context()->streams[stream_index_]->time_base, -- frame->pkt_duration + std::min(static_cast(0), frame->pts)); -+ frame->duration + std::min(static_cast(0), frame->pts)); - const base::TimeDelta frame_duration = - base::Seconds(frames_read / static_cast(sample_rate_)); - diff --git a/chromium-110.0.5481.177-v8-move-the-Stack-object-from-ThreadLocalTop.patch b/chromium-110.0.5481.177-v8-move-the-Stack-object-from-ThreadLocalTop.patch deleted file mode 100644 index a060448..0000000 --- a/chromium-110.0.5481.177-v8-move-the-Stack-object-from-ThreadLocalTop.patch +++ /dev/null @@ -1,205 +0,0 @@ -From 7b6fbcd0a6700db498ad55db046ecda92c8ee8c1 Mon Sep 17 00:00:00 2001 -From: Nikolaos Papaspyrou -Date: Sun, 29 Jan 2023 17:18:08 +0100 -Subject: [PATCH] Merge: [heap] Move the Stack object from ThreadLocalTop to - Isolate - -This is just for nodejs, do not backmerge to 11.0. -(cherry picked from commit 1e4b71d99fea5ea6bb4bf6420585a7819872bb0f) - -> Change-Id: I026a35af3bc6999a09b21f277756d4454c086343 -> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4152476 -> Reviewed-by: Michael Lippautz -> Reviewed-by: Omer Katz -> Commit-Queue: Nikolaos Papaspyrou -> Cr-Commit-Position: refs/heads/main@{#85445} - -Stack information is thread-specific and, until now, it was stored in a -field in ThreadLocalTop. This CL moves stack information to the isolate -and makes sure to update the stack start whenever a main thread enters -the isolate. At the same time, the Stack object is refactored and -simplified. - -As a side effect, after removing the Stack object, ThreadLocalTop -satisfies the std::standard_layout trait; this fixes some issues -observed with different C++ compilers. - -Bug: v8:13630 -Bug: v8:13257 -Change-Id: I4be1f04fe90699e1a6e456dad3e0dd623851acce ---- - src/execution/isolate.cc | 36 +++++++++++++++---------------- - src/execution/isolate.h | 6 ++++++ - src/execution/thread-local-top.cc | 2 -- - src/execution/thread-local-top.h | 6 +----- - src/heap/heap.cc | 4 +--- - 5 files changed, 25 insertions(+), 29 deletions(-) - -diff --git a/src/execution/isolate.cc b/src/execution/isolate.cc -index 4edf364e0a..be4fd400d2 100644 ---- a/src/execution/isolate.cc -+++ b/src/execution/isolate.cc -@@ -3074,22 +3074,23 @@ void Isolate::AddSharedWasmMemory(Handle memory_object) { - void Isolate::RecordStackSwitchForScanning() { - Object current = root(RootIndex::kActiveContinuation); - DCHECK(!current.IsUndefined()); -- thread_local_top()->stack_.ClearStackSegments(); -- wasm::StackMemory* stack = Managed::cast( -- WasmContinuationObject::cast(current).stack()) -- .get() -- .get(); -+ stack().ClearStackSegments(); -+ wasm::StackMemory* wasm_stack = -+ Managed::cast( -+ WasmContinuationObject::cast(current).stack()) -+ .get() -+ .get(); - current = WasmContinuationObject::cast(current).parent(); -- thread_local_top()->stack_.SetStackStart( -- reinterpret_cast(stack->base())); -+ heap()->SetStackStart(reinterpret_cast(wasm_stack->base())); - // We don't need to add all inactive stacks. Only the ones in the active chain - // may contain cpp heap pointers. - while (!current.IsUndefined()) { - auto cont = WasmContinuationObject::cast(current); -- auto* stack = Managed::cast(cont.stack()).get().get(); -- thread_local_top()->stack_.AddStackSegment( -- reinterpret_cast(stack->base()), -- reinterpret_cast(stack->jmpbuf()->sp)); -+ auto* wasm_stack = -+ Managed::cast(cont.stack()).get().get(); -+ stack().AddStackSegment( -+ reinterpret_cast(wasm_stack->base()), -+ reinterpret_cast(wasm_stack->jmpbuf()->sp)); - current = cont.parent(); - } - } -@@ -3377,20 +3378,13 @@ void Isolate::Delete(Isolate* isolate) { - Isolate* saved_isolate = isolate->TryGetCurrent(); - SetIsolateThreadLocals(isolate, nullptr); - isolate->set_thread_id(ThreadId::Current()); -- isolate->thread_local_top()->stack_ = -- saved_isolate ? std::move(saved_isolate->thread_local_top()->stack_) -- : ::heap::base::Stack(base::Stack::GetStackStart()); -+ isolate->heap()->SetStackStart(base::Stack::GetStackStart()); - - bool owns_shared_isolate = isolate->owns_shared_isolate_; - Isolate* maybe_shared_isolate = isolate->shared_isolate_; - - isolate->Deinit(); - -- // Restore the saved isolate's stack. -- if (saved_isolate) -- saved_isolate->thread_local_top()->stack_ = -- std::move(isolate->thread_local_top()->stack_); -- - #ifdef DEBUG - non_disposed_isolates_--; - #endif // DEBUG -@@ -4647,6 +4641,10 @@ bool Isolate::Init(SnapshotData* startup_snapshot_data, - void Isolate::Enter() { - Isolate* current_isolate = nullptr; - PerIsolateThreadData* current_data = CurrentPerIsolateThreadData(); -+ -+ // Set the stack start for the main thread that enters the isolate. -+ heap()->SetStackStart(base::Stack::GetStackStart()); -+ - if (current_data != nullptr) { - current_isolate = current_data->isolate_; - DCHECK_NOT_NULL(current_isolate); -diff --git a/src/execution/isolate.h b/src/execution/isolate.h -index a32f999fe5..1cb6e10661 100644 ---- a/src/execution/isolate.h -+++ b/src/execution/isolate.h -@@ -32,6 +32,7 @@ - #include "src/execution/stack-guard.h" - #include "src/handles/handles.h" - #include "src/handles/traced-handles.h" -+#include "src/heap/base/stack.h" - #include "src/heap/factory.h" - #include "src/heap/heap.h" - #include "src/heap/read-only-heap.h" -@@ -2022,6 +2023,8 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { - SimulatorData* simulator_data() { return simulator_data_; } - #endif - -+ ::heap::base::Stack& stack() { return stack_; } -+ - #ifdef V8_ENABLE_WEBASSEMBLY - wasm::StackMemory*& wasm_stacks() { return wasm_stacks_; } - // Update the thread local's Stack object so that it is aware of the new stack -@@ -2520,6 +2523,9 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { - // The mutex only guards adding pages, the retrieval is signal safe. - base::Mutex code_pages_mutex_; - -+ // Stack information for the main thread. -+ ::heap::base::Stack stack_; -+ - #ifdef V8_ENABLE_WEBASSEMBLY - wasm::StackMemory* wasm_stacks_; - #endif -diff --git a/src/execution/thread-local-top.cc b/src/execution/thread-local-top.cc -index 0d7071ddda..05cc20b8e4 100644 ---- a/src/execution/thread-local-top.cc -+++ b/src/execution/thread-local-top.cc -@@ -37,14 +37,12 @@ void ThreadLocalTop::Clear() { - current_embedder_state_ = nullptr; - failed_access_check_callback_ = nullptr; - thread_in_wasm_flag_address_ = kNullAddress; -- stack_ = ::heap::base::Stack(); - } - - void ThreadLocalTop::Initialize(Isolate* isolate) { - Clear(); - isolate_ = isolate; - thread_id_ = ThreadId::Current(); -- stack_.SetStackStart(base::Stack::GetStackStart()); - #if V8_ENABLE_WEBASSEMBLY - thread_in_wasm_flag_address_ = reinterpret_cast
( - trap_handler::GetThreadInWasmThreadLocalAddress()); -diff --git a/src/execution/thread-local-top.h b/src/execution/thread-local-top.h -index 43fec0a7df..989c817f31 100644 ---- a/src/execution/thread-local-top.h -+++ b/src/execution/thread-local-top.h -@@ -10,7 +10,6 @@ - #include "include/v8-unwinder.h" - #include "src/common/globals.h" - #include "src/execution/thread-id.h" --#include "src/heap/base/stack.h" - #include "src/objects/contexts.h" - #include "src/utils/utils.h" - -@@ -30,7 +29,7 @@ class ThreadLocalTop { - // TODO(all): This is not particularly beautiful. We should probably - // refactor this to really consist of just Addresses and 32-bit - // integer fields. -- static constexpr uint32_t kSizeInBytes = 30 * kSystemPointerSize; -+ static constexpr uint32_t kSizeInBytes = 25 * kSystemPointerSize; - - // Does early low-level initialization that does not depend on the - // isolate being present. -@@ -147,9 +146,6 @@ class ThreadLocalTop { - - // Address of the thread-local "thread in wasm" flag. - Address thread_in_wasm_flag_address_; -- -- // Stack information. -- ::heap::base::Stack stack_; - }; - - } // namespace internal -diff --git a/src/heap/heap.cc b/src/heap/heap.cc -index 51a90ddcab..b5722ab6ec 100644 ---- a/src/heap/heap.cc -+++ b/src/heap/heap.cc -@@ -5851,9 +5851,7 @@ void Heap::SetStackStart(void* stack_start) { - stack().SetStackStart(stack_start); - } - --::heap::base::Stack& Heap::stack() { -- return isolate_->thread_local_top()->stack_; --} -+::heap::base::Stack& Heap::stack() { return isolate_->stack(); } - - void Heap::RegisterExternallyReferencedObject(Address* location) { - Object object = TracedHandles::Mark(location, TracedHandles::MarkMode::kAll); diff --git a/chromium-111.0.5563.110-sql-relax-constraints-on-VirtualCursor-layout.patch b/chromium-111.0.5563.110-sql-relax-constraints-on-VirtualCursor-layout.patch deleted file mode 100644 index d1e65ee..0000000 --- a/chromium-111.0.5563.110-sql-relax-constraints-on-VirtualCursor-layout.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 7d1394bd639e3bcf68082ac3fc33eeed6a00d2e6 Mon Sep 17 00:00:00 2001 -From: Elly Fong-Jones -Date: Thu, 2 Mar 2023 00:15:11 +0000 -Subject: [PATCH] sql: relax constraints on VirtualCursor layout - -VirtualCursor::FromSqliteCursor required that VirtualCursor had a -standard layout, but in fact VirtualCursor shouldn't have a standard -layout, and the fact that it does with libc++ is a deviation from the -C++ standard. This change: - -1. Relaxes the requirement that VirtualCursor has a standard layout, and -2. Relaxes the requirement that the sqlite_cursor_ field has to be at - offset 0 - -by use of offsetof() and pointer subtraction. This change both improves -standards compliance and makes this code build with libstdc++. - -Bug: 1380656 -Change-Id: I9c47abd9197b187da0360ca5619ccf7dadab4f33 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4292313 -Reviewed-by: Austin Sullivan -Commit-Queue: Elly Fong-Jones -Cr-Commit-Position: refs/heads/main@{#1111925} ---- - sql/recover_module/cursor.h | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h -index 1970bdca8c6..4cb06557009 100644 ---- a/sql/recover_module/cursor.h -+++ b/sql/recover_module/cursor.h -@@ -63,12 +63,10 @@ class VirtualCursor { - // |sqlite_cursor| must have been returned by VirtualTable::SqliteCursor(). - static inline VirtualCursor* FromSqliteCursor( - sqlite3_vtab_cursor* sqlite_cursor) { -- static_assert(std::is_standard_layout::value, -- "needed for the reinterpret_cast below"); -- static_assert(offsetof(VirtualCursor, sqlite_cursor_) == 0, -- "sqlite_cursor_ must be the first member of the class"); -- VirtualCursor* result = reinterpret_cast(sqlite_cursor); -- DCHECK_EQ(sqlite_cursor, &result->sqlite_cursor_); -+ VirtualCursor* result = reinterpret_cast( -+ (reinterpret_cast(sqlite_cursor) - -+ offsetof(VirtualCursor, sqlite_cursor_))); -+ CHECK_EQ(sqlite_cursor, &result->sqlite_cursor_); - return result; - } - diff --git a/chromium-117.0.5938.62-material-color-utilities-cmath.patch b/chromium-117.0.5938.62-material-color-utilities-cmath.patch new file mode 100644 index 0000000..3948c5f --- /dev/null +++ b/chromium-117.0.5938.62-material-color-utilities-cmath.patch @@ -0,0 +1,11 @@ +--- third_party/material_color_utilities/src/cpp/palettes/tones.cc.orig 2023-08-30 22:58:42.101555407 +0000 ++++ third_party/material_color_utilities/src/cpp/palettes/tones.cc 2023-08-30 22:58:54.082340977 +0000 +@@ -14,6 +14,8 @@ + * limitations under the License. + */ + ++#include ++ + #include "cpp/palettes/tones.h" + + #include "cpp/cam/cam.h" diff --git a/chromium-117.0.5938.88-add-memory-for-std-unique_ptr-in-third_party-ip.patch b/chromium-117.0.5938.88-add-memory-for-std-unique_ptr-in-third_party-ip.patch new file mode 100644 index 0000000..2d6005f --- /dev/null +++ b/chromium-117.0.5938.88-add-memory-for-std-unique_ptr-in-third_party-ip.patch @@ -0,0 +1,27 @@ +From 5a8dfcaf84b5af5aeb738702651e98bfc43d6d45 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 9 Aug 2023 15:36:26 +0000 +Subject: [PATCH] IWYU: add memory for std::unique_ptr in //third_party/ipcz + +Bug: 957519 +Change-Id: I600f415a59206da283046b638a4f68eda0892ac7 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4754274 +Commit-Queue: Stephan Hartmann +Reviewed-by: Robert Sesek +Cr-Commit-Position: refs/heads/main@{#1181503} +--- + third_party/ipcz/src/ipcz/router_link.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/third_party/ipcz/src/ipcz/router_link.h b/third_party/ipcz/src/ipcz/router_link.h +index 09bc5626d99..619638cc7f1 100644 +--- a/third_party/ipcz/src/ipcz/router_link.h ++++ b/third_party/ipcz/src/ipcz/router_link.h +@@ -7,6 +7,7 @@ + + #include + #include ++#include + #include + #include + diff --git a/chromium-117.0.5938.88-blink-remove-unused-mnemonic.patch b/chromium-117.0.5938.88-blink-remove-unused-mnemonic.patch new file mode 100644 index 0000000..d7fb52a --- /dev/null +++ b/chromium-117.0.5938.88-blink-remove-unused-mnemonic.patch @@ -0,0 +1,11 @@ +--- chromium-117.0.5938.88/third_party/blink/renderer/core/BUILD.gn.orig 2023-09-18 19:35:09.929200617 +0200 ++++ chromium-117.0.5938.88/third_party/blink/renderer/core/BUILD.gn 2023-09-18 19:35:31.372292159 +0200 +@@ -1694,8 +1694,6 @@ + python_path_root = "${root_out_dir}/pyproto" + python_path_proto = "${python_path_root}/third_party/blink/renderer/core/lcp_critical_path_predictor" + +- mnemonic = "ELOC_PROTO" +- + source_dir = "lcp_critical_path_predictor/test_proto" + sources = rebase_path([ "lcp_image_id.asciipb" ], "", source_dir) + diff --git a/chromium-117.0.5938.88-roll-src-third_party-libavif-src-b33d9ebfc.676aded35.patch b/chromium-117.0.5938.88-roll-src-third_party-libavif-src-b33d9ebfc.676aded35.patch new file mode 100644 index 0000000..ba821a9 --- /dev/null +++ b/chromium-117.0.5938.88-roll-src-third_party-libavif-src-b33d9ebfc.676aded35.patch @@ -0,0 +1,70 @@ +From 21d7cf44b1cd83bb0d847515e28ca550404b0033 Mon Sep 17 00:00:00 2001 +From: Wan-Teh Chang +Date: Tue, 22 Aug 2023 19:39:04 +0000 +Subject: [PATCH] Roll src/third_party/libavif/src/ b33d9ebfc..676aded35 (3 + commits) + +https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif.git/+log/b33d9ebfc961..676aded3501f + +$ git log b33d9ebfc..676aded35 --date=short --no-merges --format='%ad %ae %s' +2023-08-22 wtc Change imir.mode back to imir.axis +2023-08-22 wtc Don't use Identity matrix coefficients with 4:0:0 +2023-08-21 yguyon Increase test values in avifstreamtest + +Created with: + roll-dep src/third_party/libavif/src +R=dalecurtis@chromium.org,jzern@google.com + +Note that imir.mode is renamed imir.axis. + +Change-Id: Ie13972640969f123b7e4580f36d6d6bab913c0f8 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4803347 +Reviewed-by: Dale Curtis +Commit-Queue: Wan-Teh Chang +Cr-Commit-Position: refs/heads/main@{#1186746} +--- + .../image-decoders/avif/avif_image_decoder.cc | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc b/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc +index deb3e66d66f..c9f1b185417 100644 +--- a/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc ++++ b/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc +@@ -1005,22 +1005,22 @@ bool AVIFImageDecoder::UpdateDemuxer() { + angle = container->irot.angle; + CHECK_LT(angle, 4); + } +- // |mode| specifies how the mirroring is performed. ++ // |axis| specifies how the mirroring is performed. + // -1: No mirroring. + // 0: The top and bottom parts of the image are exchanged. + // 1: The left and right parts of the image are exchanged. +- int mode = -1; ++ int axis = -1; + if (container->transformFlags & AVIF_TRANSFORM_IMIR) { +- mode = container->imir.mode; +- CHECK_LT(mode, 2); ++ axis = container->imir.axis; ++ CHECK_LT(axis, 2); + } + // MIAF Section 7.3.6.7 (Clean aperture, rotation and mirror) says: + // These properties, if used, shall be indicated to be applied in the + // following order: clean aperture first, then rotation, then mirror. + // +- // In the kModeAngleToOrientation array, the first dimension is mode (with an ++ // In the kAxisAngleToOrientation array, the first dimension is axis (with an + // offset of 1). The second dimension is angle. +- constexpr ImageOrientationEnum kModeAngleToOrientation[3][4] = { ++ constexpr ImageOrientationEnum kAxisAngleToOrientation[3][4] = { + // No mirroring. + {ImageOrientationEnum::kOriginTopLeft, + ImageOrientationEnum::kOriginLeftBottom, +@@ -1037,7 +1037,7 @@ bool AVIFImageDecoder::UpdateDemuxer() { + ImageOrientationEnum::kOriginBottomLeft, + ImageOrientationEnum::kOriginLeftTop}, + }; +- orientation_ = kModeAngleToOrientation[mode + 1][angle]; ++ orientation_ = kAxisAngleToOrientation[axis + 1][angle]; + + // Determine whether the image can be decoded to YUV. + // * Alpha channel is not supported. diff --git a/chromium-37.0.2062.120-chrome-wrapper-pepper-flash.patch b/chromium-37.0.2062.120-chrome-wrapper-pepper-flash.patch deleted file mode 100644 index ead2a1c..0000000 --- a/chromium-37.0.2062.120-chrome-wrapper-pepper-flash.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- chromium-37.0.2062.120/chrome/tools/build/linux/chrome-wrapper.orig 2014-09-10 01:29:21.000000000 +0200 -+++ chromium-37.0.2062.120/chrome/tools/build/linux/chrome-wrapper 2014-09-19 21:35:12.045745151 +0200 -@@ -160,4 +160,10 @@ - done - set -- "${ARGS[@]}" "$@" - --exec $CMD_PREFIX "$HERE/chrome" "$@" -+if [ -r /opt/chromium/PepperFlash/manifest.json ]; then -+ PEPPER_FLASH_VERSION="$(grep '"version":' /opt/chromium/PepperFlash/manifest.json | grep -Po '(?<=version": ")(?:\d|\.)*')" -+ exec $CMD_PREFIX "$HERE/chrome" \ -+ --ppapi-flash-path=/opt/chromium/PepperFlash/libpepflashplayer.so --ppapi-flash-version=${PEPPER_FLASH_VERSION} "$@" -+else -+ exec $CMD_PREFIX "$HERE/chrome" "$@" -+fi diff --git a/chromium-76.0.3809.100-x86-openh264-add-fPIC.patch b/chromium-76.0.3809.100-x86-openh264-add-fPIC.patch deleted file mode 100644 index ef9ac2c..0000000 --- a/chromium-76.0.3809.100-x86-openh264-add-fPIC.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- chromium-76.0.3809.100/third_party/openh264/BUILD.gn.orig 2019-08-28 14:25:04.319139430 +0200 -+++ chromium-76.0.3809.100/third_party/openh264/BUILD.gn 2019-08-28 14:25:23.371231239 +0200 -@@ -24,6 +24,7 @@ - # GCC and clang flags. MSVS (is_win && !is_clang) does not use cflags. - if (!is_win || is_clang) { - cflags += [ -+ "-fPIC", - "-Wno-format", - "-Wno-format-security", - "-Wno-header-hygiene", diff --git a/chromium-79.0.3945.79-widevine.patch b/chromium-79.0.3945.79-widevine.patch deleted file mode 100644 index 32f0ae2..0000000 --- a/chromium-79.0.3945.79-widevine.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/third_party/widevine/cdm/BUILD.gn b/third_party/widevine/cdm/BUILD.gn -index ed0e2f5208b..5b431a030d5 100644 ---- a/third_party/widevine/cdm/BUILD.gn -+++ b/third_party/widevine/cdm/BUILD.gn -@@ -14,7 +14,7 @@ buildflag_header("buildflags") { - - flags = [ - "ENABLE_WIDEVINE=$enable_widevine", -- "BUNDLE_WIDEVINE_CDM=$bundle_widevine_cdm", -+ "BUNDLE_WIDEVINE_CDM=true", - "ENABLE_WIDEVINE_CDM_COMPONENT=$enable_widevine_cdm_component", - ] - } diff --git a/chromium-80.0.3987.122-x86-v8_context_snapsht-pic-error.patch b/chromium-80.0.3987.122-x86-v8_context_snapsht-pic-error.patch deleted file mode 100644 index 97e2477..0000000 --- a/chromium-80.0.3987.122-x86-v8_context_snapsht-pic-error.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- chromium-80.0.3987.122/tools/v8_context_snapshot/BUILD.gn.orig 2020-03-07 00:31:35.460144549 +0100 -+++ chromium-80.0.3987.122/tools/v8_context_snapshot/BUILD.gn 2020-03-07 02:22:49.245058034 +0100 -@@ -97,7 +97,10 @@ - if (is_win) { - ldflags = [ "/OPT:NOICF" ] # link.exe, but also lld-link.exe. - } else if (use_gold || use_lld) { -- ldflags = [ "-Wl,--icf=none" ] -+ ldflags = [ -+ "-Wl,--icf=none", -+ "-Wl,-z,notext", -+ ] - } - } - ---- chromium-80.0.3987.122/chrome/BUILD.gn.orig 2020-03-07 02:32:07.805071147 +0100 -+++ chromium-80.0.3987.122/chrome/BUILD.gn 2020-03-07 02:33:11.886219915 +0100 -@@ -306,7 +306,7 @@ - "//chrome/common:buildflags", - ] - -- ldflags = [] -+ ldflags = [ "-Wl,-z,notext" ] - - # Chrome OS debug builds for arm need to pass --long-plt to the linker. - # See https://bugs.chromium.org/p/chromium/issues/detail?id=583532 diff --git a/chromium-90.0.4430.212-glibc-2.33.patch b/chromium-90.0.4430.212-glibc-2.33.patch deleted file mode 100644 index 74ed677..0000000 --- a/chromium-90.0.4430.212-glibc-2.33.patch +++ /dev/null @@ -1,144 +0,0 @@ -# Patch made by Kevin Kofler -# https://bugzilla.redhat.com/show_bug.cgi?id=1904652 - -diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc ---- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix 2021-01-25 10:11:45.427436398 -0500 -+++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc 2021-01-25 10:12:51.337699003 -0500 -@@ -257,6 +257,18 @@ ResultExpr EvaluateSyscallImpl(int fs_de - return RestrictKillTarget(current_pid, sysno); - } - -+#if defined(__NR_newfstatat) -+ if (sysno == __NR_newfstatat) { -+ return RewriteFstatatSIGSYS(); -+ } -+#endif -+ -+#if defined(__NR_fstatat64) -+ if (sysno == __NR_fstatat64) { -+ return RewriteFstatatSIGSYS(); -+ } -+#endif -+ - if (SyscallSets::IsFileSystem(sysno) || - SyscallSets::IsCurrentDirectory(sysno)) { - return Error(fs_denied_errno); -diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc ---- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix 2021-01-25 10:13:10.179774081 -0500 -+++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc 2021-01-25 10:16:18.790525746 -0500 -@@ -6,6 +6,8 @@ - - #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" - -+#include -+#include - #include - #include - #include -@@ -355,6 +357,35 @@ intptr_t SIGSYSSchedHandler(const struct - return -ENOSYS; - } - -+intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args, -+ void* aux) { -+ switch (args.nr) { -+#if defined(__NR_newfstatat) -+ case __NR_newfstatat: -+#endif -+#if defined(__NR_fstatat64) -+ case __NR_fstatat64: -+#endif -+#if defined(__NR_newfstatat) || defined(__NR_fstatat64) -+ if (*reinterpret_cast(args.args[1]) == '\0' -+ && args.args[3] == static_cast(AT_EMPTY_PATH)) { -+ return sandbox::sys_fstat64(static_cast(args.args[0]), -+ reinterpret_cast(args.args[2])); -+ } else { -+ errno = EACCES; -+ return -1; -+ } -+ break; -+#endif -+ } -+ -+ CrashSIGSYS_Handler(args, aux); -+ -+ // Should never be reached. -+ RAW_CHECK(false); -+ return -ENOSYS; -+} -+ - bpf_dsl::ResultExpr CrashSIGSYS() { - return bpf_dsl::Trap(CrashSIGSYS_Handler, NULL); - } -@@ -387,6 +418,10 @@ bpf_dsl::ResultExpr RewriteSchedSIGSYS() - return bpf_dsl::Trap(SIGSYSSchedHandler, NULL); - } - -+bpf_dsl::ResultExpr RewriteFstatatSIGSYS() { -+ return bpf_dsl::Trap(SIGSYSFstatatHandler, NULL); -+} -+ - void AllocateCrashKeys() { - #if !defined(OS_NACL_NONSFI) - if (seccomp_crash_key) -diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h ---- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix 2021-01-25 10:16:36.982598236 -0500 -+++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h 2021-01-25 10:18:45.705111027 -0500 -@@ -62,6 +62,10 @@ SANDBOX_EXPORT intptr_t SIGSYSPtraceFail - // sched_setparam(), sched_setscheduler() - SANDBOX_EXPORT intptr_t SIGSYSSchedHandler(const arch_seccomp_data& args, - void* aux); -+// If the fstatat syscall is actually a disguised fstat, calls the regular fstat -+// syscall, otherwise, crashes in the same way as CrashSIGSYS_Handler. -+SANDBOX_EXPORT intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args, -+ void* aux); - - // Variants of the above functions for use with bpf_dsl. - SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS(); -@@ -72,6 +76,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr Crash - SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex(); - SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPtrace(); - SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS(); -+SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteFstatatSIGSYS(); - - // Allocates a crash key so that Seccomp information can be recorded. - void AllocateCrashKeys(); -diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc ---- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix 2021-01-25 10:18:53.307141311 -0500 -+++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc 2021-01-25 10:19:46.982355293 -0500 -@@ -261,4 +261,13 @@ int sys_sigaction(int signum, - - #endif // defined(MEMORY_SANITIZER) - -+SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf) -+{ -+#if defined(__NR_fstat64) -+ return syscall(__NR_fstat64, fd, buf); -+#else -+ return syscall(__NR_fstat, fd, buf); -+#endif -+} -+ - } // namespace sandbox -diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h ---- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix 2021-01-25 10:19:53.115379741 -0500 -+++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h 2021-01-25 10:20:45.485588421 -0500 -@@ -17,6 +17,7 @@ struct sock_fprog; - struct rlimit64; - struct cap_hdr; - struct cap_data; -+struct stat64; - - namespace sandbox { - -@@ -84,6 +85,9 @@ SANDBOX_EXPORT int sys_sigaction(int sig - const struct sigaction* act, - struct sigaction* oldact); - -+// Recent glibc rewrites fstat to fstatat. -+SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf); -+ - } // namespace sandbox - - #endif // SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_ diff --git a/chromium-92.0.4515.107-clang-11-nomerge.patch b/chromium-92.0.4515.107-clang-11-nomerge.patch deleted file mode 100644 index 5d8dd88..0000000 --- a/chromium-92.0.4515.107-clang-11-nomerge.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- chromium-92.0.4515.107/base/compiler_specific.h.orig 2021-07-25 22:15:52.001031942 +0200 -+++ chromium-92.0.4515.107/base/compiler_specific.h 2021-07-25 22:16:50.264104515 +0200 -@@ -340,7 +340,7 @@ - #endif // defined(__clang_analyzer__) - - // Use nomerge attribute to disable optimization of merging multiple same calls. --#if defined(__clang__) && __has_attribute(nomerge) -+#if defined(__clang__) && (__clang_major__ >= 12) && __has_attribute(nomerge) - #define NOMERGE [[clang::nomerge]] - #else - #define NOMERGE diff --git a/chromium-92.0.4515.107-extend-enable-accelerated-video-decode-flag.patch b/chromium-92.0.4515.107-extend-enable-accelerated-video-decode-flag.patch deleted file mode 100644 index 51e346f..0000000 --- a/chromium-92.0.4515.107-extend-enable-accelerated-video-decode-flag.patch +++ /dev/null @@ -1,35 +0,0 @@ -From e48f18eba0eae199ba7bc8a6a09ebf39799447c1 Mon Sep 17 00:00:00 2001 -From: Ted Meyer -Date: Wed, 2 Jun 2021 05:35:22 +0000 -Subject: [PATCH] Extend enable-accelerated-video-decode flag for linux to m93 - -It appears that there is insistence that the flag be totally removed or -have its end-milestone increased, I can't just let it wait until the -feature is working again and then re-enable it. So i've moved it to 93. - -R=dalecurtis - -Fixed: 1207478 -Change-Id: I26a5e790cd390825516b4a4b6af88e89b2d4f4eb -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2918478 -Reviewed-by: Dale Curtis -Reviewed-by: Ted Meyer -Commit-Queue: Ted Meyer -Cr-Commit-Position: refs/heads/master@{#888312} ---- - chrome/browser/flag-metadata.json | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json -index 67e0330436..34542671f2 100644 ---- a/chrome/browser/flag-metadata.json -+++ b/chrome/browser/flag-metadata.json -@@ -1193,7 +1193,7 @@ - { - "name": "enable-accelerated-video-decode", - "owners": [ "media-dev@chromium.org" ], -- "expiry_milestone": 90 -+ "expiry_milestone": 93 - }, - { - "name": "enable-accessibility-live-caption", diff --git a/chromium-92.0.4515.107-linux-sandbox-fix-fstatat-crash.patch b/chromium-92.0.4515.107-linux-sandbox-fix-fstatat-crash.patch deleted file mode 100644 index 899e48e..0000000 --- a/chromium-92.0.4515.107-linux-sandbox-fix-fstatat-crash.patch +++ /dev/null @@ -1,348 +0,0 @@ -From 60d5e803ef2a4874d29799b638754152285e0ed9 Mon Sep 17 00:00:00 2001 -From: Matthew Denton -Date: Wed, 21 Jul 2021 12:55:11 +0000 -Subject: [PATCH] Linux sandbox: fix fstatat() crash - -This is a reland of https://crrev.com/c/2801873. - -Glibc has started rewriting fstat(fd, stat_buf) to -fstatat(fd, "", stat_buf, AT_EMPTY_PATH). This works because when -AT_EMPTY_PATH is specified, and the second argument is an empty string, -then fstatat just performs an fstat on fd like normal. - -Unfortunately, fstatat() also allows stat-ing arbitrary pathnames like -with fstatat(AT_FDCWD, "/i/am/a/file", stat_buf, 0); -The baseline policy needs to prevent this usage of fstatat() since it -doesn't allow access to arbitrary pathnames. - -Sadly, if the second argument is not an empty string, AT_EMPTY_PATH is -simply ignored by current kernels. - -This means fstatat() is completely unsandboxable with seccomp, since -we *need* to verify that the second argument is the empty string, but -we can't dereference pointers in seccomp (due to limitations of BPF, -and the difficulty of addressing these limitations due to TOCTOU -issues). - -So, this CL Traps (raises a SIGSYS via seccomp) on any fstatat syscall. -The signal handler, which runs in the sandboxed process, checks for -AT_EMPTY_PATH and the empty string, and then rewrites any applicable -fstatat() back into the old-style fstat(). - -Bug: 1164975 -Change-Id: I3df6c04c0d781eb1f181d707ccaaead779337291 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3042179 -Reviewed-by: Robert Sesek -Commit-Queue: Matthew Denton -Cr-Commit-Position: refs/heads/master@{#903873} ---- - .../seccomp-bpf-helpers/baseline_policy.cc | 8 ++++++ - .../baseline_policy_unittest.cc | 17 ++++++++++++- - .../seccomp-bpf-helpers/sigsys_handlers.cc | 25 +++++++++++++++++++ - .../seccomp-bpf-helpers/sigsys_handlers.h | 14 +++++++++++ - .../linux/syscall_broker/broker_process.cc | 21 ++++++++++------ - .../syscall_broker/broker_process_unittest.cc | 18 ++++++------- - sandbox/linux/system_headers/linux_stat.h | 4 +++ - 7 files changed, 89 insertions(+), 18 deletions(-) - -diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc -index f2a60bb4d7..9df0d2dbd3 100644 ---- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc -+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc -@@ -20,6 +20,7 @@ - #include "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h" - #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" - #include "sandbox/linux/services/syscall_wrappers.h" -+#include "sandbox/linux/system_headers/linux_stat.h" - #include "sandbox/linux/system_headers/linux_syscalls.h" - - #if !defined(SO_PEEK_OFF) -@@ -304,6 +305,13 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno, - return Allow(); - } - -+ // The fstatat syscalls are file system syscalls, which will be denied below -+ // with fs_denied_errno. However some allowed fstat syscalls are rewritten by -+ // libc implementations to fstatat syscalls, and we need to rewrite them back. -+ if (sysno == __NR_fstatat_default) { -+ return RewriteFstatatSIGSYS(fs_denied_errno); -+ } -+ - if (SyscallSets::IsFileSystem(sysno) || - SyscallSets::IsCurrentDirectory(sysno)) { - return Error(fs_denied_errno); -diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc -index 68c29b564b..57d307e09d 100644 ---- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc -+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc -@@ -51,7 +51,8 @@ namespace sandbox { - - namespace { - --// This also tests that read(), write() and fstat() are allowed. -+// This also tests that read(), write(), fstat(), and fstatat(.., "", .., -+// AT_EMPTY_PATH) are allowed. - void TestPipeOrSocketPair(base::ScopedFD read_end, base::ScopedFD write_end) { - BPF_ASSERT_LE(0, read_end.get()); - BPF_ASSERT_LE(0, write_end.get()); -@@ -60,6 +61,20 @@ void TestPipeOrSocketPair(base::ScopedFD read_end, base::ScopedFD write_end) { - BPF_ASSERT_EQ(0, sys_ret); - BPF_ASSERT(S_ISFIFO(stat_buf.st_mode) || S_ISSOCK(stat_buf.st_mode)); - -+ sys_ret = fstatat(read_end.get(), "", &stat_buf, AT_EMPTY_PATH); -+ BPF_ASSERT_EQ(0, sys_ret); -+ BPF_ASSERT(S_ISFIFO(stat_buf.st_mode) || S_ISSOCK(stat_buf.st_mode)); -+ -+ // Make sure fstatat with anything other than an empty string is denied. -+ sys_ret = fstatat(read_end.get(), "/", &stat_buf, AT_EMPTY_PATH); -+ BPF_ASSERT_EQ(sys_ret, -1); -+ BPF_ASSERT_EQ(EPERM, errno); -+ -+ // Make sure fstatat without AT_EMPTY_PATH is denied. -+ sys_ret = fstatat(read_end.get(), "", &stat_buf, 0); -+ BPF_ASSERT_EQ(sys_ret, -1); -+ BPF_ASSERT_EQ(EPERM, errno); -+ - const ssize_t kTestTransferSize = 4; - static const char kTestString[kTestTransferSize] = {'T', 'E', 'S', 'T'}; - ssize_t transfered = 0; -diff --git a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc -index 64edbd68bd..71068a0452 100644 ---- a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc -+++ b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc -@@ -6,6 +6,7 @@ - - #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" - -+#include - #include - #include - #include -@@ -22,6 +23,7 @@ - #include "sandbox/linux/seccomp-bpf/syscall.h" - #include "sandbox/linux/services/syscall_wrappers.h" - #include "sandbox/linux/system_headers/linux_seccomp.h" -+#include "sandbox/linux/system_headers/linux_stat.h" - #include "sandbox/linux/system_headers/linux_syscalls.h" - - #if defined(__mips__) -@@ -355,6 +357,24 @@ intptr_t SIGSYSSchedHandler(const struct arch_seccomp_data& args, - return -ENOSYS; - } - -+intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args, -+ void* fs_denied_errno) { -+ if (args.nr == __NR_fstatat_default) { -+ if (*reinterpret_cast(args.args[1]) == '\0' && -+ args.args[3] == static_cast(AT_EMPTY_PATH)) { -+ return syscall(__NR_fstat_default, static_cast(args.args[0]), -+ reinterpret_cast(args.args[2])); -+ } -+ return -reinterpret_cast(fs_denied_errno); -+ } -+ -+ CrashSIGSYS_Handler(args, fs_denied_errno); -+ -+ // Should never be reached. -+ RAW_CHECK(false); -+ return -ENOSYS; -+} -+ - bpf_dsl::ResultExpr CrashSIGSYS() { - return bpf_dsl::Trap(CrashSIGSYS_Handler, NULL); - } -@@ -387,6 +407,11 @@ bpf_dsl::ResultExpr RewriteSchedSIGSYS() { - return bpf_dsl::Trap(SIGSYSSchedHandler, NULL); - } - -+bpf_dsl::ResultExpr RewriteFstatatSIGSYS(int fs_denied_errno) { -+ return bpf_dsl::Trap(SIGSYSFstatatHandler, -+ reinterpret_cast(fs_denied_errno)); -+} -+ - void AllocateCrashKeys() { - #if !defined(OS_NACL_NONSFI) - if (seccomp_crash_key) -diff --git a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h -index 7a958b93b2..8cd735ce15 100644 ---- a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h -+++ b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h -@@ -62,6 +62,19 @@ SANDBOX_EXPORT intptr_t SIGSYSPtraceFailure(const arch_seccomp_data& args, - // sched_setparam(), sched_setscheduler() - SANDBOX_EXPORT intptr_t SIGSYSSchedHandler(const arch_seccomp_data& args, - void* aux); -+// If the fstatat() syscall is functionally equivalent to an fstat() syscall, -+// then rewrite the syscall to the equivalent fstat() syscall which can be -+// adequately sandboxed. -+// If the fstatat() is not functionally equivalent to an fstat() syscall, we -+// fail with -fs_denied_errno. -+// If the syscall is not an fstatat() at all, crash in the same way as -+// CrashSIGSYS_Handler. -+// This is necessary because glibc and musl have started rewriting fstat(fd, -+// stat_buf) as fstatat(fd, "", stat_buf, AT_EMPTY_PATH). We rewrite the latter -+// back to the former, which is actually sandboxable. -+SANDBOX_EXPORT intptr_t -+SIGSYSFstatatHandler(const struct arch_seccomp_data& args, -+ void* fs_denied_errno); - - // Variants of the above functions for use with bpf_dsl. - SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS(); -@@ -72,6 +85,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSKill(); - SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex(); - SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPtrace(); - SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS(); -+SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteFstatatSIGSYS(int fs_denied_errno); - - // Allocates a crash key so that Seccomp information can be recorded. - void AllocateCrashKeys(); -diff --git a/sandbox/linux/syscall_broker/broker_process.cc b/sandbox/linux/syscall_broker/broker_process.cc -index c2176eb785..e9dad37485 100644 ---- a/sandbox/linux/syscall_broker/broker_process.cc -+++ b/sandbox/linux/syscall_broker/broker_process.cc -@@ -113,44 +113,49 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const { - } - - bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const { -+ // The syscalls unavailable on aarch64 are all blocked by Android's default -+ // seccomp policy, even on non-aarch64 architectures. I.e., the syscalls XX() -+ // with a corresponding XXat() versions are typically unavailable in aarch64 -+ // and are default disabled in Android. So, we should refuse to broker them -+ // to be consistent with the platform's restrictions. - switch (sysno) { --#if !defined(__aarch64__) -+#if !defined(__aarch64__) && !defined(OS_ANDROID) - case __NR_access: - #endif - case __NR_faccessat: - return !fast_check || allowed_command_set_.test(COMMAND_ACCESS); - --#if !defined(__aarch64__) -+#if !defined(__aarch64__) && !defined(OS_ANDROID) - case __NR_mkdir: - #endif - case __NR_mkdirat: - return !fast_check || allowed_command_set_.test(COMMAND_MKDIR); - --#if !defined(__aarch64__) -+#if !defined(__aarch64__) && !defined(OS_ANDROID) - case __NR_open: - #endif - case __NR_openat: - return !fast_check || allowed_command_set_.test(COMMAND_OPEN); - --#if !defined(__aarch64__) -+#if !defined(__aarch64__) && !defined(OS_ANDROID) - case __NR_readlink: - #endif - case __NR_readlinkat: - return !fast_check || allowed_command_set_.test(COMMAND_READLINK); - --#if !defined(__aarch64__) -+#if !defined(__aarch64__) && !defined(OS_ANDROID) - case __NR_rename: - #endif - case __NR_renameat: - case __NR_renameat2: - return !fast_check || allowed_command_set_.test(COMMAND_RENAME); - --#if !defined(__aarch64__) -+#if !defined(__aarch64__) && !defined(OS_ANDROID) - case __NR_rmdir: - return !fast_check || allowed_command_set_.test(COMMAND_RMDIR); - #endif - --#if !defined(__aarch64__) -+#if !defined(__aarch64__) && !defined(OS_ANDROID) - case __NR_stat: - case __NR_lstat: - #endif -@@ -175,7 +180,7 @@ bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const { - return !fast_check || allowed_command_set_.test(COMMAND_STAT); - #endif - --#if !defined(__aarch64__) -+#if !defined(__aarch64__) && !defined(OS_ANDROID) - case __NR_unlink: - return !fast_check || allowed_command_set_.test(COMMAND_UNLINK); - #endif -diff --git a/sandbox/linux/syscall_broker/broker_process_unittest.cc b/sandbox/linux/syscall_broker/broker_process_unittest.cc -index c65f25a78a..f0db08d84e 100644 ---- a/sandbox/linux/syscall_broker/broker_process_unittest.cc -+++ b/sandbox/linux/syscall_broker/broker_process_unittest.cc -@@ -1596,52 +1596,52 @@ TEST(BrokerProcess, IsSyscallAllowed) { - const base::flat_map> kSysnosForCommand = { - {COMMAND_ACCESS, - {__NR_faccessat, --#if defined(__NR_access) -+#if defined(__NR_access) && !defined(OS_ANDROID) - __NR_access - #endif - }}, - {COMMAND_MKDIR, - {__NR_mkdirat, --#if defined(__NR_mkdir) -+#if defined(__NR_mkdir) && !defined(OS_ANDROID) - __NR_mkdir - #endif - }}, - {COMMAND_OPEN, - {__NR_openat, --#if defined(__NR_open) -+#if defined(__NR_open) && !defined(OS_ANDROID) - __NR_open - #endif - }}, - {COMMAND_READLINK, - {__NR_readlinkat, --#if defined(__NR_readlink) -+#if defined(__NR_readlink) && !defined(OS_ANDROID) - __NR_readlink - #endif - }}, - {COMMAND_RENAME, - {__NR_renameat, --#if defined(__NR_rename) -+#if defined(__NR_rename) && !defined(OS_ANDROID) - __NR_rename - #endif - }}, - {COMMAND_UNLINK, - {__NR_unlinkat, --#if defined(__NR_unlink) -+#if defined(__NR_unlink) && !defined(OS_ANDROID) - __NR_unlink - #endif - }}, - {COMMAND_RMDIR, - {__NR_unlinkat, --#if defined(__NR_rmdir) -+#if defined(__NR_rmdir) && !defined(OS_ANDROID) - __NR_rmdir - #endif - }}, - {COMMAND_STAT, - { --#if defined(__NR_stat) -+#if defined(__NR_stat) && !defined(OS_ANDROID) - __NR_stat, - #endif --#if defined(__NR_lstat) -+#if defined(__NR_lstat) && !defined(OS_ANDROID) - __NR_lstat, - #endif - #if defined(__NR_fstatat) -diff --git a/sandbox/linux/system_headers/linux_stat.h b/sandbox/linux/system_headers/linux_stat.h -index 35788eb22a..83b89efc75 100644 ---- a/sandbox/linux/system_headers/linux_stat.h -+++ b/sandbox/linux/system_headers/linux_stat.h -@@ -157,6 +157,10 @@ struct kernel_stat { - }; - #endif - -+#if !defined(AT_EMPTY_PATH) -+#define AT_EMPTY_PATH 0x1000 -+#endif -+ - // On 32-bit systems, we default to the 64-bit stat struct like libc - // implementations do. Otherwise we default to the normal stat struct which is - // already 64-bit. diff --git a/chromium-92.0.4515.107-linux-sandbox-syscall-broker-use-struct-kernel_stat.patch b/chromium-92.0.4515.107-linux-sandbox-syscall-broker-use-struct-kernel_stat.patch deleted file mode 100644 index 7aa43a7..0000000 --- a/chromium-92.0.4515.107-linux-sandbox-syscall-broker-use-struct-kernel_stat.patch +++ /dev/null @@ -1,1384 +0,0 @@ -From 4b438323d68840453b5ef826c3997568e2e0e8c7 Mon Sep 17 00:00:00 2001 -From: Matthew Denton -Date: Mon, 19 Jul 2021 14:03:13 +0000 -Subject: [PATCH] Reland "Reland "Linux sandbox syscall broker: use struct - kernel_stat"" - -This reverts commit ff277a52ece0b216617d770f201ed66955fe70b9. - -Reason for revert: reland - -The fix included in the reland is that fstatat64() needs to be -allowed in the broker process's seccomp policy. - -This CL also includes some extra tests that the kernel_stat structures -match the layout the kernel expects. - -Bug: 1164975, 1199431 -Test: trogdor Chromebook successfully boots and allows login. - -Original change's description: -> Revert "Reland "Linux sandbox syscall broker: use struct kernel_stat"" -> -> This reverts commit cffbc4432af79f720ae3c75dff380b853701bd64. -> -> Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1199431 -> -> Original change's description: -> > Reland "Linux sandbox syscall broker: use struct kernel_stat" -> > -> > This reverts commit 23030dc650cdfa22631f25bef937905f27f06a2c. -> > -> > Original change's description: -> > > Revert "Linux sandbox syscall broker: use struct kernel_stat" -> > > -> > > This reverts commit 784b0fcd8a3ca6bcd3acb9cfd624ec9cbbac2789. -> > > -> > > Reason for revert: Causing failure in -> > > Step "sandbox_linux_unittests" failing on builder "Linux ChromiumOS MSan Tests" -> > > See crbug.com/1198480 -> > > -> > > Original change's description: -> > > > Linux sandbox syscall broker: use struct kernel_stat -> > > > -> > > > The struct stat used in libc is different (in size and field ordering) -> > > > from the structure assumed by the Linux kernel. So, when emulating -> > > > system calls, we need to use the struct definition the kernel expects. -> > > > -> > > > This CL adds linux_stat.h that includes definitions of the different -> > > > kernel structs. -> > > > -> > > > Change-Id: I53cad35c2251dff0f6b7ea77528cfa58ef3cab4a -> > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2780876 -> > > > Commit-Queue: Matthew Denton -> > > > Reviewed-by: Robert Sesek -> > > > Cr-Commit-Position: refs/heads/master@{#871767} -> > > -> > > Change-Id: Icbec38f2103c8424dec79ab1870b97c3e83f9361 -> > > No-Presubmit: true -> > > No-Tree-Checks: true -> > > No-Try: true -> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2821812 -> > > Auto-Submit: Victor Vianna -> > > Owners-Override: Victor Vianna -> > > Commit-Queue: Rubber Stamper -> > > Bot-Commit: Rubber Stamper -> > > Cr-Commit-Position: refs/heads/master@{#871882} -> > -> > Change-Id: I1f39bb5242961474def594ff7dbea52009f2cee4 -> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2824115 -> > Auto-Submit: Matthew Denton -> > Commit-Queue: Matthew Denton -> > Reviewed-by: Robert Sesek -> > Cr-Commit-Position: refs/heads/master@{#872812} -> -> Fixed: 1199431 -> Change-Id: Iebfc0c48201bf22ff9c54d8d5c8a43d26a880098 -> No-Presubmit: true -> No-Tree-Checks: true -> No-Try: true -> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2830459 -> Auto-Submit: Kyle Horimoto -> Commit-Queue: Matthew Denton -> Commit-Queue: Kinuko Yasuda -> Reviewed-by: Matthew Denton -> Reviewed-by: Kinuko Yasuda -> Owners-Override: Kinuko Yasuda -> Cr-Commit-Position: refs/heads/master@{#873173} - -Change-Id: Ibe6a485070f33489aaa157b51b908c2d23d174d7 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2848936 -Reviewed-by: Robert Sesek -Commit-Queue: Matthew Denton -Cr-Commit-Position: refs/heads/master@{#902981} ---- - sandbox/linux/BUILD.gn | 1 + - .../seccomp_broker_process_unittest.cc | 40 +++- - sandbox/linux/seccomp-bpf-helpers/DEPS | 1 - - ...scall_parameters_restrictions_unittests.cc | 4 - - sandbox/linux/services/syscall_wrappers.cc | 50 ++++- - sandbox/linux/services/syscall_wrappers.h | 15 ++ - .../services/syscall_wrappers_unittest.cc | 129 +++++++++++- - sandbox/linux/syscall_broker/DEPS | 3 +- - sandbox/linux/syscall_broker/broker_client.cc | 4 +- - sandbox/linux/syscall_broker/broker_client.h | 4 +- - sandbox/linux/syscall_broker/broker_host.cc | 23 ++- - .../syscall_broker/broker_process_unittest.cc | 74 +++---- - .../remote_syscall_arg_handler_unittest.cc | 36 ++-- - .../syscall_broker/syscall_dispatcher.cc | 67 ++++--- - .../linux/syscall_broker/syscall_dispatcher.h | 27 ++- - sandbox/linux/system_headers/linux_stat.h | 188 ++++++++++++++++++ - sandbox/linux/system_headers/linux_time.h | 26 +++ - sandbox/linux/tests/test_utils.cc | 15 ++ - sandbox/linux/tests/test_utils.h | 2 + - .../policy/linux/bpf_broker_policy_linux.cc | 4 +- - 20 files changed, 595 insertions(+), 118 deletions(-) - create mode 100644 sandbox/linux/system_headers/linux_stat.h - -diff --git a/sandbox/linux/BUILD.gn b/sandbox/linux/BUILD.gn -index 2f778dd0bc..ccbbc91716 100644 ---- a/sandbox/linux/BUILD.gn -+++ b/sandbox/linux/BUILD.gn -@@ -443,6 +443,7 @@ source_set("sandbox_services_headers") { - "system_headers/linux_ptrace.h", - "system_headers/linux_seccomp.h", - "system_headers/linux_signal.h", -+ "system_headers/linux_stat.h", - "system_headers/linux_syscalls.h", - "system_headers/linux_time.h", - "system_headers/linux_ucontext.h", -diff --git a/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc b/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc -index 9da9c68911..8a941983b1 100644 ---- a/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc -+++ b/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc -@@ -34,6 +34,7 @@ - #include "sandbox/linux/syscall_broker/broker_file_permission.h" - #include "sandbox/linux/syscall_broker/broker_process.h" - #include "sandbox/linux/system_headers/linux_seccomp.h" -+#include "sandbox/linux/system_headers/linux_stat.h" - #include "sandbox/linux/system_headers/linux_syscalls.h" - #include "sandbox/linux/tests/scoped_temporary_file.h" - #include "sandbox/linux/tests/test_utils.h" -@@ -202,6 +203,26 @@ namespace { - // not accept this as a valid error number. E.g. bionic accepts up to 255, glibc - // and musl up to 4096. - const int kFakeErrnoSentinel = 254; -+ -+void ConvertKernelStatToLibcStat(default_stat_struct& in_stat, -+ struct stat& out_stat) { -+ out_stat.st_dev = in_stat.st_dev; -+ out_stat.st_ino = in_stat.st_ino; -+ out_stat.st_mode = in_stat.st_mode; -+ out_stat.st_nlink = in_stat.st_nlink; -+ out_stat.st_uid = in_stat.st_uid; -+ out_stat.st_gid = in_stat.st_gid; -+ out_stat.st_rdev = in_stat.st_rdev; -+ out_stat.st_size = in_stat.st_size; -+ out_stat.st_blksize = in_stat.st_blksize; -+ out_stat.st_blocks = in_stat.st_blocks; -+ out_stat.st_atim.tv_sec = in_stat.st_atime_; -+ out_stat.st_atim.tv_nsec = in_stat.st_atime_nsec_; -+ out_stat.st_mtim.tv_sec = in_stat.st_mtime_; -+ out_stat.st_mtim.tv_nsec = in_stat.st_mtime_nsec_; -+ out_stat.st_ctim.tv_sec = in_stat.st_ctime_; -+ out_stat.st_ctim.tv_nsec = in_stat.st_ctime_nsec_; -+} - } // namespace - - // There are a variety of ways to make syscalls in a sandboxed process. One is -@@ -217,6 +238,10 @@ class Syscaller { - - virtual int Open(const char* filepath, int flags) = 0; - virtual int Access(const char* filepath, int mode) = 0; -+ // NOTE: we use struct stat instead of default_stat_struct, to make the libc -+ // syscaller simpler. Copying from default_stat_struct (the structure returned -+ // from a stat sycall) to struct stat (the structure exposed by a libc to its -+ // users) is simpler than going in the opposite direction. - virtual int Stat(const char* filepath, - bool follow_links, - struct stat* statbuf) = 0; -@@ -243,8 +268,12 @@ class IPCSyscaller : public Syscaller { - int Stat(const char* filepath, - bool follow_links, - struct stat* statbuf) override { -- return broker_->GetBrokerClientSignalBased()->Stat(filepath, follow_links, -- statbuf); -+ default_stat_struct buf; -+ int ret = broker_->GetBrokerClientSignalBased()->DefaultStatForTesting( -+ filepath, follow_links, &buf); -+ if (ret >= 0) -+ ConvertKernelStatToLibcStat(buf, *statbuf); -+ return ret; - } - - int Rename(const char* oldpath, const char* newpath) override { -@@ -300,10 +329,13 @@ class DirectSyscaller : public Syscaller { - int Stat(const char* filepath, - bool follow_links, - struct stat* statbuf) override { -- int ret = follow_links ? syscall(__NR_stat, filepath, statbuf) -- : syscall(__NR_lstat, filepath, statbuf); -+ struct kernel_stat buf; -+ int ret = syscall(__NR_newfstatat, AT_FDCWD, filepath, &buf, -+ follow_links ? 0 : AT_SYMLINK_NOFOLLOW); - if (ret < 0) - return -errno; -+ -+ ConvertKernelStatToLibcStat(buf, *statbuf); - return ret; - } - -diff --git a/sandbox/linux/seccomp-bpf-helpers/DEPS b/sandbox/linux/seccomp-bpf-helpers/DEPS -index 4419fd1da3..95d1bb6cbb 100644 ---- a/sandbox/linux/seccomp-bpf-helpers/DEPS -+++ b/sandbox/linux/seccomp-bpf-helpers/DEPS -@@ -3,5 +3,4 @@ include_rules = [ - "+sandbox/linux/seccomp-bpf", - "+sandbox/linux/services", - "+sandbox/linux/system_headers", -- "+third_party/lss/linux_syscall_support.h", - ] -diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc -index 903e702eab..76c393032c 100644 ---- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc -+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc -@@ -37,10 +37,6 @@ - #include "sandbox/linux/system_headers/linux_time.h" - #include "sandbox/linux/tests/unit_tests.h" - --#if !defined(OS_ANDROID) --#include "third_party/lss/linux_syscall_support.h" // for MAKE_PROCESS_CPUCLOCK --#endif -- - namespace sandbox { - - namespace { -diff --git a/sandbox/linux/services/syscall_wrappers.cc b/sandbox/linux/services/syscall_wrappers.cc -index fcfd2aa129..3bec18a14e 100644 ---- a/sandbox/linux/services/syscall_wrappers.cc -+++ b/sandbox/linux/services/syscall_wrappers.cc -@@ -4,6 +4,7 @@ - - #include "sandbox/linux/services/syscall_wrappers.h" - -+#include - #include - #include - #include -@@ -14,11 +15,13 @@ - #include - #include - -+#include "base/check.h" - #include "base/compiler_specific.h" - #include "base/logging.h" - #include "build/build_config.h" - #include "sandbox/linux/system_headers/capability.h" - #include "sandbox/linux/system_headers/linux_signal.h" -+#include "sandbox/linux/system_headers/linux_stat.h" - #include "sandbox/linux/system_headers/linux_syscalls.h" - - namespace sandbox { -@@ -217,7 +220,7 @@ asm( - #undef STR - #undef XSTR - --#endif -+#endif // defined(ARCH_CPU_X86_FAMILY) - - int sys_sigaction(int signum, - const struct sigaction* act, -@@ -241,7 +244,7 @@ int sys_sigaction(int signum, - #error "Unsupported architecture." - #endif - } --#endif -+#endif // defined(ARCH_CPU_X86_FAMILY) - } - - LinuxSigAction linux_oldact = {}; -@@ -259,6 +262,47 @@ int sys_sigaction(int signum, - return result; - } - --#endif // defined(MEMORY_SANITIZER) -+#endif // !defined(OS_NACL_NONSFI) -+ -+int sys_stat(const char* path, struct kernel_stat* stat_buf) { -+ int res; -+#if !defined(__NR_stat) -+ res = syscall(__NR_newfstatat, AT_FDCWD, path, stat_buf, 0); -+#else -+ res = syscall(__NR_stat, path, stat_buf); -+#endif -+ if (res == 0) -+ MSAN_UNPOISON(stat_buf, sizeof(*stat_buf)); -+ return res; -+} -+ -+int sys_lstat(const char* path, struct kernel_stat* stat_buf) { -+ int res; -+#if !defined(__NR_lstat) -+ res = syscall(__NR_newfstatat, AT_FDCWD, path, stat_buf, AT_SYMLINK_NOFOLLOW); -+#else -+ res = syscall(__NR_lstat, path, stat_buf); -+#endif -+ if (res == 0) -+ MSAN_UNPOISON(stat_buf, sizeof(*stat_buf)); -+ return res; -+} -+ -+int sys_fstatat64(int dirfd, -+ const char* pathname, -+ struct kernel_stat64* stat_buf, -+ int flags) { -+#if defined(__NR_fstatat64) -+ int res = syscall(__NR_fstatat64, dirfd, pathname, stat_buf, flags); -+ if (res == 0) -+ MSAN_UNPOISON(stat_buf, sizeof(*stat_buf)); -+ return res; -+#else // defined(__NR_fstatat64) -+ // We should not reach here on 64-bit systems, as the *stat*64() are only -+ // necessary on 32-bit. -+ RAW_CHECK(false); -+ return -ENOSYS; -+#endif -+} - - } // namespace sandbox -diff --git a/sandbox/linux/services/syscall_wrappers.h b/sandbox/linux/services/syscall_wrappers.h -index 1975bfbd88..b55340e4a2 100644 ---- a/sandbox/linux/services/syscall_wrappers.h -+++ b/sandbox/linux/services/syscall_wrappers.h -@@ -17,6 +17,8 @@ struct sock_fprog; - struct rlimit64; - struct cap_hdr; - struct cap_data; -+struct kernel_stat; -+struct kernel_stat64; - - namespace sandbox { - -@@ -84,6 +86,19 @@ SANDBOX_EXPORT int sys_sigaction(int signum, - const struct sigaction* act, - struct sigaction* oldact); - -+// Some architectures do not have stat() and lstat() syscalls. In that case, -+// these wrappers will use newfstatat(), which is available on all other -+// architectures, with the same capabilities as stat() and lstat(). -+SANDBOX_EXPORT int sys_stat(const char* path, struct kernel_stat* stat_buf); -+SANDBOX_EXPORT int sys_lstat(const char* path, struct kernel_stat* stat_buf); -+ -+// Takes care of unpoisoning |stat_buf| for MSAN. Check-fails if fstatat64() is -+// not a supported syscall on the current platform. -+SANDBOX_EXPORT int sys_fstatat64(int dirfd, -+ const char* pathname, -+ struct kernel_stat64* stat_buf, -+ int flags); -+ - } // namespace sandbox - - #endif // SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_ -diff --git a/sandbox/linux/services/syscall_wrappers_unittest.cc b/sandbox/linux/services/syscall_wrappers_unittest.cc -index 32820f60a8..64b9cea80f 100644 ---- a/sandbox/linux/services/syscall_wrappers_unittest.cc -+++ b/sandbox/linux/services/syscall_wrappers_unittest.cc -@@ -5,15 +5,19 @@ - #include "sandbox/linux/services/syscall_wrappers.h" - - #include -+#include - #include - #include - #include - #include --#include - -+#include "base/logging.h" -+#include "base/memory/page_size.h" - #include "base/posix/eintr_wrapper.h" - #include "build/build_config.h" - #include "sandbox/linux/system_headers/linux_signal.h" -+#include "sandbox/linux/system_headers/linux_stat.h" -+#include "sandbox/linux/tests/scoped_temporary_file.h" - #include "sandbox/linux/tests/test_utils.h" - #include "sandbox/linux/tests/unit_tests.h" - #include "testing/gtest/include/gtest/gtest.h" -@@ -93,6 +97,129 @@ TEST(SyscallWrappers, LinuxSigSet) { - linux_sigset); - } - -+TEST(SyscallWrappers, Stat) { -+ // Create a file to stat, with 12 bytes of data. -+ ScopedTemporaryFile tmp_file; -+ EXPECT_EQ(12, write(tmp_file.fd(), "blahblahblah", 12)); -+ -+ // To test we have the correct stat structures for each kernel/platform, we -+ // will right-align them on a page, with a guard page after. -+ char* two_pages = static_cast(TestUtils::MapPagesOrDie(2)); -+ TestUtils::MprotectLastPageOrDie(two_pages, 2); -+ char* page1_end = two_pages + base::GetPageSize(); -+ -+ // First, check that calling stat with |stat_buf| pointing to the last byte on -+ // a page causes EFAULT. -+ int res = sys_stat(tmp_file.full_file_name(), -+ reinterpret_cast(page1_end - 1)); -+ ASSERT_EQ(res, -1); -+ ASSERT_EQ(errno, EFAULT); -+ -+ // Now, check that we have the correctly sized stat structure. -+ struct kernel_stat* sb = reinterpret_cast( -+ page1_end - sizeof(struct kernel_stat)); -+ // Memset to c's so we can check the kernel zero'd the padding... -+ memset(sb, 'c', sizeof(struct kernel_stat)); -+ res = sys_stat(tmp_file.full_file_name(), sb); -+ ASSERT_EQ(res, 0); -+ -+ // Following fields may never be consistent but should be non-zero. -+ // Don't trust the platform to define fields with any particular sign. -+ EXPECT_NE(0u, static_cast(sb->st_dev)); -+ EXPECT_NE(0u, static_cast(sb->st_ino)); -+ EXPECT_NE(0u, static_cast(sb->st_mode)); -+ EXPECT_NE(0u, static_cast(sb->st_blksize)); -+ EXPECT_NE(0u, static_cast(sb->st_blocks)); -+ -+// We are the ones that made the file. -+// Note: normally gid and uid overflow on backwards-compatible 32-bit systems -+// and we end up with dummy uids and gids in place here. -+#if defined(ARCH_CPU_64_BITS) -+ EXPECT_EQ(geteuid(), sb->st_uid); -+ EXPECT_EQ(getegid(), sb->st_gid); -+#endif -+ -+ // Wrote 12 bytes above which should fit in one block. -+ EXPECT_EQ(12u, sb->st_size); -+ -+ // Can't go backwards in time, 1500000000 was some time ago. -+ EXPECT_LT(1500000000u, static_cast(sb->st_atime_)); -+ EXPECT_LT(1500000000u, static_cast(sb->st_mtime_)); -+ EXPECT_LT(1500000000u, static_cast(sb->st_ctime_)); -+ -+ // Checking the padding for good measure. -+#if defined(__x86_64__) -+ EXPECT_EQ(0u, sb->__pad0); -+ EXPECT_EQ(0u, sb->__unused4[0]); -+ EXPECT_EQ(0u, sb->__unused4[1]); -+ EXPECT_EQ(0u, sb->__unused4[2]); -+#elif defined(__aarch64__) -+ EXPECT_EQ(0u, sb->__pad1); -+ EXPECT_EQ(0, sb->__pad2); -+ EXPECT_EQ(0u, sb->__unused4); -+ EXPECT_EQ(0u, sb->__unused5); -+#endif -+} -+ -+TEST(SyscallWrappers, LStat) { -+ // Create a file to stat, with 12 bytes of data. -+ ScopedTemporaryFile tmp_file; -+ EXPECT_EQ(12, write(tmp_file.fd(), "blahblahblah", 12)); -+ -+ // Also create a symlink. -+ std::string symlink_name; -+ { -+ ScopedTemporaryFile tmp_file2; -+ symlink_name = tmp_file2.full_file_name(); -+ } -+ int rc = symlink(tmp_file.full_file_name(), symlink_name.c_str()); -+ if (rc != 0) { -+ PLOG(ERROR) << "Couldn't symlink " << symlink_name << " to target " -+ << tmp_file.full_file_name(); -+ GTEST_FAIL(); -+ } -+ -+ struct kernel_stat lstat_info; -+ rc = sys_lstat(symlink_name.c_str(), &lstat_info); -+ if (rc < 0 && errno == EOVERFLOW) { -+ GTEST_SKIP(); -+ } -+ if (rc != 0) { -+ PLOG(ERROR) << "Couldn't sys_lstat " << symlink_name; -+ GTEST_FAIL(); -+ } -+ -+ struct kernel_stat stat_info; -+ rc = sys_stat(symlink_name.c_str(), &stat_info); -+ if (rc < 0 && errno == EOVERFLOW) { -+ GTEST_SKIP(); -+ } -+ if (rc != 0) { -+ PLOG(ERROR) << "Couldn't sys_stat " << symlink_name; -+ GTEST_FAIL(); -+ } -+ -+ struct kernel_stat tmp_file_stat_info; -+ rc = sys_stat(tmp_file.full_file_name(), &tmp_file_stat_info); -+ if (rc < 0 && errno == EOVERFLOW) { -+ GTEST_SKIP(); -+ } -+ if (rc != 0) { -+ PLOG(ERROR) << "Couldn't sys_stat " << tmp_file.full_file_name(); -+ GTEST_FAIL(); -+ } -+ -+ // lstat should produce information about a symlink. -+ ASSERT_TRUE(S_ISLNK(lstat_info.st_mode)); -+ -+ // stat-ing symlink_name and tmp_file should produce the same inode. -+ ASSERT_EQ(stat_info.st_ino, tmp_file_stat_info.st_ino); -+ -+ // lstat-ing symlink_name should give a different inode than stat-ing -+ // symlink_name. -+ ASSERT_NE(stat_info.st_ino, lstat_info.st_ino); -+} -+ - } // namespace - - } // namespace sandbox -diff --git a/sandbox/linux/syscall_broker/DEPS b/sandbox/linux/syscall_broker/DEPS -index c477f7d363..149c463b06 100644 ---- a/sandbox/linux/syscall_broker/DEPS -+++ b/sandbox/linux/syscall_broker/DEPS -@@ -1,4 +1,5 @@ - include_rules = [ -- "+sandbox/linux/system_headers", - "+sandbox/linux/bpf_dsl", -+ "+sandbox/linux/services", -+ "+sandbox/linux/system_headers", - ] -diff --git a/sandbox/linux/syscall_broker/broker_client.cc b/sandbox/linux/syscall_broker/broker_client.cc -index 6b1b5be433..e24f659fcf 100644 ---- a/sandbox/linux/syscall_broker/broker_client.cc -+++ b/sandbox/linux/syscall_broker/broker_client.cc -@@ -166,7 +166,7 @@ int BrokerClient::Rmdir(const char* path) const { - - int BrokerClient::Stat(const char* pathname, - bool follow_links, -- struct stat* sb) const { -+ struct kernel_stat* sb) const { - if (!pathname || !sb) - return -EFAULT; - -@@ -181,7 +181,7 @@ int BrokerClient::Stat(const char* pathname, - - int BrokerClient::Stat64(const char* pathname, - bool follow_links, -- struct stat64* sb) const { -+ struct kernel_stat64* sb) const { - if (!pathname || !sb) - return -EFAULT; - -diff --git a/sandbox/linux/syscall_broker/broker_client.h b/sandbox/linux/syscall_broker/broker_client.h -index 05e14c83f2..26ca78101c 100644 ---- a/sandbox/linux/syscall_broker/broker_client.h -+++ b/sandbox/linux/syscall_broker/broker_client.h -@@ -61,10 +61,10 @@ class SANDBOX_EXPORT BrokerClient : public SyscallDispatcher { - int Rmdir(const char* path) const override; - int Stat(const char* pathname, - bool follow_links, -- struct stat* sb) const override; -+ struct kernel_stat* sb) const override; - int Stat64(const char* pathname, - bool follow_links, -- struct stat64* sb) const override; -+ struct kernel_stat64* sb) const override; - int Unlink(const char* unlink) const override; - - private: -diff --git a/sandbox/linux/syscall_broker/broker_host.cc b/sandbox/linux/syscall_broker/broker_host.cc -index 1cd03a18df..1cdc01a888 100644 ---- a/sandbox/linux/syscall_broker/broker_host.cc -+++ b/sandbox/linux/syscall_broker/broker_host.cc -@@ -20,9 +20,11 @@ - #include "base/files/scoped_file.h" - #include "base/logging.h" - #include "base/posix/eintr_wrapper.h" -+#include "sandbox/linux/services/syscall_wrappers.h" - #include "sandbox/linux/syscall_broker/broker_command.h" - #include "sandbox/linux/syscall_broker/broker_permission_list.h" - #include "sandbox/linux/syscall_broker/broker_simple_message.h" -+#include "sandbox/linux/system_headers/linux_stat.h" - #include "sandbox/linux/system_headers/linux_syscalls.h" - - namespace sandbox { -@@ -193,10 +195,12 @@ void StatFileForIPC(const BrokerCommandSet& allowed_command_set, - RAW_CHECK(reply->AddIntToMessage(-permission_list.denied_errno())); - return; - } -+ - if (command_type == COMMAND_STAT) { -- struct stat sb; -- int sts = -- follow_links ? stat(file_to_access, &sb) : lstat(file_to_access, &sb); -+ struct kernel_stat sb; -+ -+ int sts = follow_links ? sandbox::sys_stat(file_to_access, &sb) -+ : sandbox::sys_lstat(file_to_access, &sb); - if (sts < 0) { - RAW_CHECK(reply->AddIntToMessage(-errno)); - return; -@@ -205,10 +209,12 @@ void StatFileForIPC(const BrokerCommandSet& allowed_command_set, - RAW_CHECK( - reply->AddDataToMessage(reinterpret_cast(&sb), sizeof(sb))); - } else { -+#if defined(__NR_fstatat64) - DCHECK(command_type == COMMAND_STAT64); -- struct stat64 sb; -- int sts = follow_links ? stat64(file_to_access, &sb) -- : lstat64(file_to_access, &sb); -+ struct kernel_stat64 sb; -+ -+ int sts = sandbox::sys_fstatat64(AT_FDCWD, file_to_access, &sb, -+ follow_links ? 0 : AT_SYMLINK_NOFOLLOW); - if (sts < 0) { - RAW_CHECK(reply->AddIntToMessage(-errno)); - return; -@@ -216,6 +222,11 @@ void StatFileForIPC(const BrokerCommandSet& allowed_command_set, - RAW_CHECK(reply->AddIntToMessage(0)); - RAW_CHECK( - reply->AddDataToMessage(reinterpret_cast(&sb), sizeof(sb))); -+#else // defined(__NR_fstatat64) -+ // We should not reach here on 64-bit systems, as the *stat*64() are only -+ // necessary on 32-bit. -+ RAW_CHECK(false); -+#endif - } - } - -diff --git a/sandbox/linux/syscall_broker/broker_process_unittest.cc b/sandbox/linux/syscall_broker/broker_process_unittest.cc -index 55ba6bccb2..c65f25a78a 100644 ---- a/sandbox/linux/syscall_broker/broker_process_unittest.cc -+++ b/sandbox/linux/syscall_broker/broker_process_unittest.cc -@@ -811,7 +811,7 @@ void TestStatHelper(bool fast_check_in_client, bool follow_links) { - const char* bad_leading_path5 = "/mbogo/fictitioux"; - const char* bad_leading_path6 = "/mbogo/fictitiousa"; - -- struct stat sb; -+ default_stat_struct sb; - - { - // Actual file with permissions to see file but command not allowed. -@@ -824,7 +824,7 @@ void TestStatHelper(bool fast_check_in_client, bool follow_links) { - - memset(&sb, 0, sizeof(sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - tempfile_name, follow_links, &sb)); - } - -@@ -840,7 +840,7 @@ void TestStatHelper(bool fast_check_in_client, bool follow_links) { - - memset(&sb, 0, sizeof(sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - nonesuch_name, follow_links, &sb)); - } - { -@@ -852,7 +852,7 @@ void TestStatHelper(bool fast_check_in_client, bool follow_links) { - - memset(&sb, 0, sizeof(sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - tempfile_name, follow_links, &sb)); - } - { -@@ -864,38 +864,39 @@ void TestStatHelper(bool fast_check_in_client, bool follow_links) { - ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); - - memset(&sb, 0, sizeof(sb)); -- EXPECT_EQ(-ENOENT, open_broker.GetBrokerClientSignalBased()->Stat( -- nonesuch_name, follow_links, &sb)); -+ EXPECT_EQ(-ENOENT, -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( -+ nonesuch_name, follow_links, &sb)); - - // Gets denied all the way back to root since no create permission. - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - leading_path1, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - leading_path2, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - leading_path3, follow_links, &sb)); - - // Not fooled by substrings. - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path1, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path2, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path3, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path4, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path5, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path6, follow_links, &sb)); - } - { -@@ -907,37 +908,41 @@ void TestStatHelper(bool fast_check_in_client, bool follow_links) { - ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); - - memset(&sb, 0, sizeof(sb)); -- EXPECT_EQ(-ENOENT, open_broker.GetBrokerClientSignalBased()->Stat( -- nonesuch_name, follow_links, &sb)); -+ EXPECT_EQ(-ENOENT, -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( -+ nonesuch_name, follow_links, &sb)); - - // Gets ENOENT all the way back to root since it has create permission. -- EXPECT_EQ(-ENOENT, open_broker.GetBrokerClientSignalBased()->Stat( -- leading_path1, follow_links, &sb)); -- EXPECT_EQ(-ENOENT, open_broker.GetBrokerClientSignalBased()->Stat( -- leading_path2, follow_links, &sb)); -+ EXPECT_EQ(-ENOENT, -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( -+ leading_path1, follow_links, &sb)); -+ EXPECT_EQ(-ENOENT, -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( -+ leading_path2, follow_links, &sb)); - - // But can always get the root. -- EXPECT_EQ(0, open_broker.GetBrokerClientSignalBased()->Stat( -- leading_path3, follow_links, &sb)); -+ EXPECT_EQ(0, -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( -+ leading_path3, follow_links, &sb)); - - // Not fooled by substrings. - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path1, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path2, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path3, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path4, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path5, follow_links, &sb)); - EXPECT_EQ(-kFakeErrnoSentinel, -- open_broker.GetBrokerClientSignalBased()->Stat( -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( - bad_leading_path6, follow_links, &sb)); - } - { -@@ -949,8 +954,9 @@ void TestStatHelper(bool fast_check_in_client, bool follow_links) { - ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); - - memset(&sb, 0, sizeof(sb)); -- EXPECT_EQ(0, open_broker.GetBrokerClientSignalBased()->Stat( -- tempfile_name, follow_links, &sb)); -+ EXPECT_EQ(0, -+ open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( -+ tempfile_name, follow_links, &sb)); - - // Following fields may never be consistent but should be non-zero. - // Don't trust the platform to define fields with any particular sign. -@@ -968,9 +974,9 @@ void TestStatHelper(bool fast_check_in_client, bool follow_links) { - EXPECT_EQ(12, sb.st_size); - - // Can't go backwards in time, 1500000000 was some time ago. -- EXPECT_LT(1500000000u, static_cast(sb.st_atime)); -- EXPECT_LT(1500000000u, static_cast(sb.st_mtime)); -- EXPECT_LT(1500000000u, static_cast(sb.st_ctime)); -+ EXPECT_LT(1500000000u, static_cast(sb.st_atime_)); -+ EXPECT_LT(1500000000u, static_cast(sb.st_mtime_)); -+ EXPECT_LT(1500000000u, static_cast(sb.st_ctime_)); - } - } - -diff --git a/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc b/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc -index fffa9bb708..f517a9867c 100644 ---- a/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc -+++ b/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc -@@ -16,6 +16,7 @@ - #include "base/memory/page_size.h" - #include "base/posix/unix_domain_socket.h" - #include "base/test/bind.h" -+#include "sandbox/linux/tests/test_utils.h" - #include "sandbox/linux/tests/unit_tests.h" - #include "testing/gtest/include/gtest/gtest.h" - -@@ -52,19 +53,6 @@ void VerifyCorrectString(std::string str, size_t size) { - } - } - --void* MapPagesOrDie(size_t num_pages) { -- void* addr = mmap(nullptr, num_pages * base::GetPageSize(), -- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); -- PCHECK(addr); -- return addr; --} -- --void MprotectLastPageOrDie(char* addr, size_t num_pages) { -- size_t last_page_offset = (num_pages - 1) * base::GetPageSize(); -- PCHECK(mprotect(addr + last_page_offset, base::GetPageSize(), PROT_NONE) >= -- 0); --} -- - pid_t ForkWaitingChild(base::OnceCallback - after_parent_signals_callback = base::DoNothing(), - base::ScopedFD* parent_sync_fd = nullptr) { -@@ -105,13 +93,13 @@ void ReadTest(const ReadTestConfig& test_config) { - size_t total_pages = (test_config.start_at + test_config.total_size + - base::GetPageSize() - 1) / - base::GetPageSize(); -- char* mmap_addr = static_cast(MapPagesOrDie(total_pages)); -+ char* mmap_addr = static_cast(TestUtils::MapPagesOrDie(total_pages)); - char* addr = mmap_addr + test_config.start_at; - FillBufferWithPath(addr, test_config.total_size, - test_config.include_null_byte); - - if (test_config.last_page_inaccessible) -- MprotectLastPageOrDie(mmap_addr, total_pages); -+ TestUtils::MprotectLastPageOrDie(mmap_addr, total_pages); - - pid_t pid = ForkWaitingChild(); - munmap(mmap_addr, base::GetPageSize() * total_pages); -@@ -212,7 +200,7 @@ SANDBOX_TEST(BrokerRemoteSyscallArgHandler, ReadChunkPlus1EndingOnePastPage) { - } - - SANDBOX_TEST(BrokerRemoteSyscallArgHandler, ReadChildExited) { -- void* addr = MapPagesOrDie(1); -+ void* addr = TestUtils::MapPagesOrDie(1); - FillBufferWithPath(static_cast(addr), strlen(kPathPart) + 1, true); - - base::ScopedFD parent_sync, child_sync; -@@ -240,10 +228,10 @@ SANDBOX_TEST(BrokerRemoteSyscallArgHandler, ReadChildExited) { - } - - SANDBOX_TEST(BrokerRemoteSyscallArgHandler, BasicWrite) { -- void* read_from = MapPagesOrDie(1); -+ void* read_from = TestUtils::MapPagesOrDie(1); - const size_t write_size = base::GetPageSize(); - FillBufferWithPath(static_cast(read_from), write_size, false); -- char* write_to = static_cast(MapPagesOrDie(1)); -+ char* write_to = static_cast(TestUtils::MapPagesOrDie(1)); - base::ScopedFD parent_signal_fd; - const std::vector empty_fd_vec; - -@@ -278,8 +266,8 @@ SANDBOX_TEST(BrokerRemoteSyscallArgHandler, BasicWrite) { - } - - SANDBOX_TEST(BrokerRemoteSyscallArgHandler, WriteToInvalidAddress) { -- char* write_to = static_cast(MapPagesOrDie(1)); -- MprotectLastPageOrDie(write_to, 1); -+ char* write_to = static_cast(TestUtils::MapPagesOrDie(1)); -+ TestUtils::MprotectLastPageOrDie(write_to, 1); - base::ScopedFD parent_signal_fd; - const std::vector empty_fd_vec; - -@@ -295,11 +283,11 @@ SANDBOX_TEST(BrokerRemoteSyscallArgHandler, WriteToInvalidAddress) { - } - - SANDBOX_TEST(BrokerRemoteSyscallArgHandler, WritePartiallyToInvalidAddress) { -- char* read_from = static_cast(MapPagesOrDie(2)); -+ char* read_from = static_cast(TestUtils::MapPagesOrDie(2)); - const size_t write_size = base::GetPageSize(); - FillBufferWithPath(static_cast(read_from), write_size, false); -- char* write_to = static_cast(MapPagesOrDie(2)); -- MprotectLastPageOrDie(write_to, 2); -+ char* write_to = static_cast(TestUtils::MapPagesOrDie(2)); -+ TestUtils::MprotectLastPageOrDie(write_to, 2); - write_to += base::GetPageSize() / 2; - base::ScopedFD parent_signal_fd; - const std::vector empty_fd_vec; -@@ -314,7 +302,7 @@ SANDBOX_TEST(BrokerRemoteSyscallArgHandler, WritePartiallyToInvalidAddress) { - } - - SANDBOX_TEST(BrokerRemoteSyscallArgHandler, WriteChildExited) { -- char* addr = static_cast(MapPagesOrDie(1)); -+ char* addr = static_cast(TestUtils::MapPagesOrDie(1)); - FillBufferWithPath(static_cast(addr), strlen(kPathPart) + 1, true); - - base::ScopedFD parent_sync, child_sync; -diff --git a/sandbox/linux/syscall_broker/syscall_dispatcher.cc b/sandbox/linux/syscall_broker/syscall_dispatcher.cc -index b9ee93c14a..8a42397ef8 100644 ---- a/sandbox/linux/syscall_broker/syscall_dispatcher.cc -+++ b/sandbox/linux/syscall_broker/syscall_dispatcher.cc -@@ -19,8 +19,18 @@ namespace syscall_broker { - #define BROKER_UNPOISON_STRING(x) - #endif - -+int SyscallDispatcher::DefaultStatForTesting(const char* pathname, -+ bool follow_links, -+ default_stat_struct* sb) { -+#if defined(__NR_fstatat64) -+ return Stat64(pathname, follow_links, sb); -+#elif defined(__NR_newfstatat) -+ return Stat(pathname, follow_links, sb); -+#endif -+} -+ - int SyscallDispatcher::PerformStatat(const arch_seccomp_data& args, -- bool arch64) { -+ bool stat64) { - if (static_cast(args.args[0]) != AT_FDCWD) - return -EPERM; - // Only allow the AT_SYMLINK_NOFOLLOW flag which is used by some libc -@@ -30,13 +40,29 @@ int SyscallDispatcher::PerformStatat(const arch_seccomp_data& args, - - const bool follow_links = - !(static_cast(args.args[3]) & AT_SYMLINK_NOFOLLOW); -- if (arch64) { -+ if (stat64) { - return Stat64(reinterpret_cast(args.args[1]), follow_links, -- reinterpret_cast(args.args[2])); -+ reinterpret_cast(args.args[2])); - } - - return Stat(reinterpret_cast(args.args[1]), follow_links, -- reinterpret_cast(args.args[2])); -+ reinterpret_cast(args.args[2])); -+} -+ -+int SyscallDispatcher::PerformUnlinkat(const arch_seccomp_data& args) { -+ if (static_cast(args.args[0]) != AT_FDCWD) -+ return -EPERM; -+ -+ int flags = static_cast(args.args[2]); -+ -+ if (flags == AT_REMOVEDIR) { -+ return Rmdir(reinterpret_cast(args.args[1])); -+ } -+ -+ if (flags != 0) -+ return -EPERM; -+ -+ return Unlink(reinterpret_cast(args.args[1])); - } - - int SyscallDispatcher::DispatchSyscall(const arch_seccomp_data& args) { -@@ -127,59 +153,42 @@ int SyscallDispatcher::DispatchSyscall(const arch_seccomp_data& args) { - #if defined(__NR_stat) - case __NR_stat: - return Stat(reinterpret_cast(args.args[0]), true, -- reinterpret_cast(args.args[1])); -+ reinterpret_cast(args.args[1])); - #endif - #if defined(__NR_stat64) - case __NR_stat64: - return Stat64(reinterpret_cast(args.args[0]), true, -- reinterpret_cast(args.args[1])); -+ reinterpret_cast(args.args[1])); - #endif - #if defined(__NR_lstat) - case __NR_lstat: - // See https://crbug.com/847096 - BROKER_UNPOISON_STRING(reinterpret_cast(args.args[0])); - return Stat(reinterpret_cast(args.args[0]), false, -- reinterpret_cast(args.args[1])); -+ reinterpret_cast(args.args[1])); - #endif - #if defined(__NR_lstat64) - case __NR_lstat64: - // See https://crbug.com/847096 - BROKER_UNPOISON_STRING(reinterpret_cast(args.args[0])); - return Stat64(reinterpret_cast(args.args[0]), false, -- reinterpret_cast(args.args[1])); --#endif --#if defined(__NR_fstatat) -- case __NR_fstatat: -- return PerformStatat(args, /*arch64=*/false); -+ reinterpret_cast(args.args[1])); - #endif - #if defined(__NR_fstatat64) - case __NR_fstatat64: -- return PerformStatat(args, /*arch64=*/true); -+ return PerformStatat(args, /*stat64=*/true); - #endif - #if defined(__NR_newfstatat) - case __NR_newfstatat: -- return PerformStatat(args, /*arch64=*/false); -+ return PerformStatat(args, /*stat64=*/false); - #endif - #if defined(__NR_unlink) - case __NR_unlink: - return Unlink(reinterpret_cast(args.args[0])); - #endif - #if defined(__NR_unlinkat) -- case __NR_unlinkat: { -- if (static_cast(args.args[0]) != AT_FDCWD) -- return -EPERM; -- -- int flags = static_cast(args.args[2]); -- -- if (flags == AT_REMOVEDIR) { -- return Rmdir(reinterpret_cast(args.args[1])); -- } -- -- if (flags != 0) -- return -EPERM; -- -- return Unlink(reinterpret_cast(args.args[1])); -- } -+ case __NR_unlinkat: -+ return PerformUnlinkat(args); - #endif // defined(__NR_unlinkat) - default: - RAW_CHECK(false); -diff --git a/sandbox/linux/syscall_broker/syscall_dispatcher.h b/sandbox/linux/syscall_broker/syscall_dispatcher.h -index d8b8874ad9..1d6653caf3 100644 ---- a/sandbox/linux/syscall_broker/syscall_dispatcher.h -+++ b/sandbox/linux/syscall_broker/syscall_dispatcher.h -@@ -9,13 +9,15 @@ - #include - - #include "sandbox/linux/system_headers/linux_seccomp.h" -+#include "sandbox/linux/system_headers/linux_stat.h" -+#include "sandbox/sandbox_export.h" - - namespace sandbox { - namespace syscall_broker { - - // An abstract class that defines all the system calls we perform for the - // sandboxed process. --class SyscallDispatcher { -+class SANDBOX_EXPORT SyscallDispatcher { - public: - // Emulates access()/faccessat(). - // X_OK will always return an error in practice since the broker process -@@ -40,19 +42,34 @@ class SyscallDispatcher { - virtual int Rmdir(const char* path) const = 0; - - // Emulates stat()/stat64()/lstat()/lstat64()/fstatat()/newfstatat(). -+ // Stat64 is only available on 32-bit systems. - virtual int Stat(const char* pathname, - bool follow_links, -- struct stat* sb) const = 0; -+ struct kernel_stat* sb) const = 0; - virtual int Stat64(const char* pathname, - bool follow_links, -- struct stat64* sb) const = 0; -+ struct kernel_stat64* sb) const = 0; - - // Emulates unlink()/unlinkat(). - virtual int Unlink(const char* unlink) const = 0; - -+ // Different architectures use a different syscall from the stat family by -+ // default in glibc. E.g. 32-bit systems use *stat*64() and fill out struct -+ // kernel_stat64, whereas 64-bit systems use *stat*() and fill out struct -+ // kernel_stat. Some tests want to call the SyscallDispatcher directly, and -+ // should be using the default stat in order to test against glibc. -+ int DefaultStatForTesting(const char* pathname, -+ bool follow_links, -+ default_stat_struct* sb); -+ - // Validates the args passed to a *statat*() syscall and performs the syscall -- // using Stat() or Stat64(). -- int PerformStatat(const arch_seccomp_data& args, bool arch64); -+ // using Stat(), or on 32-bit systems it uses Stat64() for the *statat64() -+ // syscalls. -+ int PerformStatat(const arch_seccomp_data& args, bool stat64); -+ -+ // Validates the args passed to an unlinkat() syscall and performs the syscall -+ // using either Unlink() or Rmdir(). -+ int PerformUnlinkat(const arch_seccomp_data& args); - - // Reads the syscall number and arguments, imposes some policy (e.g. the *at() - // system calls must only allow AT_FDCWD as the first argument), and -diff --git a/sandbox/linux/system_headers/linux_stat.h b/sandbox/linux/system_headers/linux_stat.h -new file mode 100644 -index 0000000000..35788eb22a ---- /dev/null -+++ b/sandbox/linux/system_headers/linux_stat.h -@@ -0,0 +1,188 @@ -+// Copyright 2021 The Chromium Authors. All rights reserved. -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_STAT_H_ -+#define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_STAT_H_ -+ -+#include -+ -+#include "build/build_config.h" -+#include "sandbox/linux/system_headers/linux_syscalls.h" -+ -+#if defined(ARCH_CPU_MIPS_FAMILY) -+#if defined(ARCH_CPU_64_BITS) -+struct kernel_stat { -+#else -+struct kernel_stat64 { -+#endif -+ unsigned st_dev; -+ unsigned __pad0[3]; -+ unsigned long long st_ino; -+ unsigned st_mode; -+ unsigned st_nlink; -+ unsigned st_uid; -+ unsigned st_gid; -+ unsigned st_rdev; -+ unsigned __pad1[3]; -+ long long st_size; -+ unsigned st_atime_; -+ unsigned st_atime_nsec_; -+ unsigned st_mtime_; -+ unsigned st_mtime_nsec_; -+ unsigned st_ctime_; -+ unsigned st_ctime_nsec_; -+ unsigned st_blksize; -+ unsigned __pad2; -+ unsigned long long st_blocks; -+}; -+#else -+struct kernel_stat64 { -+ unsigned long long st_dev; -+ unsigned char __pad0[4]; -+ unsigned __st_ino; -+ unsigned st_mode; -+ unsigned st_nlink; -+ unsigned st_uid; -+ unsigned st_gid; -+ unsigned long long st_rdev; -+ unsigned char __pad3[4]; -+ long long st_size; -+ unsigned st_blksize; -+ unsigned long long st_blocks; -+ unsigned st_atime_; -+ unsigned st_atime_nsec_; -+ unsigned st_mtime_; -+ unsigned st_mtime_nsec_; -+ unsigned st_ctime_; -+ unsigned st_ctime_nsec_; -+ unsigned long long st_ino; -+}; -+#endif -+ -+#if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) -+struct kernel_stat { -+ /* The kernel headers suggest that st_dev and st_rdev should be 32bit -+ * quantities encoding 12bit major and 20bit minor numbers in an interleaved -+ * format. In reality, we do not see useful data in the top bits. So, -+ * we'll leave the padding in here, until we find a better solution. -+ */ -+ unsigned short st_dev; -+ short pad1; -+ unsigned st_ino; -+ unsigned short st_mode; -+ unsigned short st_nlink; -+ unsigned short st_uid; -+ unsigned short st_gid; -+ unsigned short st_rdev; -+ short pad2; -+ unsigned st_size; -+ unsigned st_blksize; -+ unsigned st_blocks; -+ unsigned st_atime_; -+ unsigned st_atime_nsec_; -+ unsigned st_mtime_; -+ unsigned st_mtime_nsec_; -+ unsigned st_ctime_; -+ unsigned st_ctime_nsec_; -+ unsigned __unused4; -+ unsigned __unused5; -+}; -+#elif defined(__x86_64__) -+struct kernel_stat { -+ uint64_t st_dev; -+ uint64_t st_ino; -+ uint64_t st_nlink; -+ unsigned st_mode; -+ unsigned st_uid; -+ unsigned st_gid; -+ unsigned __pad0; -+ uint64_t st_rdev; -+ int64_t st_size; -+ int64_t st_blksize; -+ int64_t st_blocks; -+ uint64_t st_atime_; -+ uint64_t st_atime_nsec_; -+ uint64_t st_mtime_; -+ uint64_t st_mtime_nsec_; -+ uint64_t st_ctime_; -+ uint64_t st_ctime_nsec_; -+ int64_t __unused4[3]; -+}; -+#elif (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) -+struct kernel_stat { -+ unsigned st_dev; -+ int st_pad1[3]; -+ unsigned st_ino; -+ unsigned st_mode; -+ unsigned st_nlink; -+ unsigned st_uid; -+ unsigned st_gid; -+ unsigned st_rdev; -+ int st_pad2[2]; -+ long st_size; -+ int st_pad3; -+ long st_atime_; -+ long st_atime_nsec_; -+ long st_mtime_; -+ long st_mtime_nsec_; -+ long st_ctime_; -+ long st_ctime_nsec_; -+ int st_blksize; -+ int st_blocks; -+ int st_pad4[14]; -+}; -+#elif defined(__aarch64__) -+struct kernel_stat { -+ unsigned long st_dev; -+ unsigned long st_ino; -+ unsigned int st_mode; -+ unsigned int st_nlink; -+ unsigned int st_uid; -+ unsigned int st_gid; -+ unsigned long st_rdev; -+ unsigned long __pad1; -+ long st_size; -+ int st_blksize; -+ int __pad2; -+ long st_blocks; -+ long st_atime_; -+ unsigned long st_atime_nsec_; -+ long st_mtime_; -+ unsigned long st_mtime_nsec_; -+ long st_ctime_; -+ unsigned long st_ctime_nsec_; -+ unsigned int __unused4; -+ unsigned int __unused5; -+}; -+#endif -+ -+// On 32-bit systems, we default to the 64-bit stat struct like libc -+// implementations do. Otherwise we default to the normal stat struct which is -+// already 64-bit. -+// These defines make it easy to call the right syscall to fill out a 64-bit -+// stat struct, which is the default in libc implementations but requires -+// different syscall names on 32 and 64-bit platforms. -+#if defined(__NR_fstatat64) -+ -+namespace sandbox { -+using default_stat_struct = struct kernel_stat64; -+} // namespace sandbox -+ -+#define __NR_fstatat_default __NR_fstatat64 -+#define __NR_fstat_default __NR_fstat64 -+ -+#elif defined(__NR_newfstatat) -+ -+namespace sandbox { -+using default_stat_struct = struct kernel_stat; -+} // namespace sandbox -+ -+#define __NR_fstatat_default __NR_newfstatat -+#define __NR_fstat_default __NR_fstat -+ -+#else -+#error "one of fstatat64 and newfstatat must be defined" -+#endif -+ -+#endif // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_STAT_H_ -diff --git a/sandbox/linux/system_headers/linux_time.h b/sandbox/linux/system_headers/linux_time.h -index 780f24dddd..f18c806611 100644 ---- a/sandbox/linux/system_headers/linux_time.h -+++ b/sandbox/linux/system_headers/linux_time.h -@@ -11,6 +11,32 @@ - #define CPUCLOCK_CLOCK_MASK 3 - #endif - -+#if !defined(CPUCLOCK_PROF) -+#define CPUCLOCK_PROF 0 -+#endif -+ -+#if !defined(CPUCLOCK_VIRT) -+#define CPUCLOCK_VIRT 1 -+#endif -+ -+#if !defined(CPUCLOCK_SCHED) -+#define CPUCLOCK_SCHED 2 -+#endif -+ -+#if !defined(CPUCLOCK_PERTHREAD_MASK) -+#define CPUCLOCK_PERTHREAD_MASK 4 -+#endif -+ -+#if !defined(MAKE_PROCESS_CPUCLOCK) -+#define MAKE_PROCESS_CPUCLOCK(pid, clock) \ -+ ((int)(~(unsigned)(pid) << 3) | (int)(clock)) -+#endif -+ -+#if !defined(MAKE_THREAD_CPUCLOCK) -+#define MAKE_THREAD_CPUCLOCK(tid, clock) \ -+ ((int)(~(unsigned)(tid) << 3) | (int)((clock) | CPUCLOCK_PERTHREAD_MASK)) -+#endif -+ - #if !defined(CLOCKFD) - #define CLOCKFD 3 - #endif -diff --git a/sandbox/linux/tests/test_utils.cc b/sandbox/linux/tests/test_utils.cc -index 847c20b20c..cf6041a4b4 100644 ---- a/sandbox/linux/tests/test_utils.cc -+++ b/sandbox/linux/tests/test_utils.cc -@@ -5,12 +5,14 @@ - #include "sandbox/linux/tests/test_utils.h" - - #include -+#include - #include - #include - #include - #include - - #include "base/check_op.h" -+#include "base/memory/page_size.h" - #include "base/posix/eintr_wrapper.h" - - namespace sandbox { -@@ -39,4 +41,17 @@ void TestUtils::HandlePostForkReturn(pid_t pid) { - } - } - -+void* TestUtils::MapPagesOrDie(size_t num_pages) { -+ void* addr = mmap(nullptr, num_pages * base::GetPageSize(), -+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); -+ PCHECK(addr); -+ return addr; -+} -+ -+void TestUtils::MprotectLastPageOrDie(char* addr, size_t num_pages) { -+ size_t last_page_offset = (num_pages - 1) * base::GetPageSize(); -+ PCHECK(mprotect(addr + last_page_offset, base::GetPageSize(), PROT_NONE) >= -+ 0); -+} -+ - } // namespace sandbox -diff --git a/sandbox/linux/tests/test_utils.h b/sandbox/linux/tests/test_utils.h -index 7cf9749fe4..43b028b1e3 100644 ---- a/sandbox/linux/tests/test_utils.h -+++ b/sandbox/linux/tests/test_utils.h -@@ -19,6 +19,8 @@ class TestUtils { - // makes sure that if fork() succeeded the child exits - // and the parent waits for it. - static void HandlePostForkReturn(pid_t pid); -+ static void* MapPagesOrDie(size_t num_pages); -+ static void MprotectLastPageOrDie(char* addr, size_t num_pages); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(TestUtils); -diff --git a/sandbox/policy/linux/bpf_broker_policy_linux.cc b/sandbox/policy/linux/bpf_broker_policy_linux.cc -index 2963bb9ca8..6dc8c0581b 100644 ---- a/sandbox/policy/linux/bpf_broker_policy_linux.cc -+++ b/sandbox/policy/linux/bpf_broker_policy_linux.cc -@@ -93,8 +93,8 @@ ResultExpr BrokerProcessPolicy::EvaluateSyscall(int sysno) const { - return Allow(); - break; - #endif --#if defined(__NR_fstatat) -- case __NR_fstatat: -+#if defined(__NR_fstatat64) -+ case __NR_fstatat64: - if (allowed_command_set_.test(syscall_broker::COMMAND_STAT)) - return Allow(); - break; diff --git a/chromium-92.0.4515.107-make-GetUsableSize-handle-nullptr-gracefully.patch b/chromium-92.0.4515.107-make-GetUsableSize-handle-nullptr-gracefully.patch deleted file mode 100644 index 3a03645..0000000 --- a/chromium-92.0.4515.107-make-GetUsableSize-handle-nullptr-gracefully.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 61e16c92ff24bb71b9b7309a9d6d470ee91738bc Mon Sep 17 00:00:00 2001 -From: Bartek Nowierski -Date: Wed, 21 Jul 2021 15:01:38 +0000 -Subject: [PATCH] [PA] Make GetUsableSize() handle nullptr gracefully - -malloc_usable_size() is expected to not crush on NULL and return 0. - -Bug: 1221442 -Change-Id: I6a3b90dcf3a8ad18114c206d87b98f60d5f50eb1 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3042177 -Commit-Queue: Bartek Nowierski -Commit-Queue: Kentaro Hara -Auto-Submit: Bartek Nowierski -Reviewed-by: Kentaro Hara -Cr-Commit-Position: refs/heads/master@{#903900} ---- - .../allocator/partition_allocator/partition_alloc_unittest.cc | 4 ++++ - base/allocator/partition_allocator/partition_root.h | 3 +++ - 2 files changed, 7 insertions(+) - -diff --git a/base/allocator/partition_allocator/partition_alloc_unittest.cc b/base/allocator/partition_allocator/partition_alloc_unittest.cc -index c12120114aa7..8863984cd805 100644 ---- a/base/allocator/partition_allocator/partition_alloc_unittest.cc -+++ b/base/allocator/partition_allocator/partition_alloc_unittest.cc -@@ -2838,6 +2838,10 @@ TEST_F(PartitionAllocTest, OptimizedGetSlotNumber) { - } - } - -+TEST_F(PartitionAllocTest, GetUsableSizeNull) { -+ EXPECT_EQ(0ULL, PartitionRoot::GetUsableSize(nullptr)); -+} -+ - TEST_F(PartitionAllocTest, GetUsableSize) { - size_t delta = SystemPageSize() + 1; - for (size_t size = 1; size <= kMinDirectMappedDownsize; size += delta) { -diff --git a/base/allocator/partition_allocator/partition_root.h b/base/allocator/partition_allocator/partition_root.h -index b72a1d94a4e4..baac952597d1 100644 ---- a/base/allocator/partition_allocator/partition_root.h -+++ b/base/allocator/partition_allocator/partition_root.h -@@ -1220,6 +1220,9 @@ ALWAYS_INLINE bool PartitionRoot::TryRecommitSystemPagesForData( - // PartitionAlloc's internal data. Used as malloc_usable_size. - template - ALWAYS_INLINE size_t PartitionRoot::GetUsableSize(void* ptr) { -+ // malloc_usable_size() is expected to handle NULL gracefully and return 0. -+ if (!ptr) -+ return 0; - auto* slot_span = SlotSpan::FromSlotInnerPtr(ptr); - auto* root = FromSlotSpan(slot_span); - return slot_span->GetUsableSize(root); diff --git a/chromium-92.0.4515.107-sql-make-VirtualCursor-standard-layout-type.patch b/chromium-92.0.4515.107-sql-make-VirtualCursor-standard-layout-type.patch deleted file mode 100644 index c1c68f1..0000000 --- a/chromium-92.0.4515.107-sql-make-VirtualCursor-standard-layout-type.patch +++ /dev/null @@ -1,238 +0,0 @@ -From 80368f8ba7a8bab13440463a254888311efe3986 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Tue, 4 May 2021 15:00:19 +0000 -Subject: [PATCH] sql: make VirtualCursor standard layout type - -sql::recover::VirtualCursor needs to be a standard layout type, but -has members of type std::unique_ptr. However, std::unique_ptr is not -guaranteed to be standard layout. Compiling with clang combined with -gcc-11 libstdc++ fails because of this. Replace std::unique_ptr with -raw pointers. - -Bug: 1189788 -Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c ---- - sql/recover_module/btree.cc | 21 +++++++++++++++------ - sql/recover_module/btree.h | 17 +++++++++++++---- - sql/recover_module/cursor.cc | 24 ++++++++++++------------ - sql/recover_module/cursor.h | 2 +- - sql/recover_module/pager.cc | 7 +++---- - sql/recover_module/pager.h | 5 +++-- - 6 files changed, 47 insertions(+), 29 deletions(-) - -diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc -index 9ecaafe8a3..839318abf9 100644 ---- a/sql/recover_module/btree.cc -+++ b/sql/recover_module/btree.cc -@@ -135,16 +135,25 @@ static_assert(std::is_trivially_destructible::value, - "Move the destructor to the .cc file if it's non-trival"); - #endif // !DCHECK_IS_ON() - --LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept -- : page_id_(db_reader->page_id()), -- db_reader_(db_reader), -- cell_count_(ComputeCellCount(db_reader)), -- next_read_index_(0), -- last_record_size_(0) { -+void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) { -+ DCHECK(db_reader); - DCHECK(IsOnValidPage(db_reader)); -+ page_id_ = db_reader->page_id(); -+ db_reader_ = db_reader; -+ cell_count_ = ComputeCellCount(db_reader); -+ next_read_index_ = 0; -+ last_record_size_ = 0; - DCHECK(DatabasePageReader::IsValidPageId(page_id_)); - } - -+void LeafPageDecoder::Reset() { -+ db_reader_ = nullptr; -+ page_id_ = 0; -+ cell_count_ = 0; -+ next_read_index_ = 0; -+ last_record_size_ = 0; -+} -+ - bool LeafPageDecoder::TryAdvance() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(CanAdvance()); -diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h -index d76d076bf6..33114b01fa 100644 ---- a/sql/recover_module/btree.h -+++ b/sql/recover_module/btree.h -@@ -102,7 +102,7 @@ class LeafPageDecoder { - // - // |db_reader| must have been used to read an inner page of a table B-tree. - // |db_reader| must outlive this instance. -- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept; -+ explicit LeafPageDecoder() noexcept = default; - ~LeafPageDecoder() noexcept = default; - - LeafPageDecoder(const LeafPageDecoder&) = delete; -@@ -150,6 +150,15 @@ class LeafPageDecoder { - // read as long as CanAdvance() returns true. - bool TryAdvance(); - -+ // Initialize with DatabasePageReader -+ void Initialize(DatabasePageReader* db_reader); -+ -+ // Reset internal DatabasePageReader -+ void Reset(); -+ -+ // True if DatabasePageReader is valid -+ bool IsValid() { return (db_reader_ != nullptr); } -+ - // True if the given reader may point to an inner page in a table B-tree. - // - // The last ReadPage() call on |db_reader| must have succeeded. -@@ -163,14 +172,14 @@ class LeafPageDecoder { - static int ComputeCellCount(DatabasePageReader* db_reader); - - // The number of the B-tree page this reader is reading. -- const int64_t page_id_; -+ int64_t page_id_; - // Used to read the tree page. - // - // Raw pointer usage is acceptable because this instance's owner is expected - // to ensure that the DatabasePageReader outlives this. -- DatabasePageReader* const db_reader_; -+ DatabasePageReader* db_reader_; - // Caches the ComputeCellCount() value for this reader's page. -- const int cell_count_ = ComputeCellCount(db_reader_); -+ int cell_count_; - - // The reader's cursor state. - // -diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc -index 0029ff9295..42548bc4b5 100644 ---- a/sql/recover_module/cursor.cc -+++ b/sql/recover_module/cursor.cc -@@ -26,7 +26,7 @@ VirtualCursor::~VirtualCursor() { - int VirtualCursor::First() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - inner_decoders_.clear(); -- leaf_decoder_ = nullptr; -+ leaf_decoder_.Reset(); - - AppendPageDecoder(table_->root_page_id()); - return Next(); -@@ -36,18 +36,18 @@ int VirtualCursor::Next() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - record_reader_.Reset(); - -- while (!inner_decoders_.empty() || leaf_decoder_.get()) { -- if (leaf_decoder_.get()) { -- if (!leaf_decoder_->CanAdvance()) { -+ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) { -+ if (leaf_decoder_.IsValid()) { -+ if (!leaf_decoder_.CanAdvance()) { - // The leaf has been exhausted. Remove it from the DFS stack. -- leaf_decoder_ = nullptr; -+ leaf_decoder_.Reset(); - continue; - } -- if (!leaf_decoder_->TryAdvance()) -+ if (!leaf_decoder_.TryAdvance()) - continue; - -- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(), -- leaf_decoder_->last_record_offset())) { -+ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(), -+ leaf_decoder_.last_record_offset())) { - continue; - } - if (!record_reader_.Initialize()) -@@ -99,13 +99,13 @@ int VirtualCursor::ReadColumn(int column_index, - int64_t VirtualCursor::RowId() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(record_reader_.IsInitialized()); -- DCHECK(leaf_decoder_.get()); -- return leaf_decoder_->last_record_rowid(); -+ DCHECK(leaf_decoder_.IsValid()); -+ return leaf_decoder_.last_record_rowid(); - } - - void VirtualCursor::AppendPageDecoder(int page_id) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -- DCHECK(leaf_decoder_.get() == nullptr) -+ DCHECK(!leaf_decoder_.IsValid()) - << __func__ - << " must only be called when the current path has no leaf decoder"; - -@@ -113,7 +113,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) { - return; - - if (LeafPageDecoder::IsOnValidPage(&db_reader_)) { -- leaf_decoder_ = std::make_unique(&db_reader_); -+ leaf_decoder_.Initialize(&db_reader_); - return; - } - -diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h -index afcd6900e1..b15c31d425 100644 ---- a/sql/recover_module/cursor.h -+++ b/sql/recover_module/cursor.h -@@ -129,7 +129,7 @@ class VirtualCursor { - std::vector> inner_decoders_; - - // Decodes the leaf page containing records. -- std::unique_ptr leaf_decoder_; -+ LeafPageDecoder leaf_decoder_; - - SEQUENCE_CHECKER(sequence_checker_); - }; -diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc -index 58e75de270..5fe96204e5 100644 ---- a/sql/recover_module/pager.cc -+++ b/sql/recover_module/pager.cc -@@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits::max(), - "ints are not appropriate for representing page IDs"); - - DatabasePageReader::DatabasePageReader(VirtualTable* table) -- : page_data_(std::make_unique(table->page_size())), -- table_(table) { -+ : page_data_(), table_(table) { - DCHECK(table != nullptr); - DCHECK(IsValidPageSize(table->page_size())); - } -@@ -57,8 +56,8 @@ int DatabasePageReader::ReadPage(int page_id) { - std::numeric_limits::max(), - "The |read_offset| computation above may overflow"); - -- int sqlite_status = -- RawRead(sqlite_file, read_size, read_offset, page_data_.get()); -+ int sqlite_status = RawRead(sqlite_file, read_size, read_offset, -+ const_cast(page_data_.data())); - - // |page_id_| needs to be set to kInvalidPageId if the read failed. - // Otherwise, future ReadPage() calls with the previous |page_id_| value -diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h -index 0e388ddc3b..99314e30ff 100644 ---- a/sql/recover_module/pager.h -+++ b/sql/recover_module/pager.h -@@ -5,6 +5,7 @@ - #ifndef SQL_RECOVER_MODULE_PAGER_H_ - #define SQL_RECOVER_MODULE_PAGER_H_ - -+#include - #include - #include - -@@ -70,7 +71,7 @@ class DatabasePageReader { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK_NE(page_id_, kInvalidPageId) - << "Successful ReadPage() required before accessing pager state"; -- return page_data_.get(); -+ return page_data_.data(); - } - - // The number of bytes in the page read by the last ReadPage() call. -@@ -137,7 +138,7 @@ class DatabasePageReader { - int page_id_ = kInvalidPageId; - // Stores the bytes of the last page successfully read by ReadPage(). - // The content is undefined if the last call to ReadPage() did not succeed. -- const std::unique_ptr page_data_; -+ const std::array page_data_; - // Raw pointer usage is acceptable because this instance's owner is expected - // to ensure that the VirtualTable outlives this. - VirtualTable* const table_; diff --git a/chromium-92.0.4515.131-freetype-2.11.patch b/chromium-92.0.4515.131-freetype-2.11.patch deleted file mode 100644 index aee6dc8..0000000 --- a/chromium-92.0.4515.131-freetype-2.11.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- a/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp -+++ b/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp -@@ -712,7 +712,11 @@ void colrv1_draw_paint(SkCanvas* canvas, - canvas->drawPaint(colrPaint); - break; - } -+#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11 -+ case FT_COLR_PAINTFORMAT_TRANSFORM: -+#else - case FT_COLR_PAINTFORMAT_TRANSFORMED: -+#endif - case FT_COLR_PAINTFORMAT_TRANSLATE: - case FT_COLR_PAINTFORMAT_ROTATE: - case FT_COLR_PAINTFORMAT_SKEW: -@@ -759,10 +763,17 @@ void colrv1_transform(SkCanvas* canvas, FT_Face face, FT_COLR_Paint colrv1_paint - SkMatrix transform; - - switch (colrv1_paint.format) { -+#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11 -+ case FT_COLR_PAINTFORMAT_TRANSFORM: { -+ transform = ToSkMatrix(colrv1_paint.u.transform.affine); -+ break; -+ } -+#else - case FT_COLR_PAINTFORMAT_TRANSFORMED: { - transform = ToSkMatrix(colrv1_paint.u.transformed.affine); - break; - } -+#endif - case FT_COLR_PAINTFORMAT_TRANSLATE: { - transform = SkMatrix::Translate( - SkFixedToScalar(colrv1_paint.u.translate.dx), -@@ -880,10 +891,17 @@ bool colrv1_traverse_paint(SkCanvas* canvas, - traverse_result = colrv1_start_glyph(canvas, palette, face, paint.u.colr_glyph.glyphID, - FT_COLOR_NO_ROOT_TRANSFORM); - break; -+#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11 -+ case FT_COLR_PAINTFORMAT_TRANSFORM: -+ colrv1_transform(canvas, face, paint); -+ traverse_result = colrv1_traverse_paint(canvas, palette, face, -+ paint.u.transform.paint, visited_set); -+#else - case FT_COLR_PAINTFORMAT_TRANSFORMED: - colrv1_transform(canvas, face, paint); - traverse_result = colrv1_traverse_paint(canvas, palette, face, - paint.u.transformed.paint, visited_set); -+#endif - break; - case FT_COLR_PAINTFORMAT_TRANSLATE: - colrv1_transform(canvas, face, paint); diff --git a/chromium-92.0.4515.131-gcc-fix-swiftshader-libEGL-visibility.patch b/chromium-92.0.4515.131-gcc-fix-swiftshader-libEGL-visibility.patch deleted file mode 100644 index d1bbe88..0000000 --- a/chromium-92.0.4515.131-gcc-fix-swiftshader-libEGL-visibility.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -up chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn.gcc-swiftshader-visibility chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn ---- chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn.gcc-swiftshader-visibility 2021-02-25 16:31:51.929335783 +0000 -+++ chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn 2021-02-25 16:31:51.929335783 +0000 -@@ -42,7 +42,8 @@ config("swiftshader_libEGL_private_confi - } else if (is_clang) { - defines += [ "EGLAPI=__attribute__((visibility(\"protected\"))) __attribute__((no_sanitize(\"function\")))" ] - } else { -- defines += [ "EGLAPI= " ] -+ cflags += [ "-fvisibility=protected" ] -+ defines += [ "EGLAPI=__attribute__((visibility(\"protected\")))" ] - } - } - } -diff -up chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn.gcc-swiftshader-visibility chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn ---- chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn.gcc-swiftshader-visibility 2021-02-25 18:16:28.576901417 +0000 -+++ chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn 2021-02-25 18:17:50.356567690 +0000 -@@ -57,7 +57,8 @@ config("swiftshader_libGLESv2_private_co - } else if (is_clang) { - defines += [ "GL_APICALL=__attribute__((visibility(\"protected\"))) __attribute__((no_sanitize(\"function\")))" ] - } else { -- defines += [ "GL_APICALL= " ] -+ cflags += [ "-fvisibility=protected" ] -+ defines += [ "GL_APICALL=__attribute__((visibility(\"protected\")))" ] - } - } - } diff --git a/chromium-93.0.4577.63-replace-blacklist-with-ignorelist.patch b/chromium-93.0.4577.63-replace-blacklist-with-ignorelist.patch deleted file mode 100644 index 1cc3a50..0000000 --- a/chromium-93.0.4577.63-replace-blacklist-with-ignorelist.patch +++ /dev/null @@ -1,196 +0,0 @@ -From 9d080c0934b848ee4a05013c78641e612fcc1e03 Mon Sep 17 00:00:00 2001 -From: Dylan Cutler -Date: Wed, 26 May 2021 16:39:52 +0000 -Subject: [PATCH] Reland "Replace 'blacklist' with 'ignorelist' in - ./tools/msan/." - -This is a reland of 3b6263f2eece1264b052dfdcbc03b851d5abfb48 - -Relanding now that https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/2897974 is merged - -Original change's description: -> Replace 'blacklist' with 'ignorelist' in ./tools/msan/. -> -> Bug: 1097272, 1097268 -> Change-Id: Id5c8227a5bfb1ffaec82d3168b609085b10c8297 -> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2867730 -> Commit-Queue: Dylan Cutler -> Reviewed-by: Nico Weber -> Reviewed-by: Jonathan Metzman -> Cr-Commit-Position: refs/heads/master@{#883035} - -Bug: 1097272 -Bug: 1097268 -Change-Id: I11a5bc8972680c95fb1dab95ed3b707ed76f4667 -Cq-Include-Trybots: luci.chromium.try:chromeos-amd64-generic-cfi-thin-lto-rel -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2911096 -Commit-Queue: Dylan Cutler -Reviewed-by: Nico Weber -Cr-Commit-Position: refs/heads/master@{#886773} ---- - build/config/sanitizers/BUILD.gn | 44 ++++++++++---------- - build_overrides/build.gni | 14 +++---- - tools/msan/{blacklist.txt => ignorelist.txt} | 0 - 3 files changed, 29 insertions(+), 29 deletions(-) - rename tools/msan/{blacklist.txt => ignorelist.txt} (100%) - -diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn -index aaaad023474d..55b388a43743 100644 ---- a/build/config/sanitizers/BUILD.gn -+++ b/build/config/sanitizers/BUILD.gn -@@ -272,11 +272,11 @@ config("asan_flags") { - if (is_asan) { - cflags += [ "-fsanitize=address" ] - if (is_win) { -- if (!defined(asan_win_blacklist_path)) { -- asan_win_blacklist_path = -+ if (!defined(asan_win_blocklist_path)) { -+ asan_win_blocklist_path = - rebase_path("//tools/memory/asan/blocklist_win.txt", root_build_dir) - } -- cflags += [ "-fsanitize-blacklist=$asan_win_blacklist_path" ] -+ cflags += [ "-fsanitize-ignorelist=$asan_win_blocklist_path" ] - } - } - } -@@ -306,13 +306,13 @@ config("link_shared_library") { - config("cfi_flags") { - cflags = [] - if (is_cfi && current_toolchain == default_toolchain) { -- if (!defined(cfi_blacklist_path)) { -- cfi_blacklist_path = -+ if (!defined(cfi_ignorelist_path)) { -+ cfi_ignorelist_path = - rebase_path("//tools/cfi/ignores.txt", root_build_dir) - } - cflags += [ - "-fsanitize=cfi-vcall", -- "-fsanitize-blacklist=$cfi_blacklist_path", -+ "-fsanitize-ignorelist=$cfi_ignorelist_path", - ] - - if (use_cfi_cast) { -@@ -409,14 +409,14 @@ config("msan_flags") { - if (is_msan) { - assert(is_linux || is_chromeos, - "msan only supported on linux x86_64/ChromeOS") -- if (!defined(msan_blacklist_path)) { -- msan_blacklist_path = -- rebase_path("//tools/msan/blacklist.txt", root_build_dir) -+ if (!defined(msan_ignorelist_path)) { -+ msan_ignorelist_path = -+ rebase_path("//tools/msan/ignorelist.txt", root_build_dir) - } - cflags = [ - "-fsanitize=memory", - "-fsanitize-memory-track-origins=$msan_track_origins", -- "-fsanitize-blacklist=$msan_blacklist_path", -+ "-fsanitize-ignorelist=$msan_ignorelist_path", - ] - } - } -@@ -424,13 +424,13 @@ config("msan_flags") { - config("tsan_flags") { - if (is_tsan) { - assert(is_linux || is_chromeos, "tsan only supported on linux x86_64") -- if (!defined(tsan_blacklist_path)) { -- tsan_blacklist_path = -+ if (!defined(tsan_ignorelist_path)) { -+ tsan_ignorelist_path = - rebase_path("//tools/memory/tsan_v2/ignores.txt", root_build_dir) - } - cflags = [ - "-fsanitize=thread", -- "-fsanitize-blacklist=$tsan_blacklist_path", -+ "-fsanitize-ignorelist=$tsan_ignorelist_path", - ] - } - } -@@ -438,8 +438,8 @@ config("tsan_flags") { - config("ubsan_flags") { - cflags = [] - if (is_ubsan) { -- if (!defined(ubsan_blacklist_path)) { -- ubsan_blacklist_path = -+ if (!defined(ubsan_ignorelist_path)) { -+ ubsan_ignorelist_path = - rebase_path("//tools/ubsan/ignorelist.txt", root_build_dir) - } - cflags += [ -@@ -456,7 +456,7 @@ config("ubsan_flags") { - "-fsanitize=signed-integer-overflow", - "-fsanitize=unreachable", - "-fsanitize=vla-bound", -- "-fsanitize-blacklist=$ubsan_blacklist_path", -+ "-fsanitize-ignorelist=$ubsan_ignorelist_path", - ] - - # Chromecast ubsan builds fail to compile with these -@@ -486,8 +486,8 @@ config("ubsan_no_recover") { - - config("ubsan_security_flags") { - if (is_ubsan_security) { -- if (!defined(ubsan_security_blacklist_path)) { -- ubsan_security_blacklist_path = -+ if (!defined(ubsan_security_ignorelist_path)) { -+ ubsan_security_ignorelist_path = - rebase_path("//tools/ubsan/security_ignorelist.txt", root_build_dir) - } - cflags = [ -@@ -495,7 +495,7 @@ config("ubsan_security_flags") { - "-fsanitize=shift", - "-fsanitize=signed-integer-overflow", - "-fsanitize=vla-bound", -- "-fsanitize-blacklist=$ubsan_security_blacklist_path", -+ "-fsanitize-ignorelist=$ubsan_security_ignorelist_path", - ] - } - } -@@ -508,13 +508,13 @@ config("ubsan_null_flags") { - - config("ubsan_vptr_flags") { - if (is_ubsan_vptr) { -- if (!defined(ubsan_vptr_blacklist_path)) { -- ubsan_vptr_blacklist_path = -+ if (!defined(ubsan_vptr_ignorelist_path)) { -+ ubsan_vptr_ignorelist_path = - rebase_path("//tools/ubsan/vptr_ignorelist.txt", root_build_dir) - } - cflags = [ - "-fsanitize=vptr", -- "-fsanitize-blacklist=$ubsan_vptr_blacklist_path", -+ "-fsanitize-ignorelist=$ubsan_vptr_ignorelist_path", - ] - } - } -diff --git a/build_overrides/build.gni b/build_overrides/build.gni -index 82627b03653f..f3e563ab701b 100644 ---- a/build_overrides/build.gni -+++ b/build_overrides/build.gni -@@ -42,15 +42,15 @@ declare_args() { - # Allows different projects to specify their own suppression/ignore lists for - # sanitizer tools. - # asan_suppressions_file = "path/to/asan_suppressions.cc" --# asan_win_blacklist_path = "path/to/asan/blocklist_win.txt" -+# asan_win_ignorelist_path = "path/to/asan/blocklist_win.txt" - # lsan_suppressions_file = "path/to/lsan_suppressions.cc" - # tsan_suppressions_file = "path/to/tsan_suppressions.cc" --# tsan_blacklist_path = "path/to/tsan/ignores.txt" --# msan_blacklist_path = "path/to/msan/blacklist.txt" --# ubsan_blacklist_path = "path/to/ubsan/blacklist.txt" --# ubsan_vptr_blacklist_path = "path/to/ubsan/vptr_blacklist.txt" --# ubsan_security_blacklist_path = "path/to/ubsan/security_blacklist.txt" --# cfi_blacklist_path = "path/to/cfi/ignores.txt" -+# tsan_ignorelist_path = "path/to/tsan/ignores.txt" -+# msan_ignorelist_path = "path/to/msan/ignorelist.txt" -+# ubsan_ignorelist_path = "path/to/ubsan/ignorelist.txt" -+# ubsan_vptr_ignorelist_path = "path/to/ubsan/vptr_ignorelist.txt" -+# ubsan_security_ignorelist_path = "path/to/ubsan/security_ignorelist.txt" -+# cfi_ignorelist_path = "path/to/cfi/ignores.txt" - - declare_args() { - # Android 32-bit non-component, non-clang builds cannot have symbol_level=2 -diff --git a/tools/msan/blacklist.txt b/tools/msan/ignorelist.txt -similarity index 100% -rename from tools/msan/blacklist.txt -rename to tools/msan/ignorelist.txt diff --git a/chromium-94.0.4606.71-add-a-TODO-about-a-missing-pnacl-flag.patch b/chromium-94.0.4606.71-add-a-TODO-about-a-missing-pnacl-flag.patch deleted file mode 100644 index bfeafee..0000000 --- a/chromium-94.0.4606.71-add-a-TODO-about-a-missing-pnacl-flag.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 7a23987acb698c2934958cb42a5e7b1cd73fe142 Mon Sep 17 00:00:00 2001 -From: Nico Weber -Date: Tue, 20 Jul 2021 21:54:09 +0000 -Subject: [PATCH] build: Add a TODO about a missing pnacl flag - -Change-Id: I1700d185a23afe4120e14c755782450b1bf89289 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3041785 -Commit-Queue: Nico Weber -Commit-Queue: Hans Wennborg -Auto-Submit: Nico Weber -Reviewed-by: Hans Wennborg -Cr-Commit-Position: refs/heads/master@{#903659} ---- - build/config/compiler/BUILD.gn | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index b6e095b705..ef6d1dfc12 100644 ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -1217,6 +1217,7 @@ config("compiler_deterministic") { - # we build same files with same compile flag. - # Other paths are already given in relative, no need to normalize them. - if (is_nacl) { -+ # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. - cflags += [ - "-Xclang", - "-fdebug-compilation-dir", diff --git a/chromium-94.0.4606.71-ffmpeg-4.4.patch b/chromium-94.0.4606.71-ffmpeg-4.4.patch deleted file mode 100644 index f0ec736..0000000 --- a/chromium-94.0.4606.71-ffmpeg-4.4.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc -index ac4713b07268..492a9a37d096 100644 ---- a/media/filters/ffmpeg_demuxer.cc -+++ b/media/filters/ffmpeg_demuxer.cc -@@ -427,11 +427,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { - scoped_refptr buffer; - - if (type() == DemuxerStream::TEXT) { -- size_t id_size = 0; -+ int id_size = 0; - uint8_t* id_data = av_packet_get_side_data( - packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size); - -- size_t settings_size = 0; -+ int settings_size = 0; - uint8_t* settings_data = av_packet_get_side_data( - packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size); - -@@ -443,7 +443,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { - buffer = DecoderBuffer::CopyFrom(packet->data, packet->size, - side_data.data(), side_data.size()); - } else { -- size_t side_data_size = 0; -+ int side_data_size = 0; - uint8_t* side_data = av_packet_get_side_data( - packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size); - -@@ -504,7 +504,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { - packet->size - data_offset); - } - -- size_t skip_samples_size = 0; -+ int skip_samples_size = 0; - const uint32_t* skip_samples_ptr = - reinterpret_cast(av_packet_get_side_data( - packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); diff --git a/chromium-94.0.4606.71-ffmpeg-roll.patch b/chromium-94.0.4606.71-ffmpeg-roll.patch deleted file mode 100644 index 68f2636..0000000 --- a/chromium-94.0.4606.71-ffmpeg-roll.patch +++ /dev/null @@ -1,49 +0,0 @@ -From b94755e4633045be96ab5e0bdde0db7e16a804bd Mon Sep 17 00:00:00 2001 -From: "liberato@chromium.org" -Date: Fri, 6 Aug 2021 04:25:31 +0000 -Subject: [PATCH] FFmpeg M94 roll. - -Contains DEPS update + chromium-side fixes. - -Bug: 1227259 -Change-Id: I61c5eaa789ea12c17d0cbcbf837435b9cf32479b -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3011889 -Reviewed-by: Thomas Guilbert -Commit-Queue: Frank Liberato -Cr-Commit-Position: refs/heads/master@{#909174} ---- - media/ffmpeg/ffmpeg_common.h | 1 + - media/filters/ffmpeg_demuxer.cc | 4 ++-- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h -index cede8ac5a7..97d6307e28 100644 ---- a/media/ffmpeg/ffmpeg_common.h -+++ b/media/ffmpeg/ffmpeg_common.h -@@ -29,6 +29,7 @@ extern "C" { - #include - #include - #include -+#include - #include - #include - #include -diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc -index ac4713b072..605001d935 100644 ---- a/media/filters/ffmpeg_demuxer.cc -+++ b/media/filters/ffmpeg_demuxer.cc -@@ -106,12 +106,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) { - - // Next try to use the first DTS value, for codecs where we know PTS == DTS - // (excludes all H26x codecs). The start time must be returned in PTS. -- if (stream->first_dts != kNoFFmpegTimestamp && -+ if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp && - stream->codecpar->codec_id != AV_CODEC_ID_HEVC && - stream->codecpar->codec_id != AV_CODEC_ID_H264 && - stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) { - const base::TimeDelta first_pts = -- ConvertFromTimeBase(stream->time_base, stream->first_dts); -+ ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream)); - if (first_pts < start_time) - start_time = first_pts; - } diff --git a/chromium-94.0.4606.71-unexpire-accelerated-video-decode-flag.patch b/chromium-94.0.4606.71-unexpire-accelerated-video-decode-flag.patch deleted file mode 100644 index da3a4a5..0000000 --- a/chromium-94.0.4606.71-unexpire-accelerated-video-decode-flag.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- chrome/browser/flag-metadata.json.orig 2021-09-21 18:34:38.740426608 +0000 -+++ chrome/browser/flag-metadata.json 2021-09-21 18:35:09.392000797 +0000 -@@ -1285,7 +1285,7 @@ - { - "name": "enable-accelerated-video-decode", - "owners": [ "media-dev@chromium.org" ], -- "expiry_milestone": 93 -+ "expiry_milestone": 99 - }, - { - "name": "enable-accessibility-live-caption", diff --git a/chromium-94.0.4606.71-use-ffile-compilation-dir.patch b/chromium-94.0.4606.71-use-ffile-compilation-dir.patch deleted file mode 100644 index ceda14f..0000000 --- a/chromium-94.0.4606.71-use-ffile-compilation-dir.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 34a955823630096f5b01c2b01d51c1ea59d22763 Mon Sep 17 00:00:00 2001 -From: Zequan Wu -Date: Tue, 20 Jul 2021 14:13:50 +0000 -Subject: [PATCH] Use -ffile-compilation-dir= instead of - -fdebug-compilation-dir= - -Bug: 1010267 -Change-Id: If2b4ead8535a76490eb466a38e3d8fed6ea91079 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2770738 -Auto-Submit: Zequan Wu -Commit-Queue: Nico Weber -Reviewed-by: Nico Weber -Cr-Commit-Position: refs/heads/master@{#903456} ---- - build/config/compiler/BUILD.gn | 18 ++++++++++++------ - build/config/compiler/compiler.gni | 7 ++----- - 2 files changed, 14 insertions(+), 11 deletions(-) - -diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index ede07d111c..6db16c1cdd 100644 ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -1216,12 +1216,18 @@ config("compiler_deterministic") { - # different build directory like "out/feature_a" and "out/feature_b" if - # we build same files with same compile flag. - # Other paths are already given in relative, no need to normalize them. -- cflags += [ -- "-Xclang", -- "-fdebug-compilation-dir", -- "-Xclang", -- ".", -- ] -+ if (is_nacl) { -+ cflags += [ -+ "-Xclang", -+ "-fdebug-compilation-dir", -+ "-Xclang", -+ ".", -+ ] -+ } else { -+ # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir= -+ # and -fcoverage-compilation-dir=. -+ cflags += [ "-ffile-compilation-dir=." ] -+ } - if (!is_win) { - # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) - asmflags = [ "-Wa,-fdebug-compilation-dir,." ] diff --git a/chromium-95.0.4638.54-harfbuzz-3.patch b/chromium-95.0.4638.54-harfbuzz-3.patch deleted file mode 100644 index 33fe955..0000000 --- a/chromium-95.0.4638.54-harfbuzz-3.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 9e00e702633c47c590a869bc66b5c2ceec09da50 Mon Sep 17 00:00:00 2001 -From: Dominik Röttsches -Date: Tue, 28 Sep 2021 15:31:50 +0000 -Subject: [PATCH] Roll src/third_party/harfbuzz-ng/src/ 6602cbb70..a52c6df38 (80 commits) - -Fixed: 1252284 -Change-Id: Ie2ff99da5e41ca97b8881e1bd3e158881f4d5a8e -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3190252 -Commit-Queue: Dominik Röttsches -Commit-Queue: Calder Kitagawa -Auto-Submit: Dominik Röttsches -Reviewed-by: Calder Kitagawa -Reviewed-by: Anders Hartvoll Ruud -Cr-Commit-Position: refs/heads/main@{#925776} - -(only components/paint_preview/common/subset_font.cc) ---- - -diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc -index 45daea7b1..43a448e 100644 ---- a/components/paint_preview/common/subset_font.cc -+++ b/components/paint_preview/common/subset_font.cc -@@ -79,7 +79,7 @@ - // Retain all variation information for OpenType variation fonts. See: - // https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview - hb_set_t* skip_subset = -- hb_subset_input_no_subset_tables_set(input.get()); // Owned by |input|. -+ hb_subset_input_set(input.get(), HB_SUBSET_SETS_NO_SUBSET_TABLE_TAG); - hb_set_add(skip_subset, HB_TAG('a', 'v', 'a', 'r')); - hb_set_add(skip_subset, HB_TAG('c', 'v', 'a', 'r')); - hb_set_add(skip_subset, HB_TAG('f', 'v', 'a', 'r')); diff --git a/chromium-95.0.4638.54-maldoca-depend-on-zlib-instead-of-headers-only.patch b/chromium-95.0.4638.54-maldoca-depend-on-zlib-instead-of-headers-only.patch deleted file mode 100644 index e1b438c..0000000 --- a/chromium-95.0.4638.54-maldoca-depend-on-zlib-instead-of-headers-only.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0aa878b7839141077071db97ba1cd30edf486827 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Wed, 15 Sep 2021 17:14:14 +0000 -Subject: [PATCH] maldoca: depend on zlib instead of headers only - -There is no zlib_common_headers target for unbundled zlib -and in the end code links against zlib static library anyways. - -Bug: None -Change-Id: I50b8bb5b480770b637904de00aecc3a629f09471 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3162976 -Reviewed-by: Daniel Rubery -Commit-Queue: Stephan Hartmann -Cr-Commit-Position: refs/heads/main@{#921717} ---- - third_party/maldoca/BUILD.gn | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/third_party/maldoca/BUILD.gn b/third_party/maldoca/BUILD.gn -index eeab2056b5..29a0a2ca49 100644 ---- a/third_party/maldoca/BUILD.gn -+++ b/third_party/maldoca/BUILD.gn -@@ -224,7 +224,7 @@ source_set("maldoca-ole") { - "//third_party/libxml", - "//third_party/protobuf:protobuf_lite", - "//third_party/re2", -- "//third_party/zlib:zlib_common_headers", -+ "//third_party/zlib:zlib", - "//third_party/zlib/google:zip", - ] - diff --git a/chromium-95.0.4638.54-ozone-x11-fix-VA-API.patch b/chromium-95.0.4638.54-ozone-x11-fix-VA-API.patch deleted file mode 100644 index 61d72bf..0000000 --- a/chromium-95.0.4638.54-ozone-x11-fix-VA-API.patch +++ /dev/null @@ -1,671 +0,0 @@ -From a4de986102a45e29c3ef596f22704bdca244c26c Mon Sep 17 00:00:00 2001 -From: Maksim Sisov -Date: Fri, 17 Sep 2021 08:45:55 +0000 -Subject: [PATCH] ozone/x11: fix VA-API. - -This patch fixes VA-API usage with Ozone/X11 backend (which -is our default backend now as X11 has been deprecated - -crrev.com/c/3114071)). - -non-Ozone X11 is disabled now and Ozone is always used -on Linux. However, VA-API implementation is not Ozone friendly -yet and requires major refactoring. But given that VA-API -implementation on Linux worked only with X11, it's fine for -now to change USE_X11 and !IsUsingOzonePlatform to -BUILDFLAG(OZONE_PLATFORM_X11) and fail VA-API initialization -in VADisplayState::Initialize for Ozone/Linux other than -non-X11 backends. - -Bug: 1121948 -Change-Id: If85d289235e6d358103d9fa2bbe0f741fb599a26 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3141878 -Commit-Queue: Maksim Sisov -Reviewed-by: Andres Calderon Jaramillo -Reviewed-by: Robert Kroeger -Reviewed-by: Xiaohan Wang -Reviewed-by: Alexander Dunaev -Cr-Commit-Position: refs/heads/main@{#922466} ---- - media/BUILD.gn | 3 - - media/gpu/BUILD.gn | 5 +- - media/gpu/args.gni | 13 +++- - media/gpu/vaapi/BUILD.gn | 8 +- - media/gpu/vaapi/va_stub_header.fragment | 6 +- - media/gpu/vaapi/vaapi_picture_factory.cc | 72 ++++++++---------- - .../vaapi_picture_native_pixmap_angle.cc | 2 - - media/gpu/vaapi/vaapi_picture_tfp.cc | 2 - - .../vaapi/vaapi_video_decode_accelerator.cc | 9 +-- - ...vaapi_video_decode_accelerator_unittest.cc | 11 +-- - media/gpu/vaapi/vaapi_wrapper.cc | 76 +++++++++---------- - media/gpu/vaapi/vaapi_wrapper.h | 8 +- - ui/ozone/platform/x11/ozone_platform_x11.cc | 3 + - ui/ozone/public/ozone_platform.h | 10 +++ - 14 files changed, 108 insertions(+), 120 deletions(-) - -diff --git a/media/BUILD.gn b/media/BUILD.gn -index dbee1d4338..d5c158c08f 100644 ---- a/media/BUILD.gn -+++ b/media/BUILD.gn -@@ -130,9 +130,6 @@ component("media") { - public_deps += [ "//media/base/mac" ] - } - -- if (use_x11) { -- deps += [ "//ui/base/x" ] -- } - if (use_ozone) { - deps += [ "//ui/ozone" ] - } -diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn -index c7499485ac..3fedc78948 100644 ---- a/media/gpu/BUILD.gn -+++ b/media/gpu/BUILD.gn -@@ -20,6 +20,7 @@ buildflag_header("buildflags") { - "USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs", - "USE_V4L2_CODEC=$use_v4l2_codec", - "USE_LIBV4L2=$use_v4lplugin", -+ "USE_VAAPI_X11=$use_vaapi_x11", - ] - } - -@@ -215,9 +216,7 @@ component("gpu") { - "windows/supported_profile_helpers.cc", - "windows/supported_profile_helpers.h", - ] -- configs += [ -- "//third_party/khronos:khronos_headers", -- ] -+ configs += [ "//third_party/khronos:khronos_headers" ] - public_deps += [ "//media/base/win:media_foundation_util" ] - deps += [ - "//gpu/ipc/common:common", -diff --git a/media/gpu/args.gni b/media/gpu/args.gni -index 4004937949..2f53843918 100644 ---- a/media/gpu/args.gni -+++ b/media/gpu/args.gni -@@ -3,7 +3,15 @@ - # found in the LICENSE file. - - import("//build/config/chromeos/ui_mode.gni") --import("//build/config/ui.gni") -+import("//build/config/ozone.gni") -+ -+declare_args() { -+ # Indicates if X11 VA-API-based hardware acceleration is to be used. -+ # See also the comment near the |use_vaapi| arg. -+ use_vaapi_x11 = -+ is_linux && ozone_platform_x11 && !is_chromecast && !is_chromeos_lacros && -+ (target_cpu == "x86" || target_cpu == "x64") -+} - - declare_args() { - # Indicates if V4L plugin is used. -@@ -21,8 +29,7 @@ declare_args() { - # is typically the case on x86-based ChromeOS devices. - # VA-API should also be compiled by default on x11-using linux devices - # using x86/x64. -- use_vaapi = -- is_linux && use_x11 && (target_cpu == "x86" || target_cpu == "x64") -+ use_vaapi = use_vaapi_x11 - - # Indicates if ChromeOS protected media support exists. This is used - # to enable the CDM daemon in Chrome OS as well as support for -diff --git a/media/gpu/vaapi/BUILD.gn b/media/gpu/vaapi/BUILD.gn -index b11d2c60fa..0c2520dd6b 100644 ---- a/media/gpu/vaapi/BUILD.gn -+++ b/media/gpu/vaapi/BUILD.gn -@@ -17,7 +17,7 @@ assert(use_vaapi) - generate_stubs("libva_stubs") { - extra_header = "va_stub_header.fragment" - sigs = [ "va.sigs" ] -- if (use_x11) { -+ if (use_vaapi_x11) { - sigs += [ "va_x11.sigs" ] - } - if (is_chromeos_ash) { -@@ -131,14 +131,14 @@ source_set("vaapi") { - ] - } - -- if (use_x11 || use_ozone || use_egl) { -+ if (use_ozone || use_egl) { - sources += [ - "vaapi_picture_native_pixmap.cc", - "vaapi_picture_native_pixmap.h", - ] - } - -- if (use_x11) { -+ if (use_vaapi_x11) { - deps += [ "//ui/gfx/x" ] - sources += [ - "vaapi_picture_native_pixmap_angle.cc", -@@ -197,7 +197,7 @@ source_set("common") { - deps += [ "//ui/ozone" ] - } - -- if (use_x11) { -+ if (use_vaapi_x11) { - deps += [ "//ui/gfx/x" ] - } - -diff --git a/media/gpu/vaapi/va_stub_header.fragment b/media/gpu/vaapi/va_stub_header.fragment -index bed198484d..e8c46c5e81 100644 ---- a/media/gpu/vaapi/va_stub_header.fragment -+++ b/media/gpu/vaapi/va_stub_header.fragment -@@ -1,12 +1,14 @@ - // The extra include header needed in the generated stub file for defining - // various libva types. - -+#include "media/gpu/buildflags.h" -+ - extern "C" { - - #include - #include --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - #include --#endif -+#endif // BUILDFLAG(USE_VAAPI_X11) - - } -diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc -index 719035b87c..9c7d7387d2 100644 ---- a/media/gpu/vaapi/vaapi_picture_factory.cc -+++ b/media/gpu/vaapi/vaapi_picture_factory.cc -@@ -10,13 +10,13 @@ - #include "ui/base/ui_base_features.h" - #include "ui/gl/gl_bindings.h" - --#if defined(USE_X11) --#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h" --#include "media/gpu/vaapi/vaapi_picture_tfp.h" --#endif - #if defined(USE_OZONE) - #include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h" --#endif -+#endif // defined(USE_OZONE) -+#if BUILDFLAG(USE_VAAPI_X11) -+#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h" -+#include "media/gpu/vaapi/vaapi_picture_tfp.h" -+#endif // BUILDFLAG(USE_VAAPI_X11) - #if defined(USE_EGL) - #include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h" - #endif -@@ -46,15 +46,13 @@ VaapiPictureFactory::VaapiPictureFactory() { - vaapi_impl_pairs_.insert( - std::make_pair(gl::kGLImplementationEGLGLES2, - VaapiPictureFactory::kVaapiImplementationDrm)); --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - vaapi_impl_pairs_.insert( - std::make_pair(gl::kGLImplementationEGLANGLE, - VaapiPictureFactory::kVaapiImplementationAngle)); -- if (!features::IsUsingOzonePlatform()) { -- vaapi_impl_pairs_.insert( -- std::make_pair(gl::kGLImplementationDesktopGL, -- VaapiPictureFactory::kVaapiImplementationX11)); -- } -+ vaapi_impl_pairs_.insert( -+ std::make_pair(gl::kGLImplementationDesktopGL, -+ VaapiPictureFactory::kVaapiImplementationX11)); - #endif - - DeterminePictureCreationAndDownloadingMechanism(); -@@ -96,19 +94,19 @@ VaapiPictureFactory::GetVaapiImplementation(gl::GLImplementation gl_impl) { - } - - uint32_t VaapiPictureFactory::GetGLTextureTarget() { --#if defined(USE_OZONE) -- if (features::IsUsingOzonePlatform()) -- return GL_TEXTURE_EXTERNAL_OES; --#endif -+#if BUILDFLAG(USE_VAAPI_X11) - return GL_TEXTURE_2D; -+#else -+ return GL_TEXTURE_EXTERNAL_OES; -+#endif - } - - gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() { --#if defined(USE_OZONE) -- if (features::IsUsingOzonePlatform()) -- return gfx::BufferFormat::YUV_420_BIPLANAR; --#endif -+#if BUILDFLAG(USE_VAAPI_X11) - return gfx::BufferFormat::RGBX_8888; -+#else -+ return gfx::BufferFormat::YUV_420_BIPLANAR; -+#endif - } - - void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() { -@@ -116,51 +114,43 @@ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() { - #if defined(USE_OZONE) - // We can be called without GL initialized, which is valid if we use Ozone. - case kVaapiImplementationNone: -- if (features::IsUsingOzonePlatform()) { -- create_picture_cb_ = base::BindRepeating( -- &CreateVaapiPictureNativeImpl); -- needs_vpp_for_downloading_ = true; -- } -- -- // This is reached by unit tests which don't require create_picture_cb_ -- // to be initialized or called. -+ create_picture_cb_ = base::BindRepeating( -+ &CreateVaapiPictureNativeImpl); -+ needs_vpp_for_downloading_ = true; - break; - #endif // defined(USE_OZONE) --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - case kVaapiImplementationX11: -- DCHECK(!features::IsUsingOzonePlatform()); - create_picture_cb_ = - base::BindRepeating(&CreateVaapiPictureNativeImpl); - // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP. - needs_vpp_for_downloading_ = false; - break; - case kVaapiImplementationAngle: -- DCHECK(!features::IsUsingOzonePlatform()); - create_picture_cb_ = base::BindRepeating( - &CreateVaapiPictureNativeImpl); - // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP. - needs_vpp_for_downloading_ = false; - break; --#endif // defined(USE_X11) -+#endif // BUILDFLAG(USE_VAAPI_X11) - case kVaapiImplementationDrm: - #if defined(USE_OZONE) -- if (features::IsUsingOzonePlatform()) { -- create_picture_cb_ = base::BindRepeating( -- &CreateVaapiPictureNativeImpl); -- needs_vpp_for_downloading_ = true; -- break; -- } --#endif // defined(USE_OZONE) --#if defined(USE_EGL) -+ create_picture_cb_ = base::BindRepeating( -+ &CreateVaapiPictureNativeImpl); -+ needs_vpp_for_downloading_ = true; -+ break; -+#elif defined(USE_EGL) - create_picture_cb_ = base::BindRepeating( - &CreateVaapiPictureNativeImpl); - needs_vpp_for_downloading_ = true; - break; --#endif // defined(USE_EGL) -+#else - // ozone or egl must be used to use the DRM implementation. -- NOTREACHED(); -+ FALLTHROUGH; -+#endif - default: - NOTREACHED(); -+ break; - } - } - -diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc -index 9de0c93b44..e5b9908490 100644 ---- a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc -+++ b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc -@@ -6,7 +6,6 @@ - - #include "media/gpu/vaapi/va_surface.h" - #include "media/gpu/vaapi/vaapi_wrapper.h" --#include "ui/base/ui_base_features.h" - #include "ui/gfx/x/connection.h" - #include "ui/gfx/x/future.h" - #include "ui/gfx/x/xproto.h" -@@ -92,7 +91,6 @@ Status VaapiPictureNativePixmapAngle::Allocate(gfx::BufferFormat format) { - if (!make_context_current_cb_ || !make_context_current_cb_.Run()) - return StatusCode::kVaapiBadContext; - -- DCHECK(!features::IsUsingOzonePlatform()); - auto image = - base::MakeRefCounted(visible_size_, format); - if (!image) -diff --git a/media/gpu/vaapi/vaapi_picture_tfp.cc b/media/gpu/vaapi/vaapi_picture_tfp.cc -index 3f7e221d8a..11914e3640 100644 ---- a/media/gpu/vaapi/vaapi_picture_tfp.cc -+++ b/media/gpu/vaapi/vaapi_picture_tfp.cc -@@ -6,7 +6,6 @@ - - #include "media/gpu/vaapi/va_surface.h" - #include "media/gpu/vaapi/vaapi_wrapper.h" --#include "ui/base/ui_base_features.h" - #include "ui/gfx/x/connection.h" - #include "ui/gfx/x/future.h" - #include "ui/gl/gl_bindings.h" -@@ -37,7 +36,6 @@ VaapiTFPPicture::VaapiTFPPicture( - connection_(x11::Connection::Get()), - x_pixmap_(x11::Pixmap::None) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -- DCHECK(!features::IsUsingOzonePlatform()); - DCHECK(texture_id); - DCHECK(client_texture_id); - } -diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -index 7514fe4fdd..e4cd7c8d89 100644 ---- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -@@ -184,12 +184,6 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config, - Client* client) { - DCHECK(task_runner_->BelongsToCurrentThread()); - --#if defined(USE_X11) -- // TODO(crbug/1116701): implement decode acceleration when running with Ozone. -- if (features::IsUsingOzonePlatform()) -- return false; --#endif -- - vaapi_picture_factory_ = std::make_unique(); - - if (config.is_encrypted()) { -@@ -1213,12 +1207,11 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() { - - VaapiVideoDecodeAccelerator::BufferAllocationMode - VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() { --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - // The IMPORT mode is used for Android on Chrome OS, so this doesn't apply - // here. - DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT); - // TODO(crbug/1116701): get video decode acceleration working with ozone. -- DCHECK(!features::IsUsingOzonePlatform()); - // For H.264 on older devices, another +1 is experimentally needed for - // high-to-high resolution changes. - // TODO(mcasas): Figure out why and why only H264, see crbug.com/912295 and -diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc -index 5b9a543386..826bb103b1 100644 ---- a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc -+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc -@@ -17,7 +17,6 @@ - #include "media/gpu/vaapi/vaapi_wrapper.h" - #include "testing/gmock/include/gmock/gmock.h" - #include "testing/gtest/include/gtest/gtest.h" --#include "ui/base/ui_base_features.h" - - using base::test::RunClosure; - using ::testing::_; -@@ -416,12 +415,10 @@ TEST_P(VaapiVideoDecodeAcceleratorTest, SupportedPlatforms) { - mock_vaapi_picture_factory_->GetVaapiImplementation( - gl::kGLImplementationEGLGLES2)); - --#if defined(USE_X11) -- if (!features::IsUsingOzonePlatform()) { -- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11, -- mock_vaapi_picture_factory_->GetVaapiImplementation( -- gl::kGLImplementationDesktopGL)); -- } -+#if BUILDFLAG(USE_VAAPI_X11) -+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11, -+ mock_vaapi_picture_factory_->GetVaapiImplementation( -+ gl::kGLImplementationDesktopGL)); - #endif - } - -diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc -index 754d258848..e528b0f84d 100644 ---- a/media/gpu/vaapi/vaapi_wrapper.cc -+++ b/media/gpu/vaapi/vaapi_wrapper.cc -@@ -65,7 +65,7 @@ - #include "ui/gl/gl_bindings.h" - #include "ui/gl/gl_implementation.h" - --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - typedef XID Drawable; - - extern "C" { -@@ -73,7 +73,7 @@ extern "C" { - } - - #include "ui/gfx/x/connection.h" // nogncheck --#endif -+#endif // BUILDFLAG(USE_VAAPI_X11) - - #if defined(USE_OZONE) - #include "ui/ozone/public/ozone_platform.h" -@@ -87,14 +87,14 @@ using media_gpu_vaapi::kModuleVa_prot; - - using media_gpu_vaapi::kModuleVa; - using media_gpu_vaapi::kModuleVa_drm; --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - using media_gpu_vaapi::kModuleVa_x11; --#endif -+#endif // BUILDFLAG(USE_VAAPI_X11) - using media_gpu_vaapi::InitializeStubs; - using media_gpu_vaapi::IsVaInitialized; --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - using media_gpu_vaapi::IsVa_x11Initialized; --#endif -+#endif // BUILDFLAG(USE_VAAPI_X11) - using media_gpu_vaapi::IsVa_drmInitialized; - using media_gpu_vaapi::StubPathMap; - -@@ -559,10 +559,20 @@ VADisplayState::VADisplayState() - bool VADisplayState::Initialize() { - base::AutoLock auto_lock(va_lock_); - -+#if defined(USE_OZONE) && defined(OS_LINUX) -+ // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on -+ // Linux. See comment in OzonePlatform::PlatformProperties::supports_vaapi -+ // for more details. This will also require revisiting everything that's -+ // guarded by USE_VAAPI_X11. For example, if USE_VAAPI_X11 is true, but the -+ // user chooses the Wayland backend for Ozone at runtime, then many things (if -+ // not all) that we do for X11 won't apply. -+ if (!ui::OzonePlatform::GetInstance()->GetPlatformProperties().supports_vaapi) -+ return false; -+#endif -+ - bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized(); --#if defined(USE_X11) -- if (!features::IsUsingOzonePlatform()) -- libraries_initialized = libraries_initialized && IsVa_x11Initialized(); -+#if BUILDFLAG(USE_VAAPI_X11) -+ libraries_initialized = libraries_initialized && IsVa_x11Initialized(); - #endif - if (!libraries_initialized) - return false; -@@ -577,34 +587,25 @@ bool VADisplayState::Initialize() { - return success; - } - --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - - absl::optional GetVADisplayStateX11(const base::ScopedFD& drm_fd) { -- bool use_drm_as_fallback = false; - switch (gl::GetGLImplementation()) { - case gl::kGLImplementationEGLGLES2: - return vaGetDisplayDRM(drm_fd.get()); - - case gl::kGLImplementationNone: -- use_drm_as_fallback = true; -- FALLTHROUGH; - - case gl::kGLImplementationDesktopGL: { -- if (!features::IsUsingOzonePlatform()) { -- VADisplay display = -- vaGetDisplay(x11::Connection::Get()->GetXlibDisplay()); -- if (vaDisplayIsValid(display)) -- return display; -- return vaGetDisplayDRM(drm_fd.get()); -- } -- break; -+ VADisplay display = -+ vaGetDisplay(x11::Connection::Get()->GetXlibDisplay()); -+ if (vaDisplayIsValid(display)) -+ return display; -+ return vaGetDisplayDRM(drm_fd.get()); - } - -- case gl::kGLImplementationEGLANGLE: { -- if (!features::IsUsingOzonePlatform()) -- return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay()); -- break; -- } -+ case gl::kGLImplementationEGLANGLE: -+ return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay()); - - default: - LOG(WARNING) << "VAAPI video acceleration not available for " -@@ -612,10 +613,6 @@ absl::optional GetVADisplayStateX11(const base::ScopedFD& drm_fd) { - gl::GetGLImplementationParts()); - return absl::nullopt; - } -- -- if (use_drm_as_fallback) -- return vaGetDisplayDRM(drm_fd.get()); -- return absl::nullopt; - } - - #else -@@ -633,11 +630,11 @@ absl::optional GetVADisplayState(const base::ScopedFD& drm_fd) { - } - } - --#endif // defined(USE_X11) -+#endif // BUILDFLAG(USE_VAAPI_X11) - - bool VADisplayState::InitializeVaDisplay_Locked() { - absl::optional display = --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - GetVADisplayStateX11(drm_fd_); - #else - GetVADisplayState(drm_fd_); -@@ -702,10 +699,9 @@ bool VADisplayState::InitializeOnce() { - if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked()) - return false; - --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE && - implementation_type_ == VAImplementation::kIntelIHD) { -- DCHECK(!features::IsUsingOzonePlatform()); - constexpr char libva_driver_impl_env[] = "LIBVA_DRIVER_NAME"; - // TODO(crbug/1116703) The libva intel-media driver has a known segfault in - // vaPutSurface, so until this is fixed, fall back to the i965 driver. There -@@ -722,7 +718,7 @@ bool VADisplayState::InitializeOnce() { - if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked()) - return false; - } --#endif // USE_X11 -+#endif // BUILDFLAG(USE_VAAPI_X11) - - return true; - } -@@ -2452,11 +2448,10 @@ bool VaapiWrapper::MapAndCopyAndExecute( - return Execute_Locked(va_surface_id, va_buffer_ids); - } - --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id, - x11::Pixmap x_pixmap, - gfx::Size dest_size) { -- DCHECK(!features::IsUsingOzonePlatform()); - base::AutoLock auto_lock(*va_lock_); - - VAStatus va_res = vaSyncSurface(va_display_, va_surface_id); -@@ -2470,7 +2465,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id, - VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false); - return true; - } --#endif // USE_X11 -+#endif // BUILDFLAG(USE_VAAPI_X11) - - std::unique_ptr VaapiWrapper::CreateVaImage( - VASurfaceID va_surface_id, -@@ -2844,9 +2839,8 @@ void VaapiWrapper::PreSandboxInitialization() { - - paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix); - paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix); --#if defined(USE_X11) -- if (!features::IsUsingOzonePlatform()) -- paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix); -+#if BUILDFLAG(USE_VAAPI_X11) -+ paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix); - #endif - #if BUILDFLAG(IS_CHROMEOS_ASH) - paths[kModuleVa_prot].push_back(std::string("libva.so.") + va_suffix); -diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h -index 0e3da53624..88ffcd0799 100644 ---- a/media/gpu/vaapi/vaapi_wrapper.h -+++ b/media/gpu/vaapi/vaapi_wrapper.h -@@ -36,9 +36,9 @@ - #include "third_party/abseil-cpp/absl/types/optional.h" - #include "ui/gfx/geometry/size.h" - --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - #include "ui/gfx/x/xproto.h" // nogncheck --#endif // USE_X11 -+#endif // BUILDFLAG(USE_VAAPI_X11) - - namespace gfx { - enum class BufferFormat; -@@ -426,13 +426,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper - const std::vector>& va_buffers) - WARN_UNUSED_RESULT; - --#if defined(USE_X11) -+#if BUILDFLAG(USE_VAAPI_X11) - // Put data from |va_surface_id| into |x_pixmap| of size - // |dest_size|, converting/scaling to it. - bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id, - x11::Pixmap x_pixmap, - gfx::Size dest_size) WARN_UNUSED_RESULT; --#endif // USE_X11 -+#endif // BUILDFLAG(USE_VAAPI_X11) - - // Creates a ScopedVAImage from a VASurface |va_surface_id| and map it into - // memory with the given |format| and |size|. If |format| is not equal to the -diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc -index 8889828e0f..963dc7a0cd 100644 ---- a/ui/ozone/platform/x11/ozone_platform_x11.cc -+++ b/ui/ozone/platform/x11/ozone_platform_x11.cc -@@ -208,6 +208,9 @@ class OzonePlatformX11 : public OzonePlatform, - properties->supports_global_application_menus = true; - properties->app_modal_dialogs_use_event_blocker = true; - properties->fetch_buffer_formats_for_gmb_on_gpu = true; -+#if defined(OS_LINUX) -+ properties->supports_vaapi = true; -+#endif - - initialised = true; - } -diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h -index df95f07486..2d7f44bbfa 100644 ---- a/ui/ozone/public/ozone_platform.h -+++ b/ui/ozone/public/ozone_platform.h -@@ -15,6 +15,7 @@ - #include "base/macros.h" - #include "base/message_loop/message_pump_type.h" - #include "base/single_thread_task_runner.h" -+#include "build/build_config.h" - #include "mojo/public/cpp/bindings/binder_map.h" - #include "ui/gfx/buffer_types.h" - #include "ui/gfx/native_widget_types.h" -@@ -154,6 +155,15 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform { - // Determines whether buffer formats should be fetched on GPU and passed - // back via gpu extra info. - bool fetch_buffer_formats_for_gmb_on_gpu = false; -+ -+#if defined(OS_LINUX) -+ // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on -+ // Linux. At the moment, VA-API Linux implementation supports only X11 -+ // backend. This implementation must be refactored to support Ozone -+ // properly. As a temporary solution, VA-API on Linux checks if vaapi is -+ // supported (which implicitly means that it is Ozone/X11). -+ bool supports_vaapi = false; -+#endif - }; - - // Groups platform properties that can only be known at run time. diff --git a/chromium-96.0.4664.45-gcc-2.34.patch b/chromium-96.0.4664.45-gcc-2.34.patch deleted file mode 100644 index 64c03a6..0000000 --- a/chromium-96.0.4664.45-gcc-2.34.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 600d63c2c59a9892dbc5423d7d8bb1565a9f91e7 Mon Sep 17 00:00:00 2001 -From: Michel Salim -Date: Thu, 04 Nov 2021 14:22:40 -0700 -Subject: [PATCH] Handle long SIGSTKSZ in glibc > 2.33 - -`SIGSTKSZ` is no longer constant in glibc > 2.33 but a function -returning a long. Cast before taking `max`. - -See https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=85e84fe53699fe9e392edffa993612ce08b2954a;hb=HEAD - -Signed-off-by: Michel Salim -Change-Id: I197f8ff3053eede80d6aed096be4f0113dd43241 -(relocated to chromium repo, removed static) ---- - -diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc -index ca353c4..5cdabcf 100644 ---- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc -+++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc -@@ -138,7 +138,7 @@ - // SIGSTKSZ may be too small to prevent the signal handlers from overrunning - // the alternative stack. Ensure that the size of the alternative stack is - // large enough. -- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); -+ const unsigned kSigStackSize = std::max(16384U, (unsigned)SIGSTKSZ); - - // Only set an alternative stack if there isn't already one, or if the current - // one is too small. -diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc -index ca6b595..1c1ee42 100644 ---- a/sandbox/linux/services/credentials.cc -+++ b/sandbox/linux/services/credentials.cc -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -100,7 +101,8 @@ bool ChrootToSafeEmptyDir() { - // TODO(crbug.com/1247458) Broken in MSan builds after LLVM f1bb30a4956f. - clone_flags |= CLONE_VM | CLONE_VFORK | CLONE_SETTLS; - -- char tls_buf[PTHREAD_STACK_MIN] = {0}; -+ char tls_buf[PTHREAD_STACK_MIN]; -+ memset(tls_buf, 0, PTHREAD_STACK_MIN); - tls = tls_buf; - #endif - diff --git a/chromium-97.0.4692.71-fix-tag-dragging-in-KWin.patch b/chromium-97.0.4692.71-fix-tag-dragging-in-KWin.patch deleted file mode 100644 index 226e925..0000000 --- a/chromium-97.0.4692.71-fix-tag-dragging-in-KWin.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 52d0ad25ea695da44195e49f36e69fa81b55e670 Mon Sep 17 00:00:00 2001 -From: Tom Anderson -Date: Wed, 5 Jan 2022 21:11:03 +0000 -Subject: [PATCH] [X11] Fix tag dragging in KWin - -R=sky - -Bug: 1279532 -Change-Id: Iac166803e2149eef234045d922b630f0019c8073 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3355376 -Auto-Submit: Thomas Anderson -Reviewed-by: Scott Violet -Commit-Queue: Thomas Anderson -Cr-Commit-Position: refs/heads/main@{#955869} ---- - ui/platform_window/x11/x11_topmost_window_finder.cc | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/ui/platform_window/x11/x11_topmost_window_finder.cc b/ui/platform_window/x11/x11_topmost_window_finder.cc -index 50e75e17f0a..2e16393487b 100644 ---- a/ui/platform_window/x11/x11_topmost_window_finder.cc -+++ b/ui/platform_window/x11/x11_topmost_window_finder.cc -@@ -68,9 +68,9 @@ bool EnumerateAllWindows(ShouldStopIteratingCallback should_stop_iterating, - - void EnumerateTopLevelWindows( - ui::ShouldStopIteratingCallback should_stop_iterating) { -- // Some WMs parent 'top-level' windows in unnamed actual top-level windows -- // (ion WM), so extend the search depth to all children of top-level windows. -- const int kMaxSearchDepth = 1; -+ // WMs may reparent toplevel windows inside their own containers, so extend -+ // the search to all grandchildren of all toplevel windows. -+ const int kMaxSearchDepth = 2; - ui::EnumerateAllWindows(should_stop_iterating, kMaxSearchDepth); - } - diff --git a/chromium-97.0.4692.71-fix-tag-dragging-in-Mutter.patch b/chromium-97.0.4692.71-fix-tag-dragging-in-Mutter.patch deleted file mode 100644 index 01f2da5..0000000 --- a/chromium-97.0.4692.71-fix-tag-dragging-in-Mutter.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 3806f28918ea23291749ff4775339075a5f394e8 Mon Sep 17 00:00:00 2001 -From: Tom Anderson -Date: Thu, 6 Jan 2022 00:59:40 +0000 -Subject: [PATCH] [X11] Fix tag dragging in Mutter - -We used to use a BFS to find the target window for tag dragging, but -this causes windows underneath (like the window for the desktop -wallpaper) to take precedence over nested windows. - -This CL switches to a DFS. - -R=sky - -Bug: 1279532 -Change-Id: Ib569e9270be60bcb4fff088517dfe295697608b0 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3355470 -Reviewed-by: Scott Violet -Commit-Queue: Thomas Anderson -Auto-Submit: Thomas Anderson -Cr-Commit-Position: refs/heads/main@{#955976} ---- - ui/platform_window/x11/x11_topmost_window_finder.cc | 11 ++--------- - 1 file changed, 2 insertions(+), 9 deletions(-) - -diff --git a/ui/platform_window/x11/x11_topmost_window_finder.cc b/ui/platform_window/x11/x11_topmost_window_finder.cc -index 2e16393487b..e20bf0abf0e 100644 ---- a/ui/platform_window/x11/x11_topmost_window_finder.cc -+++ b/ui/platform_window/x11/x11_topmost_window_finder.cc -@@ -44,15 +44,8 @@ bool EnumerateChildren(ShouldStopIteratingCallback should_stop_iterating, - for (iter = windows.rbegin(); iter != windows.rend(); iter++) { - if (IsWindowNamed(*iter) && should_stop_iterating.Run(*iter)) - return true; -- } -- -- // If we're at this point, we didn't find the window we're looking for at the -- // current level, so we need to recurse to the next level. We use a second -- // loop because the recursion and call to XQueryTree are expensive and is only -- // needed for a small number of cases. -- if (++depth <= max_depth) { -- for (iter = windows.rbegin(); iter != windows.rend(); iter++) { -- if (EnumerateChildren(should_stop_iterating, *iter, max_depth, depth)) -+ if (depth < max_depth) { -+ if (EnumerateChildren(should_stop_iterating, *iter, max_depth, depth + 1)) - return true; - } - } diff --git a/chromium-97.0.4692.71-unbundle-ffmpeg-av_stream_get_first_dts.patch b/chromium-97.0.4692.71-unbundle-ffmpeg-av_stream_get_first_dts.patch deleted file mode 100644 index dae1add..0000000 --- a/chromium-97.0.4692.71-unbundle-ffmpeg-av_stream_get_first_dts.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn -index 16e20744706..6a079b32221 100644 ---- a/build/linux/unbundle/ffmpeg.gn -+++ b/build/linux/unbundle/ffmpeg.gn -@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") { - "libavformat", - "libavutil", - ] -+ defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ] - } - - buildflag_header("ffmpeg_features") { diff --git a/chromium-98.0.4758.102-libdrm-2.4.110.patch b/chromium-98.0.4758.102-libdrm-2.4.110.patch deleted file mode 100644 index fe8eee6..0000000 --- a/chromium-98.0.4758.102-libdrm-2.4.110.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 5b287e0be8d8d8475ec6ef81b16eaa61e19db078 Mon Sep 17 00:00:00 2001 -From: "Steinar H. Gunderson" -Date: Tue, 25 Jan 2022 19:14:53 +0000 -Subject: [PATCH] Fix build break with system libdrm. - -This patch is submitted on behalf of Andres Salomon - (on Cc). Also adding him to src/AUTHORS -per policy, as he has signed the CLA. - -Original patch: -https://salsa.debian.org/dilinger/chromium/-/commit/2333c2fb985ac1ef3d7331776a7833d965c63302 - -Change-Id: I18bd60e2e80f2b9181e74ee7972c3f457ab33b10 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3401704 -Reviewed-by: Andres Calderon Jaramillo -Commit-Queue: Steinar H Gunderson -Auto-Submit: Steinar H Gunderson -Cr-Commit-Position: refs/heads/main@{#963119} ---- - AUTHORS | 1 + - media/gpu/chromeos/BUILD.gn | 1 + - media/gpu/chromeos/video_decoder_pipeline.cc | 2 +- - 3 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/AUTHORS b/AUTHORS -index 0eba3de5065..50edd3f6b38 100644 ---- a/AUTHORS -+++ b/AUTHORS -@@ -93,6 +93,7 @@ Andreas Papacharalampous - Andrei Borza - Andrei Parvu - Andrei Parvu -+Andres Salomon - Andreu Botella - Andrew Boyarshin - Andrew Brampton -diff --git a/media/gpu/chromeos/BUILD.gn b/media/gpu/chromeos/BUILD.gn -index 7cb4c3ea39a..6fe21c15ecc 100644 ---- a/media/gpu/chromeos/BUILD.gn -+++ b/media/gpu/chromeos/BUILD.gn -@@ -25,6 +25,7 @@ source_set("chromeos") { - - deps = [ - "//base", -+ "//build/config/linux/libdrm", - "//media", - "//media/gpu:buildflags", - "//media/gpu:command_buffer_helper", -diff --git a/media/gpu/chromeos/video_decoder_pipeline.cc b/media/gpu/chromeos/video_decoder_pipeline.cc -index d2f154ea0d8..416b9434a8d 100644 ---- a/media/gpu/chromeos/video_decoder_pipeline.cc -+++ b/media/gpu/chromeos/video_decoder_pipeline.cc -@@ -28,8 +28,8 @@ - #include "third_party/abseil-cpp/absl/types/optional.h" - - #if BUILDFLAG(USE_VAAPI) -+#include - #include "media/gpu/vaapi/vaapi_video_decoder.h" --#include "third_party/libdrm/src/include/drm/drm_fourcc.h" - #elif BUILDFLAG(USE_V4L2_CODEC) - #include "media/gpu/v4l2/v4l2_video_decoder.h" - #else diff --git a/chromium.spec b/chromium.spec index 46c2777..74fe977 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1,8 +1,8 @@ %define MAJver %(echo %version | cut -d. -f1) -%define gcc_patchset 2 +%define gcc_patchset 116-patchset-2 Name: chromium Epoch: 3 -Version: 116.0.5845.163 +Version: 117.0.5938.88 Release: 1mamba Summary: An open-source browser project that aims to build a safer, faster, and more stable way to experience the web Group: Graphical Desktop/Applications/Internet @@ -18,48 +18,15 @@ URL: https://www.chromium.org Source: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz #Source: http://gsdview.appspot.com/chromium-browser-official/chromium-%{version}.tar.xz Source1: %{name}-master_preferences -Source2: https://github.com/stha09/chromium-patches/releases/download/chromium-%{MAJver}-patchset-%{gcc_patchset}/chromium-%{MAJver}-patchset-%{gcc_patchset}.tar.xz -Patch1: chromium-37.0.2062.120-chrome-wrapper-pepper-flash.patch -Patch2: chromium-79.0.3945.79-widevine.patch -Patch3: chromium-76.0.3809.100-x86-openh264-add-fPIC.patch -Patch4: chromium-80.0.3987.122-x86-v8_context_snapsht-pic-error.patch -Patch5: chromium-90.0.4430.212-glibc-2.33.patch -Patch6: chromium-92.0.4515.107-clang-11-nomerge.patch -Patch7: chromium-90.0.4430.212-use-oauth2-client-switches-as-default.patch -Patch8: chromium-92.0.4515.107-extend-enable-accelerated-video-decode-flag.patch -Patch9: chromium-92.0.4515.107-linux-sandbox-syscall-broker-use-struct-kernel_stat.patch -Patch10: chromium-92.0.4515.107-linux-sandbox-fix-fstatat-crash.patch -Patch11: chromium-92.0.4515.107-make-GetUsableSize-handle-nullptr-gracefully.patch -Patch12: chromium-92.0.4515.107-sql-make-VirtualCursor-standard-layout-type.patch -Patch15: chromium-92.0.4515.131-freetype-2.11.patch -Patch16: chromium-92.0.4515.131-gcc-fix-swiftshader-libEGL-visibility.patch -Patch17: chromium-93.0.4577.63-replace-blacklist-with-ignorelist.patch -Patch18: chromium-94.0.4606.71-use-ffile-compilation-dir.patch -Patch19: chromium-94.0.4606.71-ffmpeg-4.4.patch -Patch20: chromium-94.0.4606.71-ffmpeg-roll.patch -Patch21: chromium-94.0.4606.71-unexpire-accelerated-video-decode-flag.patch -Patch22: chromium-94.0.4606.71-add-a-TODO-about-a-missing-pnacl-flag.patch -Patch23: chromium-95.0.4638.54-maldoca-depend-on-zlib-instead-of-headers-only.patch -Patch24: chromium-95.0.4638.54-harfbuzz-3.patch -Patch25: chromium-95.0.4638.54-ozone-x11-fix-VA-API.patch -Patch26: chromium-96.0.4664.45-gcc-2.34.patch -Patch27: chromium-97.0.4692.71-unbundle-ffmpeg-av_stream_get_first_dts.patch -Patch28: chromium-97.0.4692.71-fix-tag-dragging-in-KWin.patch -Patch29: chromium-97.0.4692.71-fix-tag-dragging-in-Mutter.patch -Patch30: chromium-98.0.4758.102-libdrm-2.4.110.patch -Patch31: chromium-101.0.4951.41-libxml-unbundle.patch -Patch32: chromium-102.0.5005.61-remove-no-opaque-pointers-flag.patch -Patch33: chromium-104.0.5112.79-roll-src-third_party-ffmpeg.patch -Patch34: chromium-102.0.5005.61-iwyu-add-utility-for-std-exchange.patch -Patch35: chromium-104.0.5112.79-remove-no-opaque-pointers-flag.patch -Patch36: chromium-104.0.5112.79-tflite-system-zlib.patch -Patch37: chromium-105.0.5195.102-angle-wayland-include-protocol.patch -Patch38: chromium-109.0.5414.119-REVERT-roll-src-third_party-ffmpeg-m106.patch -Patch39: chromium-110.0.5481.177-v8-move-the-Stack-object-from-ThreadLocalTop.patch -Patch40: chromium-111.0.5563.110-sql-relax-constraints-on-VirtualCursor-layout.patch -Patch41: chromium-115.0.5790.170-REVERT-disable-autoupgrading-debug-info.patch -Patch42: chromium-116.0.5845.96-randrom-build-fixes.patch -Patch43: chromium-116-0.5845.110-aarch64-include-limits.patch +Source2: https://github.com/stha09/chromium-patches/releases/download/chromium-%{gcc_patchset}/chromium-%{gcc_patchset}.tar.xz +Patch10: chromium-90.0.4430.212-use-oauth2-client-switches-as-default.patch +Patch11: chromium-115.0.5790.170-REVERT-disable-autoupgrading-debug-info.patch +Patch12: chromium-116.0.5845.96-randrom-build-fixes.patch +Patch13: chromium-116-0.5845.110-aarch64-include-limits.patch +Patch14: chromium-117.0.5938.62-material-color-utilities-cmath.patch +Patch15: chromium-117.0.5938.88-blink-remove-unused-mnemonic.patch +Patch16: chromium-117.0.5938.88-add-memory-for-std-unique_ptr-in-third_party-ip.patch +Patch17: chromium-117.0.5938.88-roll-src-third_party-libavif-src-b33d9ebfc.676aded35.patch License: BSD ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -74,6 +41,7 @@ BuildRequires: libat-spi2-core-devel BuildRequires: libatomic-devel BuildRequires: libavcodec-ffmpeg-devel BuildRequires: libavformat-ffmpeg-devel +BuildRequires: libavif-devel BuildRequires: libavutil-ffmpeg-devel BuildRequires: libcairo-devel BuildRequires: libcups-devel @@ -168,26 +136,19 @@ Chromium is an open-source browser project that aims to build a safer, faster, a sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ tools/generate_shim_headers/generate_shim_headers.py -%ifarch %{ix86} -%patch 3 -p1 -%endif -%patch 7 -p1 -b .use-oauth2-client-switches-as-default -#%patch 33 -Rp1 -b .roll-src-third_party-ffmpeg -#%patch12 -p1 -b .sql-make-VirtualCursor-standard-layout-type -#%patch 37 -p0 -b .angle-wayland-include-protocol -#%patch 38 -Rp1 -b .REVERT-roll-src-third_party-ffmpeg-m106 -#%patch 39 -p1 -d v8 -b .v8-move-the-Stack-object-from-ThreadLocalTop -#%patch 40 -p1 -b .sql-relax-constraints-on-VirtualCursor-layout -%patch 41 -Rp1 -b .REVERT-disable-autoupgrading-debug-info -%patch 42 -p1 -b .randrom-build-fixes -%patch 43 -p1 +%patch 10 -p1 -b .use-oauth2-client-switches-as-default +%patch 11 -Rp1 -b .REVERT-disable-autoupgrading-debug-info +%patch 12 -p1 -b .randrom-build-fixes +%patch 13 -p1 -b .aarch64-include-limits +%patch 14 -p0 -b .material-color-utilities-cmath +%patch 15 -p1 -b .blink-remove-unused-mnemonic +%patch 16 -p1 -b .add-memory-for-std-unique_ptr-in-third_party-ip +%patch 17 -p1 -b .roll-src-third_party-libavif-src-b33d9ebfc.676aded35 # Fixes for building with libstdc++ instead of libc++ patch -Np1 -i patches/chromium-114-maldoca-include.patch patch -Np1 -i patches/chromium-114-ruy-include.patch patch -Np1 -i patches/chromium-114-vk_mem_alloc-include.patch -patch -Np1 -i patches/chromium-116-object_paint_properties_sparse-include.patch -patch -Np1 -i patches/chromium-116-profile_view_utils-include.patch # Force script incompatible with Python 3 to use /usr/bin/python2 sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py @@ -202,9 +163,10 @@ sed -i \ # https://crbug.com/893950 sed -i -e 's/\/malloc/' -e 's/\/free/' \ - third_party/blink/renderer/core/xml/*.cc \ - third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \ - third_party/libxml/chromium/libxml_utils.cc + third_party/blink/renderer/core/xml/*.cc \ + third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \ + third_party/libxml/chromium/*.cc \ + third_party/maldoca/src/maldoca/ole/oss_utils.h ## There are still a lot of relative calls which need a workaround #mkdir -p python2-path @@ -223,7 +185,7 @@ declare -rgA _system_libs=( [icu]=icu [jsoncpp]=jsoncpp #[libaom]=aom - #[libavif]=libavif + [libavif]=libavif [libdrm]= [libjpeg]=libjpeg [libpng]=libpng @@ -317,11 +279,8 @@ chromium_conf=( 'rtc_use_pipewire=true' 'link_pulseaudio=true' 'use_custom_libcxx=false' - 'use_gnome_keyring=false' 'use_sysroot=false' 'use_system_libffi=true' - 'use_system_libwayland=true' - 'use_system_wayland_scanner=true' 'enable_hangout_services_extension=true' 'enable_widevine=true' 'enable_nacl=false' @@ -331,7 +290,10 @@ chromium_conf=( 'icu_use_data_file=false' ) -# 'use_vaapi=true' +# 'use_system_wayland_scanner=true' +# 'use_system_libwayland=true' +# 'use_gnome_keyring=false' +# 'use_vaapi=true' # 'fieldtrial_testing_like_official_build=true' # 'chrome_pgo_phase=0' # pgo incompatible with llvm 11 # 'google_default_client_id="72870267994-r1bkll5bq0v275nnsa66d21h3t6ne10s.apps.googleusercontent.com"' @@ -467,6 +429,9 @@ ln -s %{_libdir}/chromium/chromedriver %{buildroot}%{_bindir}/chromedriver %{_mandir}/man1/chromium.1* %changelog +* Mon Sep 18 2023 Silvan Calarco 117.0.5938.88-1mamba +- update to 117.0.5938.88 + * Fri Sep 01 2023 Automatic Build System 116.0.5845.163-1mamba - automatic version update by autodist