Skip to content

Commit 920103e

Browse files
mgorbovMikhail Gorbov
authored andcommitted
Spark 2.1.0 mapr 29106 (apache#150)
* [SPARK-20922][CORE] Add whitelist of classes that can be deserialized by the launcher. Blindly deserializing classes using Java serialization opens the code up to issues in other libraries, since just deserializing data from a stream may end up execution code (think readObject()). Since the launcher protocol is pretty self-contained, there's just a handful of classes it legitimately needs to deserialize, and they're in just two packages, so add a filter that throws errors if classes from any other package show up in the stream. This also maintains backwards compatibility (the updated launcher code can still communicate with the backend code in older Spark releases). Tested with new and existing unit tests. Author: Marcelo Vanzin <vanzin@cloudera.com> Closes apache#18166 from vanzin/SPARK-20922. (cherry picked from commit 8efc6e9) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com> (cherry picked from commit 772a9b9) * [SPARK-20922][CORE][HOTFIX] Don't use Java 8 lambdas in older branches. Author: Marcelo Vanzin <vanzin@cloudera.com> Closes apache#18178 from vanzin/SPARK-20922-hotfix. (cherry picked from commit 0b25a7d) (cherry picked from commit cf96fdd)
1 parent 52ec75f commit 920103e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

launcher/src/test/java/org/apache/spark/launcher/LauncherServerSuite.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,22 @@
1717

1818
package org.apache.spark.launcher;
1919

20+
import org.junit.Test;
21+
2022
import java.io.Closeable;
2123
import java.io.IOException;
2224
import java.io.ObjectInputStream;
2325
import java.net.InetAddress;
2426
import java.net.Socket;
25-
import java.net.SocketException;
2627
import java.util.Arrays;
2728
import java.util.List;
2829
import java.util.concurrent.BlockingQueue;
2930
import java.util.concurrent.LinkedBlockingQueue;
3031
import java.util.concurrent.Semaphore;
3132
import java.util.concurrent.TimeUnit;
3233

33-
import org.junit.Test;
34-
import static org.junit.Assert.*;
35-
3634
import static org.apache.spark.launcher.LauncherProtocol.*;
35+
import static org.junit.Assert.*;
3736

3837
public class LauncherServerSuite extends BaseSuite {
3938

0 commit comments

Comments
 (0)