Skip to content

Java: model remaining top-500 JDK APIs#11968

Merged
jcogs33 merged 26 commits into
github:mainfrom
jcogs33:jcogs33/model-more-top-jdk-apis-300-500
Mar 24, 2023
Merged

Java: model remaining top-500 JDK APIs#11968
jcogs33 merged 26 commits into
github:mainfrom
jcogs33:jcogs33/model-more-top-jdk-apis-300-500

Conversation

@jcogs33
Copy link
Copy Markdown
Contributor

@jcogs33 jcogs33 commented Jan 23, 2023

Description:

This PR adds missing MaD summary models for the remaining top-500 JDK APIs. (This PR models the last 300 APIs. The first 200 were reviewed and modeled in #11572 and #11779).

Consideration:

Please review the added models in detail for correctness, especially the following:

  • Should any of the java.lang.reflect models be summaries instead of neutral?
  • Should the model for java.util.ResourceBundle#getString(String) be different (or not modeled by MaD)? I wasn't able to get a working test case for this one, and I'm suspicious that my model is too simple, but am not sure how to properly model it.
  • Does the model for java.util.concurrent.atomic.AtomicReference#set(Object) look okay? It seems to be causing the removal of an alert in DCA for the java/unsafe-cert-trust query on the apache__geode DB, and I'm not entirely sure why.

Note: The new DCA alerts look mostly okay to me based on initial spot-checking. I'll do another DCA run if I end up changing models during review.

@jcogs33 jcogs33 marked this pull request as ready for review February 15, 2023 23:02
@jcogs33 jcogs33 requested a review from a team as a code owner February 15, 2023 23:02
Copy link
Copy Markdown
Contributor

@atorralba atorralba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job Jami! This must have been exhausting 😅

I added some comments below, let me know what you think.

Re: your questions.

Should any of the java.lang.reflect models be summaries instead of neutral?

Answered in my comments.

Should the model for java.util.ResourceBundle#getString(String) be different (or not modeled by MaD)? I wasn't able to get a working test case for this one, and I'm suspicious that my model is too simple, but am not sure how to properly model it.

It looks good (assuming the inaccuracy of getting a string with a different key than the one that tainted the map in the first place, otherwise we should move this outside of MaD indeed). Maybe your test needs to create a MapValue-tainted ResourceBundle so that getString can obtain it? Let me know if you need help in writing a test like that.

Does the model for java.util.concurrent.atomic.AtomicReference#set(Object) look okay? It seems to be causing the removal of an alert in DCA for the java/unsafe-cert-trust query on the apache__geode DB, and I'm not entirely sure why.

It looks correct. The only thing that comes to mind that could cause what you describe is field branch flow limit (you made a path one step too long, and it went beyond the threshold). Happy to pair to debug this if you need.

Comment thread java/ql/lib/ext/java.awt.model.yml Outdated
Comment thread java/ql/lib/ext/java.io.model.yml Outdated
Comment thread java/ql/lib/ext/java.io.model.yml Outdated
Comment thread java/ql/lib/ext/java.io.model.yml
Comment thread java/ql/lib/ext/java.lang.model.yml Outdated
Comment thread java/ql/lib/ext/java.sql.model.yml Outdated
Comment thread java/ql/lib/ext/java.text.model.yml Outdated
Comment thread java/ql/lib/ext/java.text.model.yml Outdated
Comment thread java/ql/lib/ext/java.lang.reflect.model.yml
Comment thread java/ql/lib/ext/java.util.concurrent.model.yml
@atorralba
Copy link
Copy Markdown
Contributor

Re: your questions about leaving things that could be sinks as neutral summaries. Right now, they're just neutral models, there's no distinction between summaries and sinks (actually, the latter don't even exist). So as long as we remember to remove them/specify they are neutral summaries when the time comes, they can stay.

@jcogs33 jcogs33 marked this pull request as draft March 20, 2023 15:42
@jcogs33 jcogs33 force-pushed the jcogs33/model-more-top-jdk-apis-300-500 branch 3 times, most recently from 05391e3 to 7a1b74b Compare March 20, 2023 18:45
@jcogs33 jcogs33 marked this pull request as ready for review March 20, 2023 18:54
@jcogs33 jcogs33 force-pushed the jcogs33/model-more-top-jdk-apis-300-500 branch from 5ed55d2 to 222e6f0 Compare March 23, 2023 22:02
@jcogs33 jcogs33 merged commit 49d5149 into github:main Mar 24, 2023
@jcogs33 jcogs33 deleted the jcogs33/model-more-top-jdk-apis-300-500 branch March 24, 2023 11:54
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