HADOOP-19930. ObjectWritable to validate class on load - #8640
steveloughran merged 4 commits into
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
conflict in TFile to resolve |
New reflection validation in ReflectionUtils -Pulls up class type checking to before actual class load; fails fast -Add check of array length. -Limit recursive depth to 100. +Sequence file logic. Conf loading does force classloading, so move sequence file logic out of it. This does remove it from the conf file weak hash map of classes, but the jvm does its own class map here. The real feature of the conf map is the caching of cache misses, which would actually surface as errors on reading files, so you aren't saving anything performance-wise. Contains content generated by Claude.ai Contributed by Steve Loughran.
df7fca6 to
0cbe6cf
Compare
|
💔 -1 overall
This message was automatically generated. |
ajfabbri
left a comment
There was a problem hiding this comment.
LGTM pending removal of unrelated change. Other comments are just nits.
| update: | ||
| name: "Update Build Status" | ||
| runs-on: ubuntu-slim | ||
| if: github.repository == 'apache/hadoop' |
| in.readFully(bytes, 0, length); | ||
| return Text.decode(bytes); | ||
| } | ||
|
|
There was a problem hiding this comment.
nit: superfluous whitespace change
| public void testDeepNestingRejected() throws Exception { | ||
| DataOutputBuffer out = new DataOutputBuffer(); | ||
| String arrayClass = Object[].class.getName(); | ||
| for (int i = 0; i < 110; i++) { // each level: an Object[] of length 1 |
There was a problem hiding this comment.
Not a blocking comment, but a constant for 100 depth limit and using it here (X + 10) would be clearer to future generations.
There was a problem hiding this comment.
there is a constant; made package private and referenced it
|
💔 -1 overall
This message was automatically generated. |
|
I'm doing the merge with the approval. The build/test is failing in the debian java 25 setup now I've merged in trunk, which I'm going to assert is unrelated. Bad, needs fixing, but unrelated. |
New reflection validation in ReflectionUtils -Pulls up class type checking to before actual class load; fails fast -Add check of array length. -Limit recursive depth to 100. This is used in SequenceFile, InputSplits and elsewhere that Writable subclasses instantiate classes. Contributed by Steve Loughran Assisted-by: Claude.ai "This is Ripley, last survivor of the Nostromo, signing off." 9589683f-369f-4a30-8c93-e9f5d04ceb5a
Validate class instantiation through ObjectWritable and elsewhere to make sure
the class is of the requested type before the class is instantiated
New reflection validation in ReflectionUtils
-Pulls up class type checking to before actual class load; fails fast -Add check of array length.
-Limit recursive depth to 100.
This is #8569 on a new branch to get yetus to pick it up
Contains content generated by Claude.ai
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?AI Tooling
If an AI tool was used:
where is the name of the AI tool used.
https://www.apache.org/legal/generative-tooling.html