[
https://issues.apache.org/jira/browse/LUCENE-6238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Uwe Schindler updated LUCENE-6238:
----------------------------------
Attachment: LUCENE-6238-mmap.patch
Hi,
I tried to remove the "sun.misc" reflection in mmap, but it is still needed and
leads to SecurityException.
Nevertheless I did the following:
- removed the explicit check on the sun.misc.Cleaner class (which is unused,
because we don't care about the actual impl of the Cleaner class)
- I also added doPrivileged() to the static check. This allows better sceurity
check by those who want to restrict access.
In general we should open a separate issue and review the whole reflection in
Lucene's codebase and make it use AccessController. Because without
AccessController the code is run with security privileges of the caller, so
user has to allow access to sun.misc.* and other reflection stuff to his whole
libs (also untrusted stuff). With doPrivileged, he can simply allow reflection
access to lucene-core.jar.
This code uses Java 8 code, when backporting I will remove the method
references and do it with anonymous inner classes.
> minimize tests.policy
> ---------------------
>
> Key: LUCENE-6238
> URL: https://issues.apache.org/jira/browse/LUCENE-6238
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Fix For: Trunk, 5.1
>
> Attachments: LUCENE-6238-mmap.patch, LUCENE-6238.patch,
> LUCENE-6238.patch
>
>
> This is overly permissive:
> {noformat}
> // Basic permissions needed for Lucene to work:
> permission java.util.PropertyPermission "*", "read,write";
> permission java.lang.reflect.ReflectPermission "*";
> permission java.lang.RuntimePermission "*";
> {noformat}
> Because of various BS like unsafe-hacks (only mmap seems to do it properly),
> this means effectively you cannot use lucene with SM today, without allowing
> SM itself to just be disabled with reflection.
> This is easy to fix.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]