| Summary: | CAM/CTL ioctl frontend fails to validate initiator ID | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Hans Rosenfeld <rosenfeld> |
| Component: | kern | Assignee: | John Baldwin <jhb> |
| Status: | Closed FIXED | ||
| Severity: | Affects Some People | CC: | asomers, jhb, markj, mav |
| Priority: | --- | ||
| Version: | 16.0-CURRENT | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Hans Rosenfeld
2025-11-17 14:01:23 UTC
I believe that the validation belongs in ctl_ioctl_io. The other fields such as LUN IDs are validated inside of ctl.c already. I've posted a possible patch at https://reviews.freebsd.org/D56628 A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=6f8312bdff236ad64d1c15c239051359d8245a68 commit 6f8312bdff236ad64d1c15c239051359d8245a68 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2026-05-02 16:43:29 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2026-05-02 16:43:29 +0000 ctl_ioctl_frontend: Reject out-of-range initiator IDs Various places in CTL assume that initiator IDs are not larger than CTL_MAX_INIT_PER_PORT. Other IDs such as lun IDs are validated in places such as ctl_scsiio_precheck, but initiator IDs submitted by userland were not previously validated. PR: 291059 Reported by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D56628 sys/cam/ctl/ctl_frontend_ioctl.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a40ffc719d0401260fdcaf1bd88dfab17eb52aa8 commit a40ffc719d0401260fdcaf1bd88dfab17eb52aa8 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2026-05-02 16:43:29 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2026-06-23 16:06:11 +0000 ctl_ioctl_frontend: Reject out-of-range initiator IDs Various places in CTL assume that initiator IDs are not larger than CTL_MAX_INIT_PER_PORT. Other IDs such as lun IDs are validated in places such as ctl_scsiio_precheck, but initiator IDs submitted by userland were not previously validated. PR: 291059 Reported by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D56628 (cherry picked from commit 6f8312bdff236ad64d1c15c239051359d8245a68) sys/cam/ctl/ctl_frontend_ioctl.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d9df9b4d2aff2643e79903feae640b3575afb201 commit d9df9b4d2aff2643e79903feae640b3575afb201 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2026-05-02 16:43:29 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2026-06-23 16:06:19 +0000 ctl_ioctl_frontend: Reject out-of-range initiator IDs Various places in CTL assume that initiator IDs are not larger than CTL_MAX_INIT_PER_PORT. Other IDs such as lun IDs are validated in places such as ctl_scsiio_precheck, but initiator IDs submitted by userland were not previously validated. PR: 291059 Reported by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D56628 (cherry picked from commit 6f8312bdff236ad64d1c15c239051359d8245a68) sys/cam/ctl/ctl_frontend_ioctl.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) |