RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v3]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Jun 2 20:59:25 UTC 2021


On Wed, 2 Jun 2021 18:40:48 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with 10 additional commits since the last revision:
>> 
>>  - Update test/jdk/java/foreign/TestIntrinsics.java
>>    
>>    Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>>  - Update test/jdk/java/foreign/valist/VaListTest.java
>>    
>>    Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>>  - Update test/jdk/java/foreign/TestVarArgs.java
>>    
>>    Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>>  - Update test/jdk/java/foreign/TestUpcall.java
>>    
>>    Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>>  - Update test/jdk/java/foreign/TestIllegalLink.java
>>    
>>    Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>>  - Update test/jdk/java/foreign/TestSymbolLookup.java
>>    
>>    Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>>  - Update test/jdk/java/foreign/TestDowncall.java
>>    
>>    Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>>  - Update test/jdk/java/foreign/StdLibTest.java
>>    
>>    Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>>  - Update test/jdk/java/foreign/SafeFunctionAccessTest.java
>>    
>>    Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>>  - Update src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/SharedUtils.java
>>    
>>    Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>
> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java line 138:
> 
>> 136:      * <p>
>> 137:      * This method is <a href="package-summary.html#restricted"><em>restricted</em></a>.
>> 138:      * Restricted method are unsafe, and, if used incorrectly, their use might crash
> 
> Suggestion:
> 
>      * Restricted methods are unsafe, and, if used incorrectly, their use might crash

Ouch - this seems like an issue with _all_ restricted methods.

> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java line 160:
> 
>> 158:      * to allocate structs returned by-value.
>> 159:      *
>> 160:      * @see SymbolLookup
> 
> For JDK code it is more common for `@See` to occur after the parameters/return/throws, and before any `@Since`.

I'll fix

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

PR: https://git.openjdk.java.net/jdk/pull/4316



More information about the security-dev mailing list