[foreign] RFR: add missing Lookup parameters on bind/bindRaw

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue May 15 12:46:38 UTC 2018


Addressed all comments; the new test is checking public/private/null 
lookup axis.

http://cr.openjdk.java.net/~mcimadamore/panama/lookup-bind-v4/

Maurizio


On 15/05/18 13:26, Sundararajan Athijegannathan wrote:
> inline responses..
>
>
> On 15/05/18, 5:42 PM, Maurizio Cimadamore wrote:
>>
>>
>> On 15/05/18 13:09, Sundararajan Athijegannathan wrote:
>>> * checkLookup():
>>>
>>>     could add explicit null check by 
>>> Objects.requireNonNull(lookup).hasPrivateAccess()
>> ok - I also realized that checkLookup is missing from 
>> Libraries.loadLibrary!!
>>>
>>> * BindTest is meant to be a security test (always runs with security 
>>> manager with explicit policy -- and tests except security 
>>> exception). I'm not sure we want to switch ff that
>> Well, my interpretation of BinderTest is that it checks as to whether 
>> the binding can take place; there are a bunch of reasons as that 
>> should not be the case; one of those is the SecurityManager, but this 
>> patch introduces another one, which is lookup object not being 
>> private. There are also checks on null values.
>
> BindTest along with the other tests in that dir are meant to be 
> security tests ('security' is the name of dir).
>>
>> Are you suggesting we should have a separate test for each of these 
>> axis? What would be the added value in doing so?
>>
> Private lookup / public lookup check should be done regardless of 
> security manager - a separate test would be good.
>
> -Sundar
>> Maurizio
>>>
>>> -Sundar
>>>
>>> On 15/05/18, 5:23 PM, Maurizio Cimadamore wrote:
>>>>
>>>>
>>>> On 15/05/18 12:50, Maurizio Cimadamore wrote:
>>>>> Hi,
>>>>> as per yesterday cleanup, the Libraries API now takes a 
>>>>> MethodHandles.Lookup that is used to perform caller-sensitive 
>>>>> native library searches. The methods bind/bindRaw (the versions 
>>>>> _not_ accepting an explicit Library object) should also get same 
>>>>> treatment. Moreover, there should be a check for filtering out 
>>>>> non-private lookup objects.
>>>>>
>>>>> I've updated few tests to add missing lookup object parameter, and 
>>>>> also added a new variant of BindTest which checks for 
>>>>> IllegalArgumentException in case a bad lookup object (a public 
>>>>> one) is supplied.
>>>>>
>>>>> Webrev:
>>>>>
>>>>> http://cr.openjdk.java.net/~mcimadamore/panama/cleanup-v2/
>>>> Wrong link
>>>>
>>>> here's the correct one:
>>>>
>>>> http://cr.openjdk.java.net/~mcimadamore/panama/lookup-bind-v2/
>>>>
>>>> Maurizio
>>>>>
>>>>> Cheers
>>>>> Maurizio
>>>>>
>>>>
>>



More information about the panama-dev mailing list