mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Fries <David@Fries.net>
To: linux-kernel@vger.kernel.org
Cc: Evgeniy Polyakov <zbr@ioremap.net>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Kees Cook <keescook@chromium.org>
Subject: [PATCH 2/2] w1: avoid potential u16 overflow
Date: Sun,  9 Nov 2014 16:37:14 -0600	[thread overview]
Message-ID: <1415572634-12303-3-git-send-email-David@Fries.net> (raw)
In-Reply-To: <1415572634-12303-1-git-send-email-David@Fries.net>

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Fries <David@Fries.net>
---
 drivers/w1/w1_netlink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c
index dd96562..881597a 100644
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -598,7 +598,7 @@ static void w1_cn_callback(struct cn_msg *cn, struct netlink_skb_parms *nsp)
 	msg = (struct w1_netlink_msg *)(cn + 1);
 	if (node_count) {
 		int size;
-		u16 reply_size = sizeof(*cn) + cn->len + slave_len;
+		int reply_size = sizeof(*cn) + cn->len + slave_len;
 		if (cn->flags & W1_CN_BUNDLE) {
 			/* bundling duplicats some of the messages */
 			reply_size += 2 * cmd_count * (sizeof(struct cn_msg) +
-- 
1.7.10.4


  parent reply	other threads:[~2014-11-09 22:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-09 22:37 [PATHC 0/2] cn: w1: buffer size checks David Fries
2014-11-09 22:37 ` [PATCH 1/2] cn: verify msg->len before making callback David Fries
2014-11-09 22:37 ` David Fries [this message]
2014-11-10  0:12 ` [PATHC 0/2] cn: w1: buffer size checks Евгений Поляков
2014-11-11  2:19   ` David Fries
2014-11-11  2:19     ` [PATCH 1/2] cn: verify msg->len before making callback David Fries
2014-11-11  2:19     ` [PATCH 2/2] w1: avoid potential u16 overflow David Fries

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=1415572634-12303-3-git-send-email-David@Fries.net \
    --to=david@fries.net \
    --cc=dan.carpenter@oracle.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zbr@ioremap.net \
    /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

Powered by JetHome