From: Dan Carpenter <dan.carpenter@oracle.com>
To: Steve French <sfrench@samba.org>, Jeff Layton <jlayton@redhat.com>
Cc: linux-cifs@vger.kernel.org, kernel-janitors@vger.kernel.org,
samba-technical@lists.samba.org
Subject: [patch] cifs: writing past end of struct in cifs_convert_address()
Date: Thu, 01 Mar 2012 07:06:52 +0000 [thread overview]
Message-ID: <20120301070652.GA6959@elgon.mountain> (raw)
"s6->sin6_scope_id" is an int bits but strict_strtoul() writes a long
so this can corrupt memory on 64 bit systems.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index 73e47e8..cab99b5 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -197,8 +197,7 @@ cifs_convert_address(struct sockaddr *dst, const char *src, int len)
memcpy(scope_id, pct + 1, slen);
scope_id[slen] = '\0';
- rc = strict_strtoul(scope_id, 0,
- (unsigned long *)&s6->sin6_scope_id);
+ rc = kstrtouint(scope_id, 0, &s6->sin6_scope_id);
rc = (rc = 0) ? 1 : 0;
}
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Steve French <sfrench@samba.org>, Jeff Layton <jlayton@redhat.com>
Cc: linux-cifs@vger.kernel.org, kernel-janitors@vger.kernel.org,
samba-technical@lists.samba.org
Subject: [patch] cifs: writing past end of struct in cifs_convert_address()
Date: Thu, 1 Mar 2012 10:06:52 +0300 [thread overview]
Message-ID: <20120301070652.GA6959@elgon.mountain> (raw)
"s6->sin6_scope_id" is an int bits but strict_strtoul() writes a long
so this can corrupt memory on 64 bit systems.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index 73e47e8..cab99b5 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -197,8 +197,7 @@ cifs_convert_address(struct sockaddr *dst, const char *src, int len)
memcpy(scope_id, pct + 1, slen);
scope_id[slen] = '\0';
- rc = strict_strtoul(scope_id, 0,
- (unsigned long *)&s6->sin6_scope_id);
+ rc = kstrtouint(scope_id, 0, &s6->sin6_scope_id);
rc = (rc == 0) ? 1 : 0;
}
next reply other threads:[~2012-03-01 7:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 7:06 Dan Carpenter [this message]
2012-03-01 7:06 ` [patch] cifs: writing past end of struct in cifs_convert_address() Dan Carpenter
[not found] ` <20120301070652.GA6959-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2012-03-01 11:47 ` Jeff Layton
2012-03-01 11:47 ` Jeff Layton
2012-03-29 19:57 ` Jeff Layton
2012-03-29 19:57 ` Jeff Layton
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=20120301070652.GA6959@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=jlayton@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.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 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.