[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-serviceability-dev
Subject: Re: RFR: 8229378: jdwp library loader in linker_md.c quietly truncates on buffer overflow
From: "serguei.spitsyn () oracle ! com" <serguei ! spitsyn () oracle ! com>
Date: 2019-08-29 18:38:02
Message-ID: 3ea2e6ad-a32d-603c-258c-985da4e2f50a () oracle ! com
[Download RAW message or body]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Adam,<br>
<br>
Okay, thanks!<br>
Serguei<br>
<br>
<br>
On 8/29/19 06:26, Adam Farley8 wrote:<br>
</div>
<blockquote type="cite"
cite="mid:OFBA61079C.095E93D7-ON00258465.0030AB99-80258465.0049CC32@notes.na.collabserv.com"><span>Hi
Serguei,</span>
<br>
<br>
<span>I haven't actually
run a fastdebug build before. Will do that now and address the
issues.</span>
<br>
<br>
<span>Once done, I'll
re-run the tests I ran, and also the tests you've listed below.</span>
<br>
<br>
<span>Can you advise
on how "good coverage" is determined, so I know for future bug
fixes?</span>
<br>
<br>
<span>As for the up-to-date-ness,
I'll update the build before doing the above.</span>
<br>
<br>
<span>Expect a webrev
once all of this is complete.<br>
<br>
Best Regards<br>
<br>
Adam Farley <br>
IBM Runtimes<br>
</span>
<br>
<br>
<tt><span><a class="moz-txt-link-rfc2396E" \
href="mailto:serguei.spitsyn@oracle.com">"serguei.spitsyn@oracle.com"</a>
<a class="moz-txt-link-rfc2396E" \
href="mailto:serguei.spitsyn@oracle.com"><serguei.spitsyn@oracle.com></a> wrote \
on 29/08/2019 03:54:56:<br>
<br>
> From: <a class="moz-txt-link-rfc2396E" \
href="mailto:serguei.spitsyn@oracle.com">"serguei.spitsyn@oracle.com"</a>
<a class="moz-txt-link-rfc2396E" \
href="mailto:serguei.spitsyn@oracle.com"><serguei.spitsyn@oracle.com></a></span></tt>
<br>
<tt><span>> To: Adam Farley8 <a class="moz-txt-link-rfc2396E" \
href="mailto:adam.farley@uk.ibm.com"><adam.farley@uk.ibm.com></a></span></tt> \
<br>
<tt><span>> Cc: Chris Plummer <a class="moz-txt-link-rfc2396E" \
href="mailto:chris.plummer@oracle.com"><chris.plummer@oracle.com></a>, <br>
> <a class="moz-txt-link-abbreviated" \
href="mailto:daniel.daugherty@oracle.com">daniel.daugherty@oracle.com</a>,
<a class="moz-txt-link-abbreviated" \
href="mailto:serviceability-dev@openjdk.java.net">serviceability-dev@openjdk.java.net</a></span></tt>
<br>
<tt><span>> Date: 29/08/2019 04:23</span></tt>
<br>
<tt><span>> Subject: Re: RFR: 8229378: jdwp
library loader in linker_md.c <br>
> quietly truncates on buffer overflow</span></tt>
<br>
<tt><span>> <br>
> Hi Adam,<br>
> <br>
> Sorry for the latency.<br>
> I was in process to build, test and push your fix and got
the <br>
> fastdebug build errors below.<br>
> <br>
> So, my question is if you've ever built the fastdebug
version.<br>
> This change is in the system-dependent code, so it has to
be tested
<br>
> on both Unix and Windows.<br>
> <br>
> > My testing was limited to the bug specific test case
I mentioned,
<br>
> and the following jdwp tests: <br>
> > <br>
> > test/jdk/com/sun/jdi/Jdwp*<br>
> > test/hotspot/jtreg/serviceability/jdwp<br>
> <br>
> This set of tests does not provide a good coverage.<br>
> To make sure nothing is broken you need to run the the
test/jdk/com/sun/jdi<br>
> and also the following vmTestbase tests:<br>
> <br>
> test/hotspot/jtreg/vmTestbase/nsk/jdi<br>
> test/hotspot/jtreg/vmTestbase/nsk/jdb<br>
> test/hotspot/jtreg/vmTestbase/nsk/jdwp<br>
> <br>
> BTW, your current webrev is not up-to-date:<br>
> </span></tt><a
href="http://cr.openjdk.java.net/~afarley/8229378/webrev/"
moz-do-not-send="true"><tt><span>http://cr.openjdk.java.net/~afarley/8229378/webrev/</span></tt></a><tt><span><br>
> <br>
> I guess, the change in the
src/hotspot/share/runtime/os.cpp became<br>
> obsolete after your previous fix that was already pushed.<br>
> <br>
> Thanks,<br>
> Serguei<br>
> <br>
> . . .<br>
> In file included from /scratch/sspitsyn/jdk14.1/open/src/<br>
> jdk.jdwp.agent/unix/native/libjdwp/linker_md.c:37:0:<br>
>
/scratch/sspitsyn/jdk14.1/open/src/jdk.jdwp.agent/unix/native/<br>
> libjdwp/linker_md.c: In function ‘dll_build_name':<br>
>
/scratch/sspitsyn/jdk14.1/open/src/jdk.jdwp.agent/share/native/<br>
> libjdwp/util.h:46:23: error: ‘Do' undeclared (first use
in this
function)<br>
> #define strdup(p) Do not use this interface.<br>
>
^<br>
>
/scratch/sspitsyn/jdk14.1/open/src/jdk.jdwp.agent/unix/native/<br>
> libjdwp/linker_md.c:51:18: note: in expansion of macro
‘strdup'<br>
> paths_copy = strdup(paths);<br>
>
^<br>
>
/scratch/sspitsyn/jdk14.1/open/src/jdk.jdwp.agent/share/native/<br>
> libjdwp/util.h:46:23: note: each undeclared identifier is
reported
<br>
> only once for each function it appears in<br>
> #define strdup(p) Do not use this interface.<br>
>
^<br>
>
/scratch/sspitsyn/jdk14.1/open/src/jdk.jdwp.agent/unix/native/<br>
> libjdwp/linker_md.c:51:18: note: in expansion of macro
‘strdup'<br>
> paths_copy = strdup(paths);<br>
>
^<br>
>
/scratch/sspitsyn/jdk14.1/open/src/jdk.jdwp.agent/share/native/<br>
> libjdwp/util.h:46:26: error: expected ‘;' before ‘not'<br>
> #define strdup(p) Do not use this interface.<br>
>
^<br>
>
/scratch/sspitsyn/jdk14.1/open/src/jdk.jdwp.agent/unix/native/<br>
> libjdwp/linker_md.c:51:18: note: in expansion of macro
‘strdup'<br>
> paths_copy = strdup(paths);<br>
>
^<br>
>
/scratch/sspitsyn/jdk14.1/open/src/jdk.jdwp.agent/share/native/<br>
> libjdwp/util.h:38:24: error: expected ‘;' before ‘not'<br>
> #define free(p) Do not use this interface.<br>
>
^<br>
>
/scratch/sspitsyn/jdk14.1/open/src/jdk.jdwp.agent/unix/native/<br>
> libjdwp/linker_md.c:71:5: note: in expansion of macro
‘free'<br>
> free(paths_copy);<br>
> ^<br>
> gmake[3]: ***
[/scratch/sspitsyn/jdk14.1/build/linux-x86_64-server-<br>
>
fastdebug/support/native/jdk.jdwp.agent/libjdwp/linker_md.o]
Error
1<br>
> gmake[2]: *** [jdk.jdwp.agent-libs] Error 1<br>
> gmake[2]: *** Waiting for unfinished jobs....<br>
> <br>
> ERROR: Build failed for target 'images' in configuration
'linux-<br>
> x86_64-server-fastdebug' (exit code 2) <br>
> <br>
> <br>
> <br>
> On 8/13/19 09:28, Adam Farley8 wrote:</span></tt>
<br>
<tt><span>> Hi Serguei, Daniel, <br>
> <br>
> My testing was limited to the bug specific test case I
mentioned,
<br>
> and the following jdwp tests: <br>
> <br>
> test/jdk/com/sun/jdi/Jdwp*<br>
> test/hotspot/jtreg/serviceability/jdwp <br>
> <br>
> Best Regards<br>
> <br>
> Adam Farley <br>
> IBM Runtimes<br>
> <br>
> <br>
> <a class="moz-txt-link-rfc2396E" \
href="mailto:serguei.spitsyn@oracle.com">"serguei.spitsyn@oracle.com"</a>
<a class="moz-txt-link-rfc2396E" \
href="mailto:serguei.spitsyn@oracle.com"><serguei.spitsyn@oracle.com></a> \
wrote on <br> > 13/08/2019 17:04:43:<br>
> <br>
> > From: <a class="moz-txt-link-rfc2396E" \
href="mailto:serguei.spitsyn@oracle.com">"serguei.spitsyn@oracle.com"</a>
<a class="moz-txt-link-rfc2396E" \
href="mailto:serguei.spitsyn@oracle.com"><serguei.spitsyn@oracle.com></a> <br>
> > To: <a class="moz-txt-link-abbreviated" \
href="mailto:daniel.daugherty@oracle.com">daniel.daugherty@oracle.com</a>, Adam \
Farley8 <br>
> > <a class="moz-txt-link-rfc2396E" \
href="mailto:adam.farley@uk.ibm.com"><adam.farley@uk.ibm.com></a>, Chris \
Plummer
<a class="moz-txt-link-rfc2396E" \
href="mailto:chris.plummer@oracle.com"><chris.plummer@oracle.com></a> <br>
> > Cc: <a class="moz-txt-link-abbreviated" \
href="mailto:serviceability-dev@openjdk.java.net">serviceability-dev@openjdk.java.net</a> \
<br> > > Date: 13/08/2019 17:08 <br>
> > Subject: Re: RFR: 8229378: jdwp library loader in
linker_md.c
<br>
> > quietly truncates on buffer overflow <br>
> > <br>
> > Hi Adam,<br>
> > <br>
> > I'm looking at your fix.<br>
> > Also interested about your testing.<br>
> > <br>
> > Thanks,<br>
> > Serguei<br>
> > <br>
> > On 8/13/19 08:48, Daniel D. Daugherty wrote: <br>
> > I don't see any information about how this change
was tested...<br>
> > Is there something on another email thread?<br>
> > <br>
> > Dan<br>
> > <br>
> <br>
> > On 8/13/19 11:41 AM, Adam Farley8 wrote: <br>
> > Hi Chris, <br>
> > <br>
> > Thanks! <br>
> > <br>
> > I understand we need a second reviewer/sponsor to
get this change
<br>
> > in. Any volunteers?<br>
> > <br>
> > Best Regards<br>
> > <br>
> > Adam Farley <br>
> > IBM Runtimes<br>
> > <br>
> > <br>
> > Chris Plummer <a class="moz-txt-link-rfc2396E" \
href="mailto:chris.plummer@oracle.com"><chris.plummer@oracle.com></a> wrote on \
12/08/2019 21:35:06:<br>
> > <br>
> > > From: Chris Plummer
<a class="moz-txt-link-rfc2396E" \
href="mailto:chris.plummer@oracle.com"><chris.plummer@oracle.com></a> <br> \
> > > To: Adam Farley8
<a class="moz-txt-link-rfc2396E" \
href="mailto:adam.farley@uk.ibm.com"><adam.farley@uk.ibm.com></a>, \
serviceability-<br>
> > <a class="moz-txt-link-abbreviated" \
href="mailto:dev@openjdk.java.net">dev@openjdk.java.net</a> <br> > > > \
Date: 12/08/2019 21:35 <br> > > > Subject: Re: RFR: 8229378: jdwp library \
loader in linker_md.c
<br>
> > > quietly truncates on buffer overflow <br>
> > > <br>
> > > Hi Adam,<br>
> > > <br>
> > > It looks good to me.<br>
> > > <br>
> > > thanks,<br>
> > > <br>
> > > Chris<br>
> > > <br>
> > > On 8/12/19 7:34 AM, Adam Farley8 wrote: <br>
> > > Hi All, <br>
> > > <br>
> > > This is a known bug, mentioned in a code
comment. <br>
> > > <br>
> > > Here is the fix for that bug. <br>
> > > <br>
> > > Reviewers and sponsors requested. <br>
> > > <br>
> > > Short version: if you set sun.boot.library.path
to <br>
> > > something beyond a system's max path length,
the <br>
> > > current code will return an empty string
(rather than <br>
> > > printing a useful error message and shutting
down). <br>
> > > <br>
> > > This is also a problem if you've specified
multiple <br>
> > > paths with a separator, as this code seems to
wrongly <br>
> > > assess whether the *total* length exceeds max
path <br>
> > > length. So two 200 char paths on windows will
cause <br>
> > > failure, as the total length is 400 (which is
beyond <br>
> > > max length for windows). <br>
> > > <br>
> > > Note that the os.cpp bit of the webrev will not
be included
<br>
> > > in the final webrev, it just makes this change
trivially
<br>
> > > testable. <br>
> > > <br>
> > > Bug: </span></tt><a
href="https://bugs.openjdk.java.net/browse/JDK-8229378"
moz-do-not-send="true"><tt><span>https://bugs.openjdk.java.net/browse/JDK-8229378</span></tt></a><tt><span>
<br>
> > > Webrev: </span></tt><a
href="http://cr.openjdk.java.net/~afarley/8229378/webrev/"
moz-do-not-send="true"><tt><span>http://cr.openjdk.java.net/~afarley/8229378/webrev/</span></tt></a><tt><span>
<br>
> > > <br>
> > > <br>
> > > Best Regards<br>
> > > <br>
> > > Adam Farley <br>
> > > IBM Runtimes<br>
> > > <br>
> > > Unless stated otherwise above:<br>
> > > IBM United Kingdom Limited - Registered in
England and Wales
with <br>
> > > number 741598. <br>
> > > Registered office: PO Box 41, North Harbour,
Portsmouth,
Hampshire PO6 3AU<br>
> > Unless stated otherwise above:<br>
> > IBM United Kingdom Limited - Registered in England
and Wales
with <br>
> > number 741598. <br>
> > Registered office: PO Box 41, North Harbour,
Portsmouth, Hampshire
PO6 3AU<br>
> Unless stated otherwise above:<br>
> IBM United Kingdom Limited - Registered in England and
Wales with
<br>
> number 741598. <br>
> Registered office: PO Box 41, North Harbour, Portsmouth,
Hampshire
PO6 3AU</span></tt><span><br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales
with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth,
Hampshire PO6
3AU<br>
</span>
</blockquote>
<br>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic