From: James Smart <James.Smart@Emulex.Com>
To: Anton Blanchard <anton@samba.org>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] Fix lpfc oops when parsing dodgy VPD
Date: Thu, 22 Mar 2007 13:13:29 -0400 [thread overview]
Message-ID: <4602B939.3050509@emulex.com> (raw)
In-Reply-To: <20070321134147.GA7119@kryten>
ACK.
To my knowledge bad VPD data had only been found on early prototypes, as they
avoided the typical "manufacturing process". Regardless, we do try to be
preventative about this type of thing, just in case.
Thanks
-- james s
Anton Blanchard wrote:
> We have seen two cases where VPD on an emulex card has been incorrect
> and we end up walking off the end of memory. It looks like someone made
> an update (increased the length of a string) without increasing the
> Length field. Then we do:
>
> Length -= (3+i);
>
> And since Length is unsigned it becomes very large and we loop forever
> in the encapsulating:
>
> while (Length > 0) {
>
> If we make Length signed then we fall out of the loop and proceed on.
>
> Its important to note we have only seen this in the lab and it may be
> the only two cases of this in existence, but since the rest of the code
> has been written to be resilient against bad VPD we may as well fix this
> too.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: kernel/drivers/scsi/lpfc/lpfc_init.c
> ===================================================================
> --- kernel.orig/drivers/scsi/lpfc/lpfc_init.c 2007-02-07 17:02:43.000000000 -0600
> +++ kernel/drivers/scsi/lpfc/lpfc_init.c 2007-02-07 17:23:31.000000000 -0600
> @@ -662,7 +662,7 @@
> lpfc_parse_vpd(struct lpfc_hba * phba, uint8_t * vpd, int len)
> {
> uint8_t lenlo, lenhi;
> - uint32_t Length;
> + int Length;
> int i, j;
> int finished = 0;
> int index = 0;
>
prev parent reply other threads:[~2007-03-22 17:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-21 13:41 [PATCH] Fix lpfc oops when parsing dodgy VPD Anton Blanchard
2007-03-22 17:13 ` James Smart [this message]
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=4602B939.3050509@emulex.com \
--to=james.smart@emulex.com \
--cc=anton@samba.org \
--cc=linux-scsi@vger.kernel.org \
/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