From: Chris Leech <cleech@redhat.com>
To: Lin Ma <linma@zju.edu.cn>
Cc: lduncan@suse.com, michael.christie@oracle.com,
jejb@linux.ibm.com, martin.petersen@oracle.com,
vikas.chaudhary@qlogic.com, JBottomley@parallels.com,
mchan@broadcom.com, benli@broadcom.com, ogerlitz@voltaire.com,
open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/2] scsi: iscsi: Add strlen check in iscsi_if_set_{host}_param
Date: Tue, 25 Jul 2023 10:26:47 -0700 [thread overview]
Message-ID: <ZMAF1+P3blgBZ+/m@rhel-developer-toolbox-latest> (raw)
In-Reply-To: <20230725024545.428519-1-linma@zju.edu.cn>
On Tue, Jul 25, 2023 at 10:45:45AM +0800, Lin Ma wrote:
> The function iscsi_if_set_param and iscsi_if_set_host_param converts
> nlattr payload to type char* and then call C string handling functions
> like sscanf and kstrdup.
>
> char *data = (char*)ev + sizeof(*ev);
> ...
> sscanf(data, "%d", &value);
>
> However, since the nlattr is provided by the user-space program and
> the nlmsg skb is allocated with GFP_KERNEL instead of GFP_ZERO flag
> (see netlink_alloc_large_skb in netlink_sendmsg), the dirty data
> remained in the heap can cause OOB read for those string handling
> functions.
Reviewed-by: Chris Leech <cleech@redhat.com>
next prev parent reply other threads:[~2023-07-25 17:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 2:45 [PATCH v1 2/2] scsi: iscsi: Add strlen check in iscsi_if_set_{host}_param Lin Ma
2023-07-25 17:26 ` Chris Leech [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-07-23 7:58 Lin Ma
2023-07-26 1:56 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZMAF1+P3blgBZ+/m@rhel-developer-toolbox-latest \
--to=cleech@redhat.com \
--cc=JBottomley@parallels.com \
--cc=benli@broadcom.com \
--cc=jejb@linux.ibm.com \
--cc=lduncan@suse.com \
--cc=linma@zju.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mchan@broadcom.com \
--cc=michael.christie@oracle.com \
--cc=ogerlitz@voltaire.com \
--cc=open-iscsi@googlegroups.com \
--cc=vikas.chaudhary@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox