Open
Conversation
When OpenSSL is built with the devcrypto engine, crypto operations are serviced via ioctl() calls on /dev/crypto. The pre-auth child inherits the open fd from the monitor but the seccomp filter only whitelists FIONREAD and TIOCGWINSZ, causing any cryptodev ioctl to trigger SIGSYS. The child is killed immediately after authentication succeeds, during the keystate transfer phase where it first attempts to perform a cipher or MAC operation through the devcrypto engine: ``` monitor_child_preauth: preauth child terminated by signal 31 ``` As this was tested on the Airoha AN7581 with Cortex-A53 cores, signal 31 on aarch64 is SIGSYS, confirming seccomp violation rather than a code defect. Add a BPF rule that allows ioctl commands with type byte 'c' (0x63), which is the ioctl type used by all cryptodev operations (CIOCGSESSION, CIOCCRYPT, CIOCFSESSION, etc.). The rule matches on the type byte rather than the exact ioctl command values because cryptodev is an out-of-tree kernel module and its header is not available at OpenSSH build time. The rule is gated on ALLOW_CRYPTODEV_IOCTL, defined by the build system only when libopenssl-devcrypto is enabled. Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
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.
📦 Package Details
Maintainer: @hnyman
Description:
When OpenSSL is built with the devcrypto engine, crypto operations are serviced via ioctl() calls on /dev/crypto.
The pre-auth child inherits the open fd from the monitor but the seccomp filter only whitelists FIONREAD and TIOCGWINSZ, causing any cryptodev ioctl to trigger SIGSYS.
The child is killed immediately after authentication succeeds, during the keystate transfer phase where it first attempts to perform a cipher or MAC operation through the devcrypto engine:
As this was tested on the Airoha AN7581 with Cortex-A53 cores, signal 31 on aarch64 is SIGSYS, confirming seccomp violation rather than a code defect.
Add a BPF rule that allows ioctl commands with type byte 'c' (0x63), which is the ioctl type used by all cryptodev operations (CIOCGSESSION, CIOCCRYPT, CIOCFSESSION, etc.).
The rule matches on the type byte rather than the exact ioctl command values because cryptodev is an out-of-tree kernel module and its header is not available at OpenSSH build time.
The rule is gated on ALLOW_CRYPTODEV_IOCTL, defined by the build system only when libopenssl-devcrypto is enabled.
🧪 Run Testing Details
✅ Formalities
If your PR contains a patch:
git am(e.g., subject line, commit description, etc.)
We must try to upstream patches to reduce maintenance burden.