Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect against bad inputs in EnergyUncertaintyElectronSpecific #26241

Merged

Conversation

Dr15Jones
Copy link
Contributor

PR description:

ASAN reported out of bounds reads in calls to member functions. We now report if an input value would result in bad array reads.
In addition, moved the arrays from the stack to a compile time created memory location.

PR validation:

Compiles locally. Converted old array assignments into static_assert to check that array order was properly preserved. Obtained array values mechanically via command line pipes of grep, awk, head and tail.

ASAN reported out of bounds reads in calls to member functions.
We now report if an input value would result in bad array reads.
In addition, moved the arrays from the stack to a compile time
created memory location.
@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-26241/8888

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @Dr15Jones (Chris Jones) for master.

It involves the following packages:

RecoEgamma/EgammaElectronAlgos

@cmsbuild, @perrotta, @slava77 can you please review it and eventually sign? Thanks.
@jainshilpi, @Sam-Harper, @varuns23, @lgray this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 24, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/33736/console Started: 2019/03/24 23:37

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-26241/33736/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 6 differences found in the comparisons
  • DQMHistoTests: Total files compared: 32
  • DQMHistoTests: Total histograms compared: 3114829
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3114631
  • DQMHistoTests: Total skipped: 197
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 31 files compared)
  • Checked 133 log files, 14 edm output root files, 32 DQM output files

0.0111448,
0.0146648}};

static_assert(par0[0][0] == 0.00567891f);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you plan to keep these asserts? (I imagine that they were there just to verify that numbers where migrated correctly...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are compile time checks so they have no effect at run time. I'm fine with keeping or with removing.

Copy link
Contributor

Choose a reason for hiding this comment

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

My only complain is aesthetic, at this point (therefore, not really relevant).
I pointed it out to you, and I'll let you decide. (I'd personally remove them, though)

-25.2897}};


static_assert(par0[0][3]==0.00596201f);
Copy link
Contributor

Choose a reason for hiding this comment

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

Also here...

@perrotta
Copy link
Contributor

+1

  • This PR adds protections against bad inputs, and it reports if an input value would result in bad array reads (with the intent to help debugging the real origin of it)
  • It addresses the issue stack buffer overflow in GsfElectronEcalDrivenProducer #26238, and no other effect is expected in unaffected reco outputs: jenkins tests pass and show no differences

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@fabiocos
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 6751a91 into cms-sw:master Mar 31, 2019
@smuzaffar
Copy link
Contributor

ping bot?

@Dr15Jones Dr15Jones deleted the fixEnergyUncertaintyElectronSpecific branch April 22, 2019 16:31
@slava77
Copy link
Contributor

slava77 commented May 24, 2019

resolves #26238

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.

None yet

6 participants