[PATCH 0/2] Fix Memory Management Issue in `ssh-sk-helper` with External SK Libraries

Xavier Hsinyuan me at lstlx.com
Sun Dec 22 05:15:30 AEDT 2024


Hi,

Sometimes, users might find that  the `ssh-sk-helper` crashes after
enrolling a new key when using external SK libraries.

Currently, the memory returned by SK APIs is freed by the host, but
external libraries may have their own methods of handling memory. For
instance some external libraries are linked against a foreign libc
statically. As a result, the `ssh-sk-helper` would have issues if it
tries to free memory allocated by external libraries.

To resolve this problem, here are two patches:
    1 - A patch introduces new APIs to free memory allocated by 
    external libraries, helping to prevent unexpected memory-related
    behavior when using external SK libraries.
    2 - A patch adopts new APIs for bundled `sk-usbhid` and `sk-dummy`.

Thank you for your time and feedback.

Best regards,
Xavier Hsinyuan

------

Xavier Hsinyuan (2):
  Introduce new SK APIs for freeing memory
  Adopt new SecurityKey API for sk-usbhid and sk-dummy

 regress/misc/sk-dummy/sk-dummy.c | 35 +++++++++++++-
 sk-api.h                         | 11 ++++-
 sk-usbhid.c                      | 55 +++++++++++++++++++++
 ssh-sk.c                         | 83 ++++++++++++++------------------
 4 files changed, 136 insertions(+), 48 deletions(-)

-- 
2.39.5



More information about the openssh-unix-dev mailing list