Skip to content

scsi: target: fix CHAP_N handling

David Disseldorp linux-scsi target-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2scsi: target: add extract_param_str() helperdrivers/target/iscsi/iscsi_target_nego.c drivers/target/iscsi/iscsi_target_nego.h+38 -01 reply
2/2scsi: target: fix auth when CHAP_N carries a hex/b64 prefixdrivers/target/iscsi/iscsi_target_auth.c+2 -61 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJohn GarryLee Duncan
SeriesR-b
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] scsi: target: fix CHAP_N handling

The sashiko bot pointed out issues with CHAP_N handling recently, when reviewing a patch for a separate issue:
https://sashiko.dev/#/patchset/20260521151121.808477-1-hossu.alexandru%40gmail.com
Since extract_param() unconditionally strips '0x' or '0b' prefixes and alters the returned type, wouldn't a valid user with a name like '0xalice' or '0bob' have their username mutated to 'alice' or 'ob'?

I believe this behaviour is contrary to the iSCSI spec. I added some simple libiscsi tests to cover prefix stripping:
https://github.com/sahlberg/libiscsi/pull/472

These patches attempt to fix CHAP_N handling.

----------------------------------------------------------------
David Disseldorp (2):
scsi: target: add extract_param_str() helper
scsi: target: fix auth when CHAP_N carries a hex/b64 prefix

 drivers/target/iscsi/iscsi_target_auth.c |  8 ++---
 drivers/target/iscsi/iscsi_target_nego.c | 37 ++++++++++++++++++++++++
 drivers/target/iscsi/iscsi_target_nego.h |  1 +
 3 files changed, 40 insertions(+), 6 deletions(-)