Skip to content

Commit

Permalink
Upgrade Netty to 4.1.89 (#95559)
Browse files Browse the repository at this point in the history
Upgrading 7.17.x to the version we've been using in 8.x for a while to
resolve audit issues.
  • Loading branch information
original-brownbear committed Apr 28, 2023
1 parent d13bda8 commit 38b70f6
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 46 deletions.
2 changes: 1 addition & 1 deletion build-tools-internal/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ slf4j = 1.6.2

jna = 5.10.0

netty = 4.1.66.Final
netty = 4.1.89.Final
joda = 2.10.10

commons_lang3 = 3.9
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog/95559.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 95559
summary: Upgrade Netty to 4.1.89
area: Network
type: upgrade
issues: []
78 changes: 39 additions & 39 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1369,9 +1369,9 @@
<sha256 value="63b1346bf9c97ac3c78db84ce4ffe32a69782724d337db7849cefe4e53330f21" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-buffer" version="4.1.66.Final">
<artifact name="netty-buffer-4.1.66.Final.jar">
<sha256 value="99af46a08546da9e03cb5cd6e3daac624771bb08663f304d60a988e27da59cef" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-buffer" version="4.1.89.Final">
<artifact name="netty-buffer-4.1.89.Final.jar">
<sha256 value="753b5d9df75d1bb927acc0e1ac08c65cce9a9117f85db8f87d041fd3a2d5ebcf" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec" version="4.1.42.Final">
Expand All @@ -1384,49 +1384,49 @@
<sha256 value="de3239f3a8d5bdbc8c5049e00d0ab5415d1ccede30cb4e322694e8ffe3e354b5" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec" version="4.1.66.Final">
<artifact name="netty-codec-4.1.66.Final.jar">
<sha256 value="d852eab012b0f06c94a625f96404e32e8fe829708a84e10ae71b2d8dfab47f9e" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-codec" version="4.1.89.Final">
<artifact name="netty-codec-4.1.89.Final.jar">
<sha256 value="fa6f2789b724ccbd0a734a88d9b6cdc25d592d8c22208ec35a7f4c4eda3714c7" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec-dns" version="4.1.53.Final">
<artifact name="netty-codec-dns-4.1.53.Final.jar">
<sha256 value="747098d17592d092afdfd8c746e099c3b739986461ebcfa68d782f4b5b19b8ae" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec-dns" version="4.1.66.Final">
<artifact name="netty-codec-dns-4.1.66.Final.jar">
<sha256 value="971e776bead872081c9f8133ded6835add18b26f627194a79957425563fd614f" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-codec-dns" version="4.1.89.Final">
<artifact name="netty-codec-dns-4.1.89.Final.jar">
<sha256 value="a71281ad6753fe7644587b7fd1013c87dcd0798b7fc0f4c41866d068be5ec3e0" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec-http" version="4.1.53.Final">
<artifact name="netty-codec-http-4.1.53.Final.jar">
<sha256 value="48a81eec058871c4eaf66670f824a76f403579c53ac7a6840dd6ace9dfc4ad4e" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec-http" version="4.1.66.Final">
<artifact name="netty-codec-http-4.1.66.Final.jar">
<sha256 value="b30b35c69bfe39497aeaf2c7a99bcaea68a9d3eaeee403ecb597cd14f5df4205" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-codec-http" version="4.1.89.Final">
<artifact name="netty-codec-http-4.1.89.Final.jar">
<sha256 value="433e9fe8f1907847132f5bd022a7e6148ade6c834aef761765d7db4962cd6bb0" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec-http2" version="4.1.53.Final">
<artifact name="netty-codec-http2-4.1.53.Final.jar">
<sha256 value="6c777f308be5bb53f33925e695dc97f0b88688e2f1937c2c7a3975e977362df4" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec-http2" version="4.1.66.Final">
<artifact name="netty-codec-http2-4.1.66.Final.jar">
<sha256 value="206e8685fc0e75860b348b2925e6a416d1bace4cea82adbb87abcbc8cb91ad2d" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-codec-http2" version="4.1.89.Final">
<artifact name="netty-codec-http2-4.1.89.Final.jar">
<sha256 value="13bad47c625b0c7bb47315afe9a558c39b6f2c337c8bb18b8f5fd527e23ca798" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec-socks" version="4.1.53.Final">
<artifact name="netty-codec-socks-4.1.53.Final.jar">
<sha256 value="8de51d13f48da8eece7df43aa00d6d2923a215668526d8888879fa1534e9aafe" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-codec-socks" version="4.1.66.Final">
<artifact name="netty-codec-socks-4.1.66.Final.jar">
<sha256 value="f81e9c0c9879769fe5fea1fef54405a9efb0562b4b2f144ab8641819ea38d44b" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-codec-socks" version="4.1.89.Final">
<artifact name="netty-codec-socks-4.1.89.Final.jar">
<sha256 value="8a46576f4d80935d91a9adedae9f7643c72c0d435a70e7ad51a6f1d0ba10df61" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-common" version="4.1.42.Final">
Expand All @@ -1439,9 +1439,9 @@
<sha256 value="0fc9d8ac53dcafa7823498cf668839d3fa164ea2e02eee5946c5f5061f61a5d9" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-common" version="4.1.66.Final">
<artifact name="netty-common-4.1.66.Final.jar">
<sha256 value="bf7e66d832e62dd2cbe7802a3d45ece7f8c6de2958e69d85fae0149cb0820459" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-common" version="4.1.89.Final">
<artifact name="netty-common-4.1.89.Final.jar">
<sha256 value="36f1b610d99928fd11a2aa13e01fef8be03e6411e7acd4ca2273efa7f703e474" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-handler" version="4.1.42.Final">
Expand All @@ -1454,19 +1454,19 @@
<sha256 value="6b5bc48c787af3d14be2387d2b180bc0f50e7dce7a7eb3afa7e3dd00c68f37e3" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-handler" version="4.1.66.Final">
<artifact name="netty-handler-4.1.66.Final.jar">
<sha256 value="b67da9271458afb434478d86be9f2736a5be2981e49eda2429a9962b10684f7f" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-handler" version="4.1.89.Final">
<artifact name="netty-handler-4.1.89.Final.jar">
<sha256 value="925a45ba01e3dcba1d40b8b595a3c8e8e885be491958279046087d643c9009ab" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-handler-proxy" version="4.1.53.Final">
<artifact name="netty-handler-proxy-4.1.53.Final.jar">
<sha256 value="1f4b5a540f596e45bcde7c53f4c02780aa5e56eea4103eee78b7d104f90c97b1" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-handler-proxy" version="4.1.66.Final">
<artifact name="netty-handler-proxy-4.1.66.Final.jar">
<sha256 value="b300d6276cd7f3c35b16ed5f55ec9d6752ccdebac78473e02d607e1c76792247" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-handler-proxy" version="4.1.89.Final">
<artifact name="netty-handler-proxy-4.1.89.Final.jar">
<sha256 value="5682b798fd6edbe2c521f196143dfe28fc993038438726b5fff127c181a0e9be" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-resolver" version="4.1.42.Final">
Expand All @@ -1479,19 +1479,19 @@
<sha256 value="93a531bbaa6d3a0652cbc9f13c21ca6cab9d6160c7a6f47c9cf29a5f2c5d6489" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-resolver" version="4.1.66.Final">
<artifact name="netty-resolver-4.1.66.Final.jar">
<sha256 value="e89040e9a760f13ec6c05175d633254dd4ea603b204f7a442744485b3c46d1eb" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-resolver" version="4.1.89.Final">
<artifact name="netty-resolver-4.1.89.Final.jar">
<sha256 value="ef0f127d14c4b8a86d55a9841b59e0edcf8c6974caceba8939e7149e01348233" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-resolver-dns" version="4.1.53.Final">
<artifact name="netty-resolver-dns-4.1.53.Final.jar">
<sha256 value="bb63961902ce4a4724e80efde16a63b06f871a2cb2387eb90aa2c3663f17db90" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-resolver-dns" version="4.1.66.Final">
<artifact name="netty-resolver-dns-4.1.66.Final.jar">
<sha256 value="79a4ebf15abf47e17bcb04dfd6f47ab5c89eff40ea2b28aba60a64168aad08be" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-resolver-dns" version="4.1.89.Final">
<artifact name="netty-resolver-dns-4.1.89.Final.jar">
<sha256 value="17fe0d7abe9f1cf498cdaf21942a1975fff744432686b9b7eac82667258e63b2" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport" version="4.1.42.Final">
Expand All @@ -1504,9 +1504,9 @@
<sha256 value="140ff7266eb56762b7bbb9220e82ee27ad1f2f1dc262abcec6d7137cfec5bd00" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport" version="4.1.66.Final">
<artifact name="netty-transport-4.1.66.Final.jar">
<sha256 value="59e0c2f8e55e0c1d5df254226395a865af87a9e11f8b96d2dff92660b1dbcfc1" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-transport" version="4.1.89.Final">
<artifact name="netty-transport-4.1.89.Final.jar">
<sha256 value="12647324c8b8046750921b72a8eec62db1f92b2e3e744822cfb63b23fa387b03" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport-native-epoll" version="4.1.42.Final">
Expand All @@ -1529,9 +1529,9 @@
<sha256 value="e97306961515012c7ca0dda4f1374ee65d9eb913336b1bac44096231236ad1cf" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.netty" name="netty-transport-native-unix-common" version="4.1.66.Final">
<artifact name="netty-transport-native-unix-common-4.1.66.Final.jar">
<sha256 value="aba6624772e2b85cc7bce6a8b734a4cac418d08b7319ec446a328fe54571b4b7" origin="Generated by Gradle"/>
<component group="io.netty" name="netty-transport-native-unix-common" version="4.1.89.Final">
<artifact name="netty-transport-native-unix-common-4.1.89.Final.jar">
<sha256 value="a80c721f1c43ea670f6ee738ec50bfbd2189d43512a37d7f44878c8dda23a197" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="io.opencensus" name="opencensus-api" version="0.28.0">
Expand Down
13 changes: 12 additions & 1 deletion modules/transport-netty4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies {
api "io.netty:netty-handler:${versions.netty}"
api "io.netty:netty-resolver:${versions.netty}"
api "io.netty:netty-transport:${versions.netty}"
api "io.netty:netty-transport-native-unix-common:${versions.netty}"
}

restResources {
Expand Down Expand Up @@ -88,6 +89,7 @@ tasks.named("thirdPartyAudit").configure {
'com.aayushatharva.brotli4j.Brotli4jLoader',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Status',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Wrapper',
'com.aayushatharva.brotli4j.encoder.BrotliEncoderChannel',
'com.aayushatharva.brotli4j.encoder.Encoder',
'com.aayushatharva.brotli4j.encoder.Encoder$Mode',
'com.aayushatharva.brotli4j.encoder.Encoder$Parameters',
Expand All @@ -108,7 +110,9 @@ tasks.named("thirdPartyAudit").configure {

// from io.netty.handler.ssl.OpenSslEngine (netty)
'io.netty.internal.tcnative.Buffer',
'io.netty.internal.tcnative.CertificateCompressionAlgo',
'io.netty.internal.tcnative.Library',
'io.netty.internal.tcnative.SessionTicketKey',
'io.netty.internal.tcnative.SSL',
'io.netty.internal.tcnative.SSLContext',
'io.netty.internal.tcnative.SSLPrivateKeyMethod',
Expand All @@ -117,6 +121,12 @@ tasks.named("thirdPartyAudit").configure {
'org.bouncycastle.cert.X509v3CertificateBuilder',
'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter',
'org.bouncycastle.operator.jcajce.JcaContentSignerBuilder',
'org.bouncycastle.openssl.PEMEncryptedKeyPair',
'org.bouncycastle.openssl.PEMParser',
'org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter',
'org.bouncycastle.openssl.jcajce.JceOpenSSLPKCS8DecryptorProviderBuilder',
'org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder',
'org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo',

// from io.netty.handler.ssl.JettyNpnSslEngine (netty)
'org.eclipse.jetty.npn.NextProtoNego$ClientProvider',
Expand Down Expand Up @@ -189,7 +199,8 @@ tasks.named("thirdPartyAudit").configure {
'io.netty.util.internal.PlatformDependent0$1',
'io.netty.util.internal.PlatformDependent0$2',
'io.netty.util.internal.PlatformDependent0$3',
'io.netty.util.internal.PlatformDependent0$5',
'io.netty.util.internal.PlatformDependent0$4',
'io.netty.util.internal.PlatformDependent0$6',
'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueConsumerNodeRef',
'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueProducerNodeRef',
'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.elasticsearch.test.rest.yaml.ObjectPath;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Map;

import static org.elasticsearch.rest.RestStatus.BAD_REQUEST;
Expand Down Expand Up @@ -56,13 +56,13 @@ public void testBadRequest() throws IOException {
maxMaxInitialLineLength = Math.max(maxMaxInitialLineLength, maxIntialLineLength);
}

final String path = "/" + new String(new byte[maxMaxInitialLineLength], Charset.forName("UTF-8")).replace('\0', 'a');
final String path = "/" + new String(new byte[maxMaxInitialLineLength], StandardCharsets.UTF_8).replace('\0', 'a');
final ResponseException e = expectThrows(
ResponseException.class,
() -> client().performRequest(new Request(randomFrom("GET", "POST", "PUT"), path))
);
assertThat(e.getResponse().getStatusLine().getStatusCode(), equalTo(BAD_REQUEST.getStatus()));
assertThat(e, hasToString(containsString("too_long_frame_exception")));
assertThat(e, hasToString(containsString("too_long_http_line_exception")));
assertThat(e, hasToString(matches("An HTTP line is larger than \\d+ bytes")));
}

Expand Down
11 changes: 10 additions & 1 deletion plugins/repository-azure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ tasks.named("thirdPartyAudit").configure {
'com.aayushatharva.brotli4j.Brotli4jLoader',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Status',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Wrapper',
'com.aayushatharva.brotli4j.encoder.BrotliEncoderChannel',
'com.aayushatharva.brotli4j.encoder.Encoder',
'com.aayushatharva.brotli4j.encoder.Encoder$Mode',
'com.aayushatharva.brotli4j.encoder.Encoder$Parameters',
Expand Down Expand Up @@ -178,6 +179,12 @@ tasks.named("thirdPartyAudit").configure {
'org.bouncycastle.cert.X509v3CertificateBuilder',
'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter',
'org.bouncycastle.operator.jcajce.JcaContentSignerBuilder',
'org.bouncycastle.openssl.PEMEncryptedKeyPair',
'org.bouncycastle.openssl.PEMParser',
'org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter',
'org.bouncycastle.openssl.jcajce.JceOpenSSLPKCS8DecryptorProviderBuilder',
'org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder',
'org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo',

// from io.netty.handler.ssl.JettyNpnSslEngine (netty)
'org.eclipse.jetty.npn.NextProtoNego$ClientProvider',
Expand Down Expand Up @@ -234,6 +241,7 @@ tasks.named("thirdPartyAudit").configure {
'io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod',
'io.netty.internal.tcnative.AsyncTask',
'io.netty.internal.tcnative.Buffer',
'io.netty.internal.tcnative.CertificateCompressionAlgo',
'io.netty.internal.tcnative.Library',
'io.netty.internal.tcnative.SSL',
'io.netty.internal.tcnative.SSLContext',
Expand Down Expand Up @@ -330,7 +338,8 @@ tasks.named("thirdPartyAudit").configure {
'io.netty.util.internal.PlatformDependent0$1',
'io.netty.util.internal.PlatformDependent0$2',
'io.netty.util.internal.PlatformDependent0$3',
'io.netty.util.internal.PlatformDependent0$5',
'io.netty.util.internal.PlatformDependent0$4',
'io.netty.util.internal.PlatformDependent0$6',
'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueConsumerNodeRef',
'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueProducerNodeRef',
'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields',
Expand Down
12 changes: 11 additions & 1 deletion plugins/transport-nio/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies {
api "io.netty:netty-handler:${versions.netty}"
api "io.netty:netty-resolver:${versions.netty}"
api "io.netty:netty-transport:${versions.netty}"
api "io.netty:netty-transport-native-unix-common:${versions.netty}"
}

tasks.named("dependencyLicenses").configure {
Expand All @@ -38,6 +39,7 @@ tasks.named("thirdPartyAudit").configure {
'com.aayushatharva.brotli4j.Brotli4jLoader',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Status',
'com.aayushatharva.brotli4j.decoder.DecoderJNI$Wrapper',
'com.aayushatharva.brotli4j.encoder.BrotliEncoderChannel',
'com.aayushatharva.brotli4j.encoder.Encoder',
'com.aayushatharva.brotli4j.encoder.Encoder$Mode',
'com.aayushatharva.brotli4j.encoder.Encoder$Parameters',
Expand All @@ -60,6 +62,12 @@ tasks.named("thirdPartyAudit").configure {
'org.bouncycastle.cert.X509v3CertificateBuilder',
'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter',
'org.bouncycastle.operator.jcajce.JcaContentSignerBuilder',
'org.bouncycastle.openssl.PEMEncryptedKeyPair',
'org.bouncycastle.openssl.PEMParser',
'org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter',
'org.bouncycastle.openssl.jcajce.JceOpenSSLPKCS8DecryptorProviderBuilder',
'org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder',
'org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo',

// from io.netty.handler.ssl.JettyNpnSslEngine (netty)
'org.eclipse.jetty.npn.NextProtoNego$ClientProvider',
Expand Down Expand Up @@ -117,6 +125,7 @@ tasks.named("thirdPartyAudit").configure {
'io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod',
'io.netty.internal.tcnative.AsyncTask',
'io.netty.internal.tcnative.Buffer',
'io.netty.internal.tcnative.CertificateCompressionAlgo',
'io.netty.internal.tcnative.Library',
'io.netty.internal.tcnative.SSL',
'io.netty.internal.tcnative.SSLContext',
Expand All @@ -139,7 +148,8 @@ tasks.named("thirdPartyAudit").configure {
'io.netty.util.internal.PlatformDependent0$1',
'io.netty.util.internal.PlatformDependent0$2',
'io.netty.util.internal.PlatformDependent0$3',
'io.netty.util.internal.PlatformDependent0$5',
'io.netty.util.internal.PlatformDependent0$4',
'io.netty.util.internal.PlatformDependent0$6',
'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueConsumerNodeRef',
'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueProducerNodeRef',
'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields',
Expand Down

0 comments on commit 38b70f6

Please sign in to comment.