From: Chris Leech <cleech@redhat.com>
To: Lin Ma <linma@zju.edu.cn>
Cc: njavali@marvell.com, mrangankar@marvell.com,
GR-QLogic-Storage-Upstream@marvell.com, jejb@linux.ibm.com,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] scsi: qla4xxx: Add length check when paring nlattrs
Date: Tue, 25 Jul 2023 10:28:12 -0700 [thread overview]
Message-ID: <ZMAGLLkaNMpy7jXS@rhel-developer-toolbox-latest> (raw)
In-Reply-To: <20230723080053.3714534-1-linma@zju.edu.cn>
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@redhat.com>
next prev parent reply other threads:[~2023-07-25 17:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-23 8:00 [PATCH v1] scsi: qla4xxx: Add length check when paring nlattrs Lin Ma
2023-07-25 17:28 ` Chris Leech [this message]
2023-07-26 1:56 ` Martin K. Petersen
2023-07-31 19:45 ` 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=ZMAGLLkaNMpy7jXS@rhel-developer-toolbox-latest \
--to=cleech@redhat.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=jejb@linux.ibm.com \
--cc=linma@zju.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mrangankar@marvell.com \
--cc=njavali@marvell.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