Km fixes#10357
Open
sameehj wants to merge 3 commits intowolfSSL:masterfrom
Open
Conversation
cryptodev_process must return 0 once crypto_done() has fired; errors are reported via crp_etype, otherwise the framework may re-dispatch an already-completed request. Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
…to avoid size_t underflow The backward-copy branches compute (n - 1) as size_t, which wraps to SIZE_MAX for n == 0 and, with src below dest, drives the loop backward through kernel memory until it oopses; matches glibc / musl / kernel memmove(). Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
… find_get_pid() in wc_linuxkm_fpu_state_assoc_unlikely(). find_get_pid() returns a struct pid * with the refcount bumped via get_pid(); callers must release it with put_pid(). The probe here is purely a liveness check on the slot's previous owner, and the returned pointer was discarded -- leaking one struct pid reference every time the unlikely contested-slot path was hit with a still-live owner. Capture the pointer and put_pid() it on the live-owner branch; behavior on the orphaned-slot branch is unchanged. Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
Contributor
Author
|
retest this please |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10357
Scan targets checked: bsdkm-bugs, bsdkm-src, linuxkm-bugs, linuxkm-src
No new issues found in the changed files. ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three minimal, independent fixes in the wolfSSL kernel ports:
bsdkm/wolfkmod.c—wolfkdriv_process()now returns0aftercrypto_done(), peropencrypto(9). Errors continue to be reported viacrp->crp_etype. Returning the operation error after completion could cause the framework to re-dispatch an already-completed request.linuxkm/linuxkm_wc_port.h—my_memmove()early-returns whenn == 0. The backward-copy branches compute(n - 1)assize_t, wrapping toSIZE_MAXforn == 0; withsrc < destthe loop walks backward through kernel memory and oopses. Reachable underCONFIG_FORTIFY_SOURCEfrom ASN.1/PKCS/TLS parsers viaXMEMMOVE. Matches glibc, musl, and the kernel's ownmemmove().linuxkm/x86_vector_register_glue.c— Plug astruct pidrefcount leak inwc_linuxkm_fpu_state_assoc_unlikely():find_get_pid()bumps the refcount; the live-owner branch now releases it withput_pid(). Orphaned-slot branch unchanged.Combined diff: 3 files, 11 insertions, 2 deletions.
Testing
bsdkmandlinuxkmmodules build and load;wolfcrypt/testpasses.my_memmove(dst, src, 0)is now a no-op (was an oops with low/NULLsrc).struct pidrefcount growth under repeated contested-slot stress (previously monotonic).Checklist