Skip to content

valgrind: replace suppression for EVP_DecryptFinal_ex - #52491

Merged
idryomov merged 2 commits into
ceph:mainfrom
cbodley:wip-61566
Jul 20, 2023
Merged

idryomov merged 2 commits into
ceph:mainfrom
cbodley:wip-61566

Conversation

@cbodley

@cbodley cbodley commented Jul 17, 2023

Copy link
Copy Markdown
Contributor

valgrind report shows the same issue coming from:

==85443==    by 0x5612594: EVP_DecryptFinal_ex (evp_enc.c:926)
==85443==    by 0x4F68C5C: ceph::crypto::onwire::AES128GCM_OnWireRxHandler::authenticated_decrypt_update_final(ceph::buffer::v15_2_0::list&) (crypto_onwire.cc:261)
==85443==    by 0x4F705A3: ceph::msgr::v2::FrameAssembler::disassemble_preamble(ceph::buffer::v15_2_0::list&) (frames_v2.cc:290)
==85443==    by 0x4F542D9: ProtocolV2::handle_read_frame_preamble_main(std::unique_ptr<ceph::buffer::v15_2_0::ptr_node, ceph::buffer::v15_2_0::ptr_node::disposer>&&, int) (ProtocolV2.cc:1107)

because authenticated_decrypt_update_final() can be called from different places, omit its caller from the suppression

Fixes: https://tracker.ceph.com/issues/61566

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@cbodley
cbodley requested review from idryomov and rzarzynski July 17, 2023 17:26
@cbodley

cbodley commented Jul 17, 2023

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Jul 17, 2023

Copy link
Copy Markdown
Contributor Author

i'm seeing the same valgrind issue in local testing on fedora 38, and the suppression didn't quite match. adding --gen-suppressions gave a slightly different mangled name for authenticated_decrypt_update_final():

-  fun:_ZN4ceph6crypto6onwire25AES128GCM_OnWireRxHandler34authenticated_decrypt_update_finalEONS_6buffer7v*4listEj
+  fun:_ZN4ceph6crypto6onwire25AES128GCM_OnWireRxHandler34authenticated_decrypt_update_finalERNS_6buffer7v15_2_04listE

i added 2 new wildcards to match both forms, and verified with local testing that it correctly suppresses the issue

@cbodley cbodley added the tests label Jul 17, 2023
Comment thread qa/valgrind.supp Resolved
Comment thread qa/valgrind.supp Resolved
Comment thread qa/valgrind.supp Resolved

@rzarzynski rzarzynski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think there is generic problem with AES-NI and Valgrind:

https://gist.github.com/rzarzynski/234952b45c1cdad6f4dfb96cc2f164e6#root-cause-valgrind-ignores-a-dependency-breaking-idiom

at least it was on time when the suppression has been created but I wouldn't be surprised if we stuck to (too) old valgrind on some nodes.

I'm not sure we had the symbols for OpenSSL installed to make a rule based on gcm_ghash_avx. Likely (sorry, speaking from memory) not.

Generalizing suppression is always questionable. I would prefer to keep it as specific as possible.

@cbodley

cbodley commented Jul 19, 2023

Copy link
Copy Markdown
Contributor Author

@rzarzynski thanks for sharing the gist. i don't think that issue is showing up on recent releases/distros, because these suppressions haven't matched since the signature of authenticated_decrypt_update_final() changed in 2020 with fe97a00

https://tracker.ceph.com/issues/61566 reports this new valgrind issue against centos9:

==85443== Conditional jump or move depends on uninitialised value(s)
==85443==    at 0x5710F04: gcm_cipher_internal (ciphercommon_gcm.c:433)
==85443==    by 0x57111E1: UnknownInlinedFun (ciphercommon_gcm.c:335)
==85443==    by 0x57111E1: ossl_gcm_stream_final (ciphercommon_gcm.c:326)
==85443==    by 0x5612594: EVP_DecryptFinal_ex (evp_enc.c:926)
==85443==    by 0x4F68C5C: ceph::crypto::onwire::AES128GCM_OnWireRxHandler::authenticated_decrypt_update_final(ceph::buffer::v15_2_0::list&) (crypto_onwire.cc:261)

which looks just like openssl/openssl#19719 except for the UnknownInlinedFun line

i agree that supressions should be as specific as possible, but i don't think it should matter how ceph calls into EVP_DecryptFinal_ex. so i'd propose a single suppression that just has this:

  fun:gcm_cipher_internal
  ...
  fun:ossl_gcm_stream_final
  fun:EVP_DecryptFinal_ex

@cbodley

cbodley commented Jul 19, 2023

Copy link
Copy Markdown
Contributor Author

so i'd propose a single suppression that just has this: ...

i pushed a commit that adds that as a new suppression, and rescheduled the rbd reproducer against just that commit: https://pulpito.ceph.com/cbodley-2023-07-19_17:22:57-rbd-main-distro-default-smithi/

since this is blocking rbd testing on centos 9, i'd prefer to leave the existing suppressions alone for now

@rzarzynski

Copy link
Copy Markdown
Contributor

Thanks, @cbodley! I will be really glad if the new commit goes green. I'm fine with leaving existing ones, maybe with a little extra comment.

@idryomov

idryomov commented Jul 19, 2023 •

Copy link
Copy Markdown
Contributor

since this is blocking rbd testing on centos 9, i'd prefer to leave the existing suppressions alone for now

I'm not following -- we know for a fact that both of them are bogus since they are conditioned on authenticated_decrypt_update_final() signature from three (!) years ago. Assuming the test against just the new commit passes, why not remove them?

@cbodley

cbodley commented Jul 19, 2023

Copy link
Copy Markdown
Contributor Author

Assuming the test against just the new commit passes, why not remove them?

i'm happy to do that if we reach a consensus, i just want to avoid any delays

@idryomov

Copy link
Copy Markdown
Contributor

i pushed a commit that adds that as a new suppression, and rescheduled the rbd reproducer against just that commit: https://pulpito.ceph.com/cbodley-2023-07-19_17:22:57-rbd-main-distro-default-smithi/

The run LGTM!

Assuming the test against just the new commit passes, why not remove them?

i'm happy to do that if we reach a consensus, i just want to avoid any delays

@rzarzynski I think Casey wants your blessing to remove two existing suppressions (replacing them with the one under test).

@cbodley

cbodley commented Jul 20, 2023

Copy link
Copy Markdown
Contributor Author

@rzarzynski I think Casey wants your blessing to remove two existing suppressions (replacing them with the one under test).

i opened #52561 for this part so we can review/merge separately

@cbodley

cbodley commented Jul 20, 2023

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@cbodley

cbodley commented Jul 20, 2023

Copy link
Copy Markdown
Contributor Author

thanks for reviews. seems we're blocked on 'make check' anyway

@idryomov

Copy link
Copy Markdown
Contributor

thanks for reviews. seems we're blocked on 'make check' anyway

Yup, make check is blocked on https://tracker.ceph.com/issues/62082.

Since Radoslaw approved #52561, perhaps pull it into this PR so that the cleanup gets backported to reef too?

years ago in commit fe97a00, the
signature of authenticated_decrypt_update_final() changed and this
suppression no longer matches its mangled form:

-  fun:_ZN4ceph6crypto6onwire25AES128GCM_OnWireRxHandler34authenticated_decrypt_update_finalEONS_6buffer7v*4listEj
+  fun:_ZN4ceph6crypto6onwire25AES128GCM_OnWireRxHandler34authenticated_decrypt_update_finalERNS_6buffer7v15_2_04listE

the fact that we didn't notice must mean that we don't need the
suppressions anymore

Signed-off-by: Casey Bodley <[email protected]>
@cbodley cbodley changed the title valgrind: generalize suppression for EVP_DecryptFinal_ex valgrind: replace suppression for EVP_DecryptFinal_ex Jul 20, 2023
@cbodley

cbodley commented Jul 20, 2023

Copy link
Copy Markdown
Contributor Author

jenkins test make check

1 similar comment
@idryomov

Copy link
Copy Markdown
Contributor

jenkins test make check

@idryomov
idryomov merged commit a9d794f into ceph:main Jul 20, 2023
@cbodley
cbodley deleted the wip-61566 branch July 21, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants