Skip to content

Commit

Permalink
Wrap a QatZipper() inside AccessController.doPrivileged().
Browse files Browse the repository at this point in the history
Signed-off-by: Mulugeta Mammo <[email protected]>
  • Loading branch information
mulugetam committed Jan 10, 2025
1 parent 7295dae commit 7b51b37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public class QatZipperFactory {
* @param pmode polling mode.
*/
public static QatZipper createInstance(Algorithm algorithm, int level, Mode mode, int retryCount, PollingMode pmode) {
return new QatZipper(algorithm, level, mode, retryCount, pmode);
return java.security.AccessController.doPrivileged(
(java.security.PrivilegedAction<QatZipper>) () -> new QatZipper(algorithm, level, mode, retryCount, pmode)
);
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/main/plugin-metadata/plugin-security.policy
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ grant codeBase "${codebase.zstd-jni}" {

grant codeBase "${codebase.qat-java}" {
permission java.lang.RuntimePermission "loadLibrary.*";
permission org.opensearch.secure_sm.ThreadPermission "modifyArbitraryThread";
};

0 comments on commit 7b51b37

Please sign in to comment.