Fixes about NULL pointer dereferences + oob read + UAF#103
Fixes about NULL pointer dereferences + oob read + UAF#103n4sm wants to merge 1 commit intocryptodev-linux:masterfrom
Conversation
| } | ||
|
|
||
| // we avoid overflows | ||
| if ((unsigned long) caop->auth_len > (unsigned long) (caop->auth_len + caop->auth_src)) { |
There was a problem hiding this comment.
trivial - please consider fixing the indentation
|
@cristian-stoica I think use after bug might be worth a CVE, what do you think ? I haven't developed a fully working exploit yet but I will once I get some time to work on it. |
|
Many CVEs are now noise or just theoretical. It becomes hard to see which ones deserve any concerns. If you have time to work on a PoC then it's worth having it patched. Regarding the PRs, I'm not following updates here daily. When you have cleaned the PR #103 I'll merge it. What I mean is to get rid of the fix-up commits so they disappear by squashing into the other relevant commits |
|
I do agree with you, I will come back to you with a working PoC. I will clean up the PR so you can merge it as soon as possible. Thank you for your support. |
|
@n4sm What I’m suggesting is that it’s worthwhile to apply a patch for cryptodev even if the vulnerability is only theoretical. I don’t believe a practical exploit is required to justify addressing the issue. When you have a moment, please squash the fixup patches into the original commits so we have a clean patch set. Thank you. |
|
@cristian-stoica I finished writing an exploit for it. You can find the PoC here: https://gist.github.com/n4sm/0fd2479e0c23e0fa2f192cd8fda45750. I'd say the exploit Sure, I will clean the patches, how about the other issue I submitted ? The race condition seems very difficult to patch and I couldn't find a clean way to do it. |
I fixed some bugs leading to DoS / privilege escalation including:
- A lot of different NULL pointer dereferences
- A divide by zero error in `cryptodev_get_dst_len`
- An out of bound read in `crypto_copy_hash_state`
- A double free in `release_user_pages` (which could lead to privilege escalation)
|
@n4sm Hey this is good news! |
|
@cristian-stoica I guess we need to treat them separately. My concern is that I couldn't come to a clean patch to address the UAF bug. But compared to the page-level UAF I exploited, this uaf is very tricky to exploit and might just be not suitable for a privilege escalation. Regarding the patch submission, now that I finished writing the PoC, do you want to take care of the CVE submission process by yourself? Btw, I wrote a small blogpost about the bug and the exploitation technique I used: https://nasm.re/posts/cryptodev-linux-vuln/ |
|
@n4sm Thanks for the update and for sharing the blog (quite a few posts you have there). Regarding the CVE: please go ahead with the submission on your side - I won't handle the disclosure. If you need project details for the form, let me know For the patches:
Ping me if you need anything specific |
I fixed some bugs leading to DoS including:
cryptodev_get_dst_lencrypto_copy_hash_stateIt will make
release_user_pagescallput_pageon already freed pages.