CVE-2024-50086 is a use-after-free vulnerability in the Linux kernel's ksmbd component related to SMB2 session log off. The flaw arises from a race condition between SMB2 session log off and session setup, which can lead to a use-after-free condition on the session structure. The issue has been addressed by adding a session lock and reference counting to prevent freeing the session while it is in use.