Skip to content

YARN: restrict leveldb conf store log deserialization to known types#8612

Open
nishat-06 wants to merge 1 commit into
apache:trunkfrom
nishat-06:leveldb-conf-store-deser-allowlist
Open

YARN: restrict leveldb conf store log deserialization to known types#8612
nishat-06 wants to merge 1 commit into
apache:trunkfrom
nishat-06:leveldb-conf-store-deser-allowlist

Conversation

@nishat-06

Copy link
Copy Markdown

Description of PR

LeveldbConfigurationStore.deserLogMutations reads the capacity scheduler configuration log back with a bare ObjectInputStream, so whatever sits under the leveldb log key decides which Serializable types the RM constructs during recovery. ZKConfigurationStore.deserializeObject already fences the identical LinkedList<LogMutation> graph behind a ValidatingObjectInputStream allowlist, and TestZKConfigurationStore.testDeserializationIsNotVulnerable pins that with a ysoserial payload, but the leveldb store never got either. This applies the same accept() list at the point the bytes are turned back into objects.

ConfigurationUpdateAssembler.constructKeyValueConfUpdate builds the updates map with new HashMap<>(), so LinkedList, LogMutation, HashMap and String cover a real configuration log and valid stores still load unchanged.

How was this patch tested?

Added testDeserializationIsNotVulnerable to TestLeveldbConfigurationStore, alongside the existing ZK one. It plants a list holding a type that is not part of a configuration log and asserts the read is rejected and the type is never constructed. Against the unpatched store the payload's readObject runs and no exception is raised; with the patch it fails with InvalidClassException.

mvn compile/test-compile and checkstyle:check are clean for both files on JDK 17. I could not execute the leveldb suite locally, leveldbjni ships no arm64 native and the existing tests in that class already fail the same way on this machine, so I am relying on CI for the run.

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

AI Tooling

If an AI tool was used:

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 20s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 26m 9s trunk passed
+1 💚 compile 0m 51s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 0m 52s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 48s trunk passed
+1 💚 mvnsite 0m 55s trunk passed
+1 💚 javadoc 0m 51s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 51s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 1m 33s trunk passed
+1 💚 shadedclient 16m 32s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 32s the patch passed
+1 💚 compile 0m 32s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 32s the patch passed
+1 💚 compile 0m 33s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 33s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 31s the patch passed
+1 💚 mvnsite 0m 37s the patch passed
+1 💚 javadoc 0m 26s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 28s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 1m 17s the patch passed
+1 💚 shadedclient 16m 7s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 91m 4s hadoop-yarn-server-resourcemanager in the patch passed.
+1 💚 asflicense 0m 24s The patch does not generate ASF License warnings.
162m 33s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8612/1/artifact/out/Dockerfile
GITHUB PR #8612
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 94e7ff816e85 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 7e34d54
Default Java Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.11+10-1-24.04.2-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8612/1/testReport/
Max. process+thread count 952 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8612/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants