According to the documentation InvalidObjectException
"Indicates that one or more deserialized objects failed validation
 tests."

meaning that the severed connection should generate a different type of 
exception. InvalidObjectException should be reserved for the cases when 
the deserialized data violate the validation rules. But I can't say I 
am certain; when a CNFE can disappear in the process, anything might be 
possible ...

Anyway, if I can't catch the InvalidObjectException it will leave me 
with two options:

1. Just forget about the validation
2. Do the validation but live with the fact that even when the 
validation fails a potential attacker can get access to an instance 
with invalid fields (eg. using the finalizer trick)

-JB-

On Tue 16 Jul 2013 09:31:52 AM CEST, shanliang wrote:
> Jaroslav,
>
> I am not sure that it is a good idea to add simply
> InvalidObjectException into the catching list. I remember that we
> carefully analyzed and tested the catching list, in order to avoid
> no-needed call of "fetchOneNotif", and to avoid fetching on a dead
> connection. Look at
> javax.management.remote.rmi.RMIConnector$RMINotifClient.fetchNotifs,
> we carefully retrieve an original exception wrapped in a
> UnmarshalException, with different protocol to allow
> ClientNotifForwarder to do right catching.
>
> What I am afraid is that InvalidObjectException would be thrown with
> other situations, like the connection was cut in the middle way of
> fetching, then the fix would make ClientNotifForwarder fail to stop
> fetching.
>
> Shanliang
>
> Jaroslav Bachorik wrote:
>> Please, review the change.
>>
>> http://cr.openjdk.java.net/~jbachorik/8019584/webrev.00/
>>
>> The combination of the fix for JDK-8014085 and
>> ObjectInputStream.readFields() not throwing CNFE when trying to
>> deserialize an object graph containing references to non-available
>> classes makes an InvalidObjectException being thrown instead of the CNFE
>> when processing JMX notifications.
>>
>> The patch makes the ClientNotificationForwarder ready for
>> InvalidObjectException - it will correctly report lost notifications but
>> will not cause the notification processing loop to fail with unhandled
>> exception.
>>
>> Thanks,
>>
>> -JB-
>>
>


Reply via email to