Home
last modified time | relevance | path

Searched hist:43514774 (Results 1 – 3 of 3) sorted by relevance

/openbmc/linux/include/scsi/
H A Discsi_if.h43514774 Mon Jun 08 20:14:41 CDT 2009 Michael Chan <mchan@broadcom.com> [SCSI] iscsi class: Add new NETLINK_ISCSI messages for cnic/bnx2i driver.

Add ISCSI_NETLINK messages for iSCSI NICs to get information such as
path from userspace. Original iscsid messages are now always sent as
multicast to group 1. The new messages are sent to group 2.

The multicast changes were made by Mike Christie.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
43514774 Mon Jun 08 20:14:41 CDT 2009 Michael Chan <mchan@broadcom.com> [SCSI] iscsi class: Add new NETLINK_ISCSI messages for cnic/bnx2i driver.

Add ISCSI_NETLINK messages for iSCSI NICs to get information such as
path from userspace. Original iscsid messages are now always sent as
multicast to group 1. The new messages are sent to group 2.

The multicast changes were made by Mike Christie.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
H A Dscsi_transport_iscsi.h43514774 Mon Jun 08 20:14:41 CDT 2009 Michael Chan <mchan@broadcom.com> [SCSI] iscsi class: Add new NETLINK_ISCSI messages for cnic/bnx2i driver.

Add ISCSI_NETLINK messages for iSCSI NICs to get information such as
path from userspace. Original iscsid messages are now always sent as
multicast to group 1. The new messages are sent to group 2.

The multicast changes were made by Mike Christie.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
43514774 Mon Jun 08 20:14:41 CDT 2009 Michael Chan <mchan@broadcom.com> [SCSI] iscsi class: Add new NETLINK_ISCSI messages for cnic/bnx2i driver.

Add ISCSI_NETLINK messages for iSCSI NICs to get information such as
path from userspace. Original iscsid messages are now always sent as
multicast to group 1. The new messages are sent to group 2.

The multicast changes were made by Mike Christie.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/openbmc/linux/drivers/scsi/
H A Dscsi_transport_iscsi.c971dfcb7 Mon Jul 24 21:45:29 CDT 2023 Lin Ma <linma@zju.edu.cn> scsi: iscsi: Add length check for nlattr payload

The current NETLINK_ISCSI netlink parsing loop checks every nlmsg to make
sure the length is bigger than sizeof(struct iscsi_uevent) and then calls
iscsi_if_recv_msg().

nlh = nlmsg_hdr(skb);
if (nlh->nlmsg_len < sizeof(*nlh) + sizeof(*ev) ||
skb->len < nlh->nlmsg_len) {
break;
}
...
err = iscsi_if_recv_msg(skb, nlh, &group);

Hence, in iscsi_if_recv_msg() the nlmsg_data can be safely converted to
iscsi_uevent as the length is already checked.

However, in other cases the length of nlattr payload is not checked before
the payload is converted to other data structures. One example is
iscsi_set_path() which converts the payload to type iscsi_path without any
checks:

params = (struct iscsi_path *)((char *)ev + sizeof(*ev));

Whereas iscsi_if_transport_conn() correctly checks the pdu_len:

pdu_len = nlh->nlmsg_len - sizeof(*nlh) - sizeof(*ev);
if ((ev->u.send_pdu.hdr_size > pdu_len) ..
err = -EINVAL;

To sum up, some code paths called in iscsi_if_recv_msg() do not check the
length of the data (see below picture) and directly convert the data to
another data structure. This could result in an out-of-bound reads and heap
dirty data leakage.

_________ nlmsg_len(nlh) _______________
/ \
+----------+--------------+---------------------------+
| nlmsghdr | iscsi_uevent | data |
+----------+--------------+---------------------------+
\ /
iscsi_uevent->u.set_param.len

Fix the issue by adding the length check before accessing it. To clean up
the code, an additional parameter named rlen is added. The rlen is
calculated at the beginning of iscsi_if_recv_msg() which avoids duplicated
calculation.

Fixes: ac20c7bf070d ("[SCSI] iscsi_transport: Added Ping support")
Fixes: 43514774ff40 ("[SCSI] iscsi class: Add new NETLINK_ISCSI messages for cnic/bnx2i driver.")
Fixes: 1d9bf13a9cf9 ("[SCSI] iscsi class: add iscsi host set param event")
Fixes: 01cb225dad8d ("[SCSI] iscsi: add target discvery event to transport class")
Fixes: 264faaaa1254 ("[SCSI] iscsi: add transport end point callbacks")
Fixes: fd7255f51a13 ("[SCSI] iscsi: add sysfs attrs for uspace sync up")
Signed-off-by: Lin Ma <linma@zju.edu.cn>
Link: https://lore.kernel.org/r/20230725024529.428311-1-linma@zju.edu.cn
Reviewed-by: Chris Leech <cleech@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
43514774 Mon Jun 08 20:14:41 CDT 2009 Michael Chan <mchan@broadcom.com> [SCSI] iscsi class: Add new NETLINK_ISCSI messages for cnic/bnx2i driver.

Add ISCSI_NETLINK messages for iSCSI NICs to get information such as
path from userspace. Original iscsid messages are now always sent as
multicast to group 1. The new messages are sent to group 2.

The multicast changes were made by Mike Christie.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
43514774 Mon Jun 08 20:14:41 CDT 2009 Michael Chan <mchan@broadcom.com> [SCSI] iscsi class: Add new NETLINK_ISCSI messages for cnic/bnx2i driver.

Add ISCSI_NETLINK messages for iSCSI NICs to get information such as
path from userspace. Original iscsid messages are now always sent as
multicast to group 1. The new messages are sent to group 2.

The multicast changes were made by Mike Christie.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>