diff options
author | Max Rees <maxcrees@me.com> | 2020-05-04 12:37:39 -0500 |
---|---|---|
committer | Max Rees <maxcrees@me.com> | 2020-05-04 22:51:42 -0500 |
commit | 28fdd34de44edcf8d1a08cc45cd564099e9268fc (patch) | |
tree | 1e7dcb7d13c610594926f65a399b237b653fcead /user/openjdk8/icedtea-jdk-getmntent-buffer.patch | |
parent | 13df4b4fac8068b1c833c4cff3c49feacc53b26e (diff) | |
download | packages-28fdd34de44edcf8d1a08cc45cd564099e9268fc.tar.gz packages-28fdd34de44edcf8d1a08cc45cd564099e9268fc.tar.bz2 packages-28fdd34de44edcf8d1a08cc45cd564099e9268fc.tar.xz packages-28fdd34de44edcf8d1a08cc45cd564099e9268fc.zip |
user/openjdk8: [CVE] bump to 8.252.09 (#269)
* Bootstrap using openjdk8. Note that it will need to be manually
installed when building now...
* Cherrypick patch changes from Alpine:
icedtea-jdk-tls-nist-curves.patch was integrated upstream, and
icedtea-hotspot-musl.patch was rebased for 8u232.
https://git.alpinelinux.org/aports/commit/community/openjdk8?id=04ec13ca9caa9a436001be92e674f230b9894894
* Rebase patches for 8u252-ga:
In particular, icedtea-jdk-getmntent-buffer.patch is dropped since
upstream takes a new approach by allocating a buffer according to the
length of the longest line in mtab.
https://bugs.openjdk.java.net/browse/JDK-8229872
* Use private variables (_) where applicable
Diffstat (limited to 'user/openjdk8/icedtea-jdk-getmntent-buffer.patch')
-rw-r--r-- | user/openjdk8/icedtea-jdk-getmntent-buffer.patch | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/user/openjdk8/icedtea-jdk-getmntent-buffer.patch b/user/openjdk8/icedtea-jdk-getmntent-buffer.patch deleted file mode 100644 index 075a9d423..000000000 --- a/user/openjdk8/icedtea-jdk-getmntent-buffer.patch +++ /dev/null @@ -1,88 +0,0 @@ -Give a much bigger buffer to getmntent_r. - -https://bugs.alpinelinux.org/issues/7093 - -diff --git a/openjdk/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c b/openjdk/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c -index c8500db..d0b85d6 100644 ---- openjdk/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c -+++ openjdk/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c -@@ -33,6 +33,7 @@ - #include <dlfcn.h> - #include <errno.h> - #include <mntent.h> -+#include <limits.h> - - #include "sun_nio_fs_LinuxNativeDispatcher.h" - -@@ -173,8 +174,8 @@ Java_sun_nio_fs_LinuxNativeDispatcher_getmntent(JNIEnv* env, jclass this, - jlong value, jobject entry) - { - struct mntent ent; -- char buf[1024]; -- int buflen = sizeof(buf); -+ char *buf = NULL; -+ const size_t buflen = PATH_MAX * 4; - struct mntent* m; - FILE* fp = jlong_to_ptr(value); - jsize len; -@@ -183,10 +184,17 @@ Java_sun_nio_fs_LinuxNativeDispatcher_getmntent(JNIEnv* env, jclass this, - char* dir; - char* fstype; - char* options; -+ jint res = -1; - -- m = getmntent_r(fp, &ent, (char*)&buf, buflen); -- if (m == NULL) -+ buf = malloc(buflen); -+ if (buf == NULL) { -+ JNU_ThrowOutOfMemoryError(env, "native heap"); - return -1; -+ } -+ m = getmntent_r(fp, &ent, buf, buflen); -+ if (m == NULL) -+ goto out; -+ - name = m->mnt_fsname; - dir = m->mnt_dir; - fstype = m->mnt_type; -@@ -195,32 +203,35 @@ Java_sun_nio_fs_LinuxNativeDispatcher_getmntent(JNIEnv* env, jclass this, - len = strlen(name); - bytes = (*env)->NewByteArray(env, len); - if (bytes == NULL) -- return -1; -+ goto out; - (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)name); - (*env)->SetObjectField(env, entry, entry_name, bytes); - - len = strlen(dir); - bytes = (*env)->NewByteArray(env, len); - if (bytes == NULL) -- return -1; -+ goto out; - (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)dir); - (*env)->SetObjectField(env, entry, entry_dir, bytes); - - len = strlen(fstype); - bytes = (*env)->NewByteArray(env, len); - if (bytes == NULL) -- return -1; -+ goto out; - (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype); - (*env)->SetObjectField(env, entry, entry_fstype, bytes); - - len = strlen(options); - bytes = (*env)->NewByteArray(env, len); - if (bytes == NULL) -- return -1; -+ goto out; - (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options); - (*env)->SetObjectField(env, entry, entry_options, bytes); - -- return 0; -+ res = 0; -+out: -+ free(buf); -+ return res; - } - - JNIEXPORT void JNICALL |