Skip to content

quiche: update QUICHE and boringSSL dependency#15181

Merged
alyssawilk merged 14 commits intoenvoyproxy:mainfrom
danzh2010:updatetar10
Mar 3, 2021
Merged

quiche: update QUICHE and boringSSL dependency#15181
alyssawilk merged 14 commits intoenvoyproxy:mainfrom
danzh2010:updatetar10

Conversation

@danzh2010
Copy link
Copy Markdown
Contributor

@danzh2010 danzh2010 commented Feb 24, 2021

Signed-off-by: Dan Zhang [email protected]

Commit Message: update QUICHE to commit 6fec8e97a1ab1a945b86bd6b7252666294448ddb and boring SSL commit b049eae83d25977661556dcd913b35fbafb3a93a.

Additional Description: the latest QUICHE commit depends on broingSSL commit: https://boringssl.googlesource.com/boringssl/+/3d8b8c3df27cc780a49607be6a27f2c518f5c082 which is in chrome dev channel.

Risk Level: low
Testing: existing tests passed

Signed-off-by: Dan Zhang <[email protected]>
@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Feb 24, 2021
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).

🐱

Caused by: #15181 was opened by danzh2010.

see: more, trace.

Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
@danzh2010
Copy link
Copy Markdown
Contributor Author

/assign @wu-bin @alyssawilk

@moderation
Copy link
Copy Markdown
Contributor

/lgtm deps

@repokitteh-read-only repokitteh-read-only bot removed the deps Approval required for changes to Envoy's external dependencies label Feb 25, 2021
Signed-off-by: Dan Zhang <[email protected]>
Comment on lines +1260 to +1264
deps =
[
":quic_platform_export",
":quiche_common_platform_export",
],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: format

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +23 to +24
// Only call watermark callbacks on non QUIC static streams which are
// crypto stream and Google QUIC headers stream.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment is obsolete.

This function was useful previously because it encaps the looping logic, but we have PerformActionOnActiveStreams now, this function does not seem to useful anymore. I'm inclined to remove it, and call the callbacks directly from onUnderlyingConnectionAboveWriteBufferHighWatermark and onUnderlyingConnectionBelowWriteBufferLowWatermark.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point!

// of propagating original reset reason. In QUICHE if a stream stops reading
// before FIN or RESET received, it resets the steam with QUIC_STREAM_NO_ERROR.
StopReading();
runResetCallbacks(Http::StreamResetReason::LocalReset);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a new callback, or did we miss it previously? Does it have test coverage?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StopReading() stopped calling Reset() but calling session to send reset directly. So the callback in Reset() stopped from being triggered. It caused unit tests failure before adding this callback.

Comment on lines 16 to +23
: fragment_(std::make_unique<Envoy::Buffer::BufferFragmentImpl>(
buffer.release(), length,
[](const void* p, size_t, const Envoy::Buffer::BufferFragmentImpl*) {
delete[] static_cast<const char*>(p);
buffer.get(), length,
[allocator = buffer.get_deleter().allocator()](const void* p, size_t,
const Envoy::Buffer::BufferFragmentImpl*) {
quic::QuicBufferDeleter deleter(allocator);
deleter(const_cast<char*>(static_cast<const char*>(p)));
})) {
buffer.release();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about use a function to initialize fragment_?

std::unique_ptr<Envoy::Buffer::BufferFragmentImpl> ConvertToBufferFragment(
  QuicUniqueBufferPtr buffer, size_t length) {
  const void* p = buffer.get();
  return std::make_unique<Envoy::Buffer::BufferFragmentImpl>(p, length, [buf = std::move(buffer)](
    const void*, size_t, const Envoy::Buffer::BufferFragmentImpl*) {};
}

QuicMemSliceImpl::QuicMemSliceImpl(QuicUniqueBufferPtr buffer, size_t length)
  : fragment_(ConvertToBufferFragment(std::move(buffer), length))

You don't need the buffer.release() this way.

You can also change ConvertToBufferFragment to be templated on the buffer type, such that it can be used by the other constructor too(the one accepts a std::unique_ptr<char[]>).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BufferFragmentImpl constructor take a function referece and copy it over. So with unique_ptr in the capture, the lambda here is not copiable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, it seems BufferFragmentImpl should take the releasor by value and std::move() into its member field. But feel free to do it in the separate change, or just add a TODO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added TODO for it.


MOCK_METHOD(void, SendConnectionClosePacket, (quic::QuicErrorCode, const std::string&));
MOCK_METHOD(void, SendConnectionClosePacket,
(quic::QuicErrorCode, quic::QuicIetfTransportErrorCodes ietf_error,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Please be consistent here, either always have the argument name spelled, or always not spelled.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +295 to +299
if (quic::VersionUsesHttp3(quic_version_.transport_version)) {
EXPECT_CALL(quic_session_, MaybeSendStopSendingFrame(_, _));
} else {
EXPECT_CALL(quic_session_, MaybeSendRstStreamFrame(_, _, _));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other tests in this file, we always expect MaybeSendRstStreamFrame, and also expect a MaybeSendStopSendingFrame for h3. This test expects only one of them to happen. Is it intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in early response case, FIN is ready sent before resetting, so IETF quic will not send RST_STREAM again but only STOP_SENDING.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation.

@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Feb 26, 2021
@danzh2010
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15181 (comment) was created by @danzh2010.

see: more, trace.

wu-bin
wu-bin previously approved these changes Mar 1, 2021
Copy link
Copy Markdown
Contributor

@wu-bin wu-bin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks Dan!

Comment on lines 16 to +23
: fragment_(std::make_unique<Envoy::Buffer::BufferFragmentImpl>(
buffer.release(), length,
[](const void* p, size_t, const Envoy::Buffer::BufferFragmentImpl*) {
delete[] static_cast<const char*>(p);
buffer.get(), length,
[allocator = buffer.get_deleter().allocator()](const void* p, size_t,
const Envoy::Buffer::BufferFragmentImpl*) {
quic::QuicBufferDeleter deleter(allocator);
deleter(const_cast<char*>(static_cast<const char*>(p)));
})) {
buffer.release();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, it seems BufferFragmentImpl should take the releasor by value and std::move() into its member field. But feel free to do it in the separate change, or just add a TODO.

Comment on lines +295 to +299
if (quic::VersionUsesHttp3(quic_version_.transport_version)) {
EXPECT_CALL(quic_session_, MaybeSendStopSendingFrame(_, _));
} else {
EXPECT_CALL(quic_session_, MaybeSendRstStreamFrame(_, _, _));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation.

Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
@danzh2010
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15181 (comment) was created by @danzh2010.

see: more, trace.

@danzh2010
Copy link
Copy Markdown
Contributor Author

@envoyproxy/dependency-shepherds

@moderation
Copy link
Copy Markdown
Contributor

/lgtm deps

@repokitteh-read-only repokitteh-read-only bot removed the deps Approval required for changes to Envoy's external dependencies label Mar 2, 2021
@moderation
Copy link
Copy Markdown
Contributor

The deps look OK from a deps hygiene point of view but copying TLS codeowners @lizan @asraa @ggreenway as this is a little unusual as it is pulling in a BoringSSL version from Chrome dev channel vs. the normal stable channel. /cc @htuch

@htuch
Copy link
Copy Markdown
Member

htuch commented Mar 2, 2021

@danzh1989 can you comment on:

this is a little unusual as it is pulling in a BoringSSL version from Chrome dev channel vs. the normal stable channel.

?

@danzh2010
Copy link
Copy Markdown
Contributor Author

danzh2010 commented Mar 2, 2021

@danzh1989 can you comment on:

this is a little unusual as it is pulling in a BoringSSL version from Chrome dev channel vs. the normal stable channel.

?

As noted in PR description the latest QUICHE depends on a new TLS interface from commit https://boringssl.googlesource.com/boringssl/+/3d8b8c3df27cc780a49607be6a27f2c518f5c082. This commit is not in chrome stable yet. We had similar issue before and discussed with @PiotrSikora that in such case bumping the boring SSL version is fine.

@htuch
Copy link
Copy Markdown
Member

htuch commented Mar 2, 2021

Sure, trying to help @moderation here with understanding the implications of working on the linux/dev branch. What are the properties that differ from stable? Do we lose any security coverage etc?

@danzh2010
Copy link
Copy Markdown
Contributor Author

Sure, trying to help @moderation here with understanding the implications of working on the linux/dev branch. What are the properties that differ from stable? Do we lose any security coverage etc?

AFAIK, chrome dev channel is used by a smaller percentage of users for a shorter period. These two channels differ in terms of robustness. But in terms of security, dev channel also went through release and security review. @PiotrSikora may be able to comment more about security aspect.

@alyssawilk
Copy link
Copy Markdown
Contributor

If we have concerns about the boringssl pull @davidben could probably address as well.

@davidben
Copy link
Copy Markdown
Contributor

davidben commented Mar 2, 2021

Review-wise, BoringSSL CLs are reviewed before check-in. We do generally aim for HEAD to be usable at any point and generally track HEAD in most of our repositories. "Live at HEAD" and all that. The repositories aren't updated continuously (weekly, biweekly, monthly, etc.), but this is less out of stability and more the time to assemble the update, run everyone's tests, etc. Mistakes may happen, but unit tests and each projects' release cycles tend to work well to catch this stuff.

@htuch
Copy link
Copy Markdown
Member

htuch commented Mar 2, 2021

/lgtm deps
Thanks for the explanations @danzh1989 and @davidben

testing::ValuesIn(generateTestParam()), testParamsToString);

TEST_P(EnvoyQuicDispatcherTest, CreateNewConnectionUponCHLO) {
quic::SetVerbosityLogThreshold(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this for test debug, or something we want on permanently?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was for debugging, removed now.

alyssawilk
alyssawilk previously approved these changes Mar 2, 2021
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but holding merge on the verbosity question

Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
@alyssawilk alyssawilk merged commit 80a88a8 into envoyproxy:main Mar 3, 2021
This was referenced Mar 3, 2021
alyssawilk added a commit to alyssawilk/envoy that referenced this pull request Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants