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

nvme: avoid segfault in check-tls-key due to null subsysnqn/hostnqn #2168

Closed

Commits on Dec 22, 2023

  1. nvme: avoid segfault in check-tls-key due to null subsysnqn/hostnqn

    Running nvme check-tls-key hits a segfault as seen below:
    
    nvme check-tls-key
    -d NVMeTLSkey-1:01:bB7soUnpHfxVg53sCY21KY3nLbqLit2RcIO8Rbdf3mKhcKaM:
    Segmentation fault (core dumped)
    
    This is because the strlen check on subsysnqn & hostnqn crashes in
    libnvme's nvme_identity_len() at src/nvme/linux.c due to them being
    null. Both subsysnqn and hostnqn are mandatory for generating a PSK
    identity or inserting the retained key, which is what this command
    attempts to do. So to avoid this segfault, ensure both the subsysnqn
    and hostnqn are properly updated in check_tls_key() of nvme-cli's
    nvme.c before proceeding ahead.
    
    Signed-off-by: Martin George <[email protected]>
    martin-gpy committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    1a9a6c8 View commit details
    Browse the repository at this point in the history