Bug 823625 - cifs: fix handling of scopeid in cifs_convert_address
cifs: fix handling of scopeid in cifs_convert_address
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
6.4
All Linux
unspecified Severity medium
: rc
: ---
Assigned To: Sachin Prabhu
Jian Li
:
Depends On:
Blocks: 798385
  Show dependency treegraph
 
Reported: 2012-05-21 14:00 EDT by Sachin Prabhu
Modified: 2014-03-03 19:08 EST (History)
5 users (show)

See Also:
Fixed In Version: kernel-2.6.32-298.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 00:56:34 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sachin Prabhu 2012-05-21 14:00:20 EDT
Fix handling of scopeid in cifs_convert_address


Backport of the following upstream patches
--
commit 9616125611ee47693186533d76e403856a36b3c8
Author: Jeff Layton <jlayton@redhat.com>
Date:   Wed Feb 16 09:34:16 2011 -0500

cifs: fix handling of scopeid in cifs_convert_address

The code finds, the '%' sign in an ipv6 address and copies that to a
buffer allocated on the stack. It then ignores that buffer, and passes
'pct' to simple_strtoul(), which doesn't work right because we're
comparing 'endp' against a completely different string.

Fix it by passing the correct pointer. While we're at it, this is a
good candidate for conversion to strict_strtoul as well.

Cc: stable@kernel.org
Cc: David Howells <dhowells@redhat.com>
Reported-by: Björn JACKE <bj@sernet.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
--

--
commit 2545e0720a5a4bf8ebccc6f793f97a246cf3f18d
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Thu Mar 1 10:06:52 2012 +0300

cifs: writing past end of struct in cifs_convert_address()

"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>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
--
Comment 1 RHEL Product and Program Management 2012-07-10 04:00:22 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 2 RHEL Product and Program Management 2012-07-10 19:43:05 EDT
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.
Comment 4 RHEL Product and Program Management 2012-07-27 12:21:27 EDT
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Product
Management has requested further review of this request by
Red Hat Engineering, for potential inclusion in a Red Hat
Enterprise Linux release for currently deployed products.
This request is not yet committed for inclusion in a release.
Comment 6 Jarod Wilson 2012-08-16 17:22:00 EDT
Patch(es) available on kernel-2.6.32-298.el6
Comment 9 Jian Li 2013-02-04 05:11:09 EST
This bug is verified!

#reproducer
[root@ibm-x3550m3-06 ~]# mount.cifs //::1/public /mnt/test -o user=root,password=hongmao,ip=::1%5 -vvv
ip address ::1%5 override specified
mount.cifs kernel mount options: ip=::1%5,unc=\\::1\public,,ver=1,user=root,pass=********
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[root@ibm-x3550m3-06 ~]# dmesg
fs/cifs/cifsfs.c: Devname: //::1/public/ flags: 0 
fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 1 with uid: 0
fs/cifs/connect.c: Username: root
fs/cifs/connect.c: UNC: \\::1\public ip: ::1%5
fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 1) rc = -22
CIFS VFS: cifs_mount failed w/return code = -22

#verifying
[root@ibm-x3550m3-06 ~]# mount.cifs //::1/public /mnt/test -o user=root,password=hongmao,ip=::1%5 -vvv
ip address ::1%5 override specified
mount.cifs kernel mount options: ip=::1%5,unc=\\::1\public,,ver=1,user=root,pass=********
[root@ibm-x3550m3-06 ~]# grep "/mnt/test" /proc/mounts
//::1/public/ /mnt/test cifs rw,relatime,sec=ntlm,cache=loose,unc=\\::1\public,username=root,uid=0,noforceuid,gid=0,noforcegid,addr=0000:0000:0000:0000:0000:0000:0000:0001%5,unix,posixpaths,serverino,acl,rsize=16384,wsize=65536,actimeo=1 0 0
[root@ibm-x3550m3-06 ~]# uname -a
Linux ibm-x3550m3-06.rhts.eng.nay.redhat.com 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
Comment 11 errata-xmlrpc 2013-02-21 00:56:34 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0496.html

Note You need to log in before you can comment on or make changes to this bug.