8198372: API to create a SelectableChannel to a FileDescriptor

David Lloyd david.lloyd at redhat.com
Wed Jun 20 13:48:14 UTC 2018


On Wed, Jun 20, 2018 at 8:41 AM Alan Bateman <Alan.Bateman at oracle.com> wrote:
> > I disagree with these security checks.  Nothing in this API allows the
> > caller to actually read or write the FD; that would have to be
> > provided separately.  Given that each of the checks are relatively
> > expensive, IMO they should be deferred to the point where an object is
> > constructed that actually has read and/or write capability.
> A permission check is needed here. The two permission targets that
> RuntimePermission specifies for file descriptors are readFileDescriptor
> and writeFileDescriptor, it hardly seems worth introducing new targets
> to poll a file descriptor for reading and writing. Or maybe you are
> suggesting an alternative permission check?

Why is the permission check needed?  I believe that there is no
material sensitive information that can be gleaned from the
readability or writability of a file descriptor.

-- 
- DML


More information about the nio-dev mailing list