From: Dan Carpenter <dan.carpenter@oracle.com>
To: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>,
support@lsi.com, DL-MPTFusionLinux@lsi.com,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] [SCSI] mpt fusion: declare some sizes as unsigned
Date: Fri, 01 Nov 2013 10:24:10 +0000 [thread overview]
Message-ID: <20131101102410.GD29795@longonot.mountain> (raw)
In mptctl_do_mpt_command() we cap the upper bound of .maxSenseBytes but
we don't check for negative values:
if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE)
I've fixed this by making the type unsigned and I changed the
surrounding types to match as well.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/message/fusion/mptctl.h b/drivers/message/fusion/mptctl.h
index d564cc9..9ea5a18 100644
--- a/drivers/message/fusion/mptctl.h
+++ b/drivers/message/fusion/mptctl.h
@@ -324,11 +324,11 @@ struct mpt_ioctl_command {
char __user *dataInBufPtr;
char __user *dataOutBufPtr;
char __user *senseDataPtr;
- int maxReplyBytes;
- int dataInSize;
- int dataOutSize;
- int maxSenseBytes;
- int dataSgeOffset;
+ u32 maxReplyBytes;
+ u32 dataInSize;
+ u32 dataOutSize;
+ u32 maxSenseBytes;
+ u32 dataSgeOffset;
char MF[1];
};
@@ -343,11 +343,11 @@ struct mpt_ioctl_command32 {
u32 dataInBufPtr;
u32 dataOutBufPtr;
u32 senseDataPtr;
- int maxReplyBytes;
- int dataInSize;
- int dataOutSize;
- int maxSenseBytes;
- int dataSgeOffset;
+ u32 maxReplyBytes;
+ u32 dataInSize;
+ u32 dataOutSize;
+ u32 maxSenseBytes;
+ u32 dataSgeOffset;
char MF[1];
};
#endif /*}*/
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>,
support@lsi.com, DL-MPTFusionLinux@lsi.com,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] [SCSI] mpt fusion: declare some sizes as unsigned
Date: Fri, 1 Nov 2013 13:24:10 +0300 [thread overview]
Message-ID: <20131101102410.GD29795@longonot.mountain> (raw)
In mptctl_do_mpt_command() we cap the upper bound of .maxSenseBytes but
we don't check for negative values:
if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE)
I've fixed this by making the type unsigned and I changed the
surrounding types to match as well.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/message/fusion/mptctl.h b/drivers/message/fusion/mptctl.h
index d564cc9..9ea5a18 100644
--- a/drivers/message/fusion/mptctl.h
+++ b/drivers/message/fusion/mptctl.h
@@ -324,11 +324,11 @@ struct mpt_ioctl_command {
char __user *dataInBufPtr;
char __user *dataOutBufPtr;
char __user *senseDataPtr;
- int maxReplyBytes;
- int dataInSize;
- int dataOutSize;
- int maxSenseBytes;
- int dataSgeOffset;
+ u32 maxReplyBytes;
+ u32 dataInSize;
+ u32 dataOutSize;
+ u32 maxSenseBytes;
+ u32 dataSgeOffset;
char MF[1];
};
@@ -343,11 +343,11 @@ struct mpt_ioctl_command32 {
u32 dataInBufPtr;
u32 dataOutBufPtr;
u32 senseDataPtr;
- int maxReplyBytes;
- int dataInSize;
- int dataOutSize;
- int maxSenseBytes;
- int dataSgeOffset;
+ u32 maxReplyBytes;
+ u32 dataInSize;
+ u32 dataOutSize;
+ u32 maxSenseBytes;
+ u32 dataSgeOffset;
char MF[1];
};
#endif /*}*/
next reply other threads:[~2013-11-01 10:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-01 10:24 Dan Carpenter [this message]
2013-11-01 10:24 ` [patch] [SCSI] mpt fusion: declare some sizes as unsigned Dan Carpenter
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=20131101102410.GD29795@longonot.mountain \
--to=dan.carpenter@oracle.com \
--cc=DL-MPTFusionLinux@lsi.com \
--cc=Nagalakshmi.Nandigama@lsi.com \
--cc=Sreekanth.Reddy@lsi.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=support@lsi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.