[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZMAGLLkaNMpy7jXS@rhel-developer-toolbox-latest>
Date: Tue, 25 Jul 2023 10:28:12 -0700
From: Chris Leech <cleech@...hat.com>
To: Lin Ma <linma@....edu.cn>
Cc: njavali@...vell.com, mrangankar@...vell.com,
GR-QLogic-Storage-Upstream@...vell.com, jejb@...ux.ibm.com,
martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] scsi: qla4xxx: Add length check when paring nlattrs
On Sun, Jul 23, 2023 at 04:00:53PM +0800, Lin Ma wrote:
> There are three places that qla4xxx looply parses nlattrs
> * qla4xxx_set_chap_entry(...)
> * qla4xxx_iface_set_param(...)
> * qla4xxx_sysfs_ddb_set_param(...)
> and each of them directly converts the nlattr to specific pointer of
> structure without length checking. This could be dangerous as those
> attributes are not validated before and a malformed nlattr (e.g., length
> 0) could result in an OOB read that leaks heap dirty data.
>
> This patch adds the nla_len check before accessing the nlattr data and
> error return EINVAL if the length check fails.
Reviewed-by: Chris Leech <cleech@...hat.com>
Powered by blists - more mailing lists