[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20131202190337.114999994@linuxfoundation.org>
Date: Mon, 2 Dec 2013 11:06:12 -0800
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Ursula Braun <ursula.braun@...ibm.com>,
Frank Blaschka <frank.blaschka@...ibm.com>,
Heiko Carstens <heicars2@...ux.vnet.ibm.com>,
Nico Golde <nico@...lde.de>, Fabian Yamaguchi <fabs@...sec.de>,
"David S. Miller" <davem@...emloft.net>
Subject: [PATCH 3.4 31/60] qeth: avoid buffer overflow in snmp ioctl
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ursula Braun <ursula.braun@...ibm.com>
commit 6fb392b1a63ae36c31f62bc3fc8630b49d602b62 upstream.
Check user-defined length in snmp ioctl request and allow request
only if it fits into a qeth command buffer.
Signed-off-by: Ursula Braun <ursula.braun@...ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@...ibm.com>
Reviewed-by: Heiko Carstens <heicars2@...ux.vnet.ibm.com>
Reported-by: Nico Golde <nico@...lde.de>
Reported-by: Fabian Yamaguchi <fabs@...sec.de>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/s390/net/qeth_core_main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -4357,7 +4357,7 @@ int qeth_snmp_command(struct qeth_card *
struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd;
struct qeth_snmp_ureq *ureq;
- int req_len;
+ unsigned int req_len;
struct qeth_arp_query_info qinfo = {0, };
int rc = 0;
@@ -4373,6 +4373,10 @@ int qeth_snmp_command(struct qeth_card *
/* skip 4 bytes (data_len struct member) to get req_len */
if (copy_from_user(&req_len, udata + sizeof(int), sizeof(int)))
return -EFAULT;
+ if (req_len > (QETH_BUFSIZE - IPA_PDU_HEADER_SIZE -
+ sizeof(struct qeth_ipacmd_hdr) -
+ sizeof(struct qeth_ipacmd_setadpparms_hdr)))
+ return -EINVAL;
ureq = memdup_user(udata, req_len + sizeof(struct qeth_snmp_ureq_hdr));
if (IS_ERR(ureq)) {
QETH_CARD_TEXT(card, 2, "snmpnome");
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists