[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZMAF1+P3blgBZ+/m@rhel-developer-toolbox-latest>
Date: Tue, 25 Jul 2023 10:26:47 -0700
From: Chris Leech <cleech@...hat.com>
To: Lin Ma <linma@....edu.cn>
Cc: lduncan@...e.com, michael.christie@...cle.com, jejb@...ux.ibm.com,
martin.petersen@...cle.com, vikas.chaudhary@...gic.com,
JBottomley@...allels.com, mchan@...adcom.com, benli@...adcom.com,
ogerlitz@...taire.com, open-iscsi@...glegroups.com,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/2] scsi: iscsi: Add strlen check in
iscsi_if_set_{host}_param
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@...hat.com>
Powered by blists - more mailing lists