Integrated: JDK-8327986: ASAN reports use-after-free in DirectivesParserTest.empty_object_vm

Thomas Stuefe stuefe at openjdk.org
Thu Mar 28 07:12:42 UTC 2024


On Tue, 12 Mar 2024 13:57:53 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> ASAN reports a use-after-free, because we feed the string we got from `setlocale` back to `setlocale`, but the libc owns this string, and the libc decided to free it in the meantime.
> 
> According to POSIX, it should be valid to pass into setlocale output from setlocale.
> 
> However, glibc seems to delete the old string when calling setlocale again:
> 
> https://codebrowser.dev/glibc/glibc/locale/setlocale.c.html#198
> 
> Best to make a copy, and pass in the copy to setlocale.

This pull request has now been integrated.

Changeset: 47f33a59
Author:    Thomas Stuefe <stuefe at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/47f33a59eaaffc74881fcc9e29d13ff9b2538c2a
Stats:     3 lines in 1 file changed: 1 ins; 0 del; 2 mod

8327986: ASAN reports use-after-free in DirectivesParserTest.empty_object_vm

Reviewed-by: kvn, djelinski

-------------

PR: https://git.openjdk.org/jdk/pull/18235


More information about the hotspot-compiler-dev mailing list