<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/cifs, branch v3.2.58</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/cifs?h=v3.2.58</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/cifs?h=v3.2.58'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-04-09T01:20:46Z</updated>
<entry>
<title>cifs: ensure that uncached writes handle unmapped areas correctly</title>
<updated>2014-04-09T01:20:46Z</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2014-02-14T12:20:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b1a292f3ccbbfe864cb4931e8fed4baea6b17eb8'/>
<id>urn:sha1:b1a292f3ccbbfe864cb4931e8fed4baea6b17eb8</id>
<content type='text'>
commit 5d81de8e8667da7135d3a32a964087c0faf5483f upstream.

It's possible for userland to pass down an iovec via writev() that has a
bogus user pointer in it. If that happens and we're doing an uncached
write, then we can end up getting less bytes than we expect from the
call to iov_iter_copy_from_user. This is CVE-2014-0069

cifs_iovec_write isn't set up to handle that situation however. It'll
blindly keep chugging through the page array and not filling those pages
with anything useful. Worse yet, we'll later end up with a negative
number in wdata-&gt;tailsz, which will confuse the sending routines and
cause an oops at the very least.

Fix this by having the copy phase of cifs_iovec_write stop copying data
in this situation and send the last write as a short one. At the same
time, we want to avoid sending a zero-length write to the server, so
break out of the loop and set rc to -EFAULT if that happens. This also
allows us to handle the case where no address in the iovec is valid.

[Note: Marking this for stable on v3.4+ kernels, but kernels as old as
       v2.6.38 may have a similar problem and may need similar fix]

Reviewed-by: Pavel Shilovsky &lt;piastry@etersoft.ru&gt;
Reported-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
[bwh: Backported to 3.2:
 - Adjust context
 - s/nr_pages/npages/
 - s/wdata-&gt;pages/pages/
 - In case of an error with no data copied, we must kunmap() page 0,
   but in neither case should we free anything else]
 Thanks to Raphael Geissert for an independent backport that showed some
 bugs in my first version.]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>cifs: set MAY_SIGN when sec=krb5</title>
<updated>2014-04-01T23:59:01Z</updated>
<author>
<name>Martijn de Gouw</name>
<email>martijn.de.gouw@prodrive.nl</email>
</author>
<published>2012-10-24T09:45:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9924c0fa968bb6104a99b7b7961a6c188fed9b31'/>
<id>urn:sha1:9924c0fa968bb6104a99b7b7961a6c188fed9b31</id>
<content type='text'>
commit 0b7bc84000d71f3647ca33ab1bf5bd928535c846 upstream.

Setting this secFlg allows usage of dfs where some servers require
signing and others don't.

Signed-off-by: Martijn de Gouw &lt;martijn.de.gouw@prodrive.nl&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;sfrench@us.ibm.com&gt;
[Joseph Salisbury: This backport was done so including mainline commit
8830d7e07a5e38bc47650a7554b7c1cfd49902bf is not needed.]
BugLink: http://bugs.launchpad.net/bugs/1285723
Signed-off-by: Joseph Salisbury &lt;joseph.salisbury@canonical.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>setfacl removes part of ACL when setting POSIX ACLs to Samba</title>
<updated>2014-01-03T04:33:22Z</updated>
<author>
<name>Steve French</name>
<email>smfrench@gmail.com</email>
</author>
<published>2013-11-16T02:41:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=baf48b7f96f5cd7f8b510dba67bcbdf96df296ff'/>
<id>urn:sha1:baf48b7f96f5cd7f8b510dba67bcbdf96df296ff</id>
<content type='text'>
commit b1d93356427be6f050dc55c86eb019d173700af6 upstream.

setfacl over cifs mounts can remove the default ACL when setting the
(non-default part of) the ACL and vice versa (we were leaving at 0
rather than setting to -1 the count field for the unaffected
half of the ACL.  For example notice the setfacl removed
the default ACL in this sequence:

steven@steven-GA-970A-DS3:~/cifs-2.6$ getfacl /mnt/test-dir ; setfacl
-m default:user:test:rwx,user:test:rwx /mnt/test-dir
getfacl: Removing leading '/' from absolute path names
user::rwx
group::r-x
other::r-x
default:user::rwx
default:user:test:rwx
default:group::r-x
default:mask::rwx
default:other::r-x

steven@steven-GA-970A-DS3:~/cifs-2.6$ getfacl /mnt/test-dir
getfacl: Removing leading '/' from absolute path names
user::rwx
user:test:rwx
group::r-x
mask::rwx
other::r-x

Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Acked-by: Jeremy Allison &lt;jra@samba.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>cifs: don't instantiate new dentries in readdir for inodes that need to be revalidated immediately</title>
<updated>2013-09-10T00:57:20Z</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2013-08-07T14:29:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=eb4a22ba43d91d58a35bc4fce11d8e6065bb4e1d'/>
<id>urn:sha1:eb4a22ba43d91d58a35bc4fce11d8e6065bb4e1d</id>
<content type='text'>
commit 757c4f6260febff982276818bb946df89c1105aa upstream.

David reported that commit c2b93e06 (cifs: only set ops for inodes in
I_NEW state) caused a regression with mfsymlinks. Prior to that patch,
if a mfsymlink dentry was instantiated at readdir time, the inode would
get a new set of ops when it was revalidated. After that patch, this
did not occur.

This patch addresses this by simply skipping instantiating dentries in
the readdir codepath when we know that they will need to be immediately
revalidated. The next attempt to use that dentry will cause a new lookup
to occur (which is basically what we want to happen anyway).

Cc: "Stefan (metze) Metzmacher" &lt;metze@samba.org&gt;
Cc: Sachin Prabhu &lt;sprabhu@redhat.com&gt;
Reported-and-Tested-by: David McBride &lt;dwm37@cam.ac.uk&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
[bwh: Backported to 3.2: need to return NULL]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>cifs: extend the buffer length enought for sprintf() using</title>
<updated>2013-09-10T00:57:18Z</updated>
<author>
<name>Chen Gang</name>
<email>gang.chen@asianux.com</email>
</author>
<published>2013-07-19T01:01:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1cd4b1b1558ca2227047c17dc6f61d07f8406e2f'/>
<id>urn:sha1:1cd4b1b1558ca2227047c17dc6f61d07f8406e2f</id>
<content type='text'>
commit 057d6332b24a4497c55a761c83c823eed9e3f23b upstream.

For cifs_set_cifscreds() in "fs/cifs/connect.c", 'desc' buffer length
is 'CIFSCREDS_DESC_SIZE' (56 is less than 256), and 'ses-&gt;domainName'
length may be "255 + '\0'".

The related sprintf() may cause memory overflow, so need extend related
buffer enough to hold all things.

It is also necessary to be sure of 'ses-&gt;domainName' must be less than
256, and define the related macro instead of hard code number '256'.

Signed-off-by: Chen Gang &lt;gang.chen@asianux.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Shirish Pargaonkar &lt;shirishpargaonkar@gmail.com&gt;
Reviewed-by: Scott Lovenberg &lt;scott.lovenberg@gmail.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
[bwh: Backported to 3.2:
 - Adjust context in sess.c
 - Drop inapplicable changes to connect.c]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Handle big endianness in NTLM (ntlmv2) authentication</title>
<updated>2013-07-27T04:34:20Z</updated>
<author>
<name>Steve French</name>
<email>smfrench@us.ibm.com</email>
</author>
<published>2013-06-25T19:03:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0922d9a16733658dd91a1aa9e543d9e03a4f3aa2'/>
<id>urn:sha1:0922d9a16733658dd91a1aa9e543d9e03a4f3aa2</id>
<content type='text'>
commit fdf96a907c1fbb93c633e2b7ede3b8df26d6a4c0 upstream.

This is RH bug 970891
Uppercasing of username during calculation of ntlmv2 hash fails
because UniStrupr function does not handle big endian wchars.

Also fix a comment in the same code to reflect its correct usage.

[To make it easier for stable (rather than require 2nd patch) fixed
this patch of Shirish's to remove endian warning generated
by sparse -- steve f.]

Reported-by: steve &lt;sanpatr1@in.ibm.com&gt;
Signed-off-by: Shirish Pargaonkar &lt;shirishpargaonkar@gmail.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
[bwh: Backported to 3.2: adjust context, indentation]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>cifs: fix potential buffer overrun when composing a new options string</title>
<updated>2013-06-19T01:16:39Z</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2013-05-24T11:40:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4a762b7f53a5e6bd6f6568b904ffcf2fd1811ef5'/>
<id>urn:sha1:4a762b7f53a5e6bd6f6568b904ffcf2fd1811ef5</id>
<content type='text'>
commit 166faf21bd14bc5c5295a44874bf7f3930c30b20 upstream.

Consider the case where we have a very short ip= string in the original
mount options, and when we chase a referral we end up with a very long
IPv6 address. Be sure to allow for that possibility when estimating the
size of the string to allocate.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;sfrench@us.ibm.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>cifs: only set ops for inodes in I_NEW state</title>
<updated>2013-05-30T13:34:55Z</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2013-05-07T15:28:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8ac645ff787751eb2d5a80abd7338a4fb838c3a0'/>
<id>urn:sha1:8ac645ff787751eb2d5a80abd7338a4fb838c3a0</id>
<content type='text'>
commit c2b93e0699723700f886ce17bb65ffd771195a6d upstream.

It's generally not safe to reset the inode ops once they've been set. In
the case where the inode was originally thought to be a directory and
then later found to be a DFS referral, this can lead to an oops when we
try to trigger an inode op on it after changing the ops to the blank
referral operations.

Reported-and-Tested-by: Sachin Prabhu &lt;sprabhu@redhat.com&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>cifs: ignore everything in SPNEGO blob after mechTypes</title>
<updated>2013-03-27T02:41:21Z</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2013-03-11T13:52:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bbb8c22360473df0d982181a0cf69780ad2b10d1'/>
<id>urn:sha1:bbb8c22360473df0d982181a0cf69780ad2b10d1</id>
<content type='text'>
commit f853c616883a8de966873a1dab283f1369e275a1 upstream.

We've had several reports of people attempting to mount Windows 8 shares
and getting failures with a return code of -EINVAL. The default sec=
mode changed recently to sec=ntlmssp. With that, we expect and parse a
SPNEGO blob from the server in the NEGOTIATE reply.

The current decode_negTokenInit function first parses all of the
mechTypes and then tries to parse the rest of the negTokenInit reply.
The parser however currently expects a mechListMIC or nothing to follow the
mechTypes, but Windows 8 puts a mechToken field there instead to carry
some info for the new NegoEx stuff.

In practice, we don't do anything with the fields after the mechTypes
anyway so I don't see any real benefit in continuing to parse them.
This patch just has the kernel ignore the fields after the mechTypes.
We'll probably need to reinstate some of this if we ever want to support
NegoEx.

Reported-by: Jason Burgess &lt;jason@jacknife2.dns2go.com&gt;
Reported-by: Yan Li &lt;elliot.li.tech@gmail.com&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;sfrench@us.ibm.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>cifs: delay super block destruction until all cifsFileInfo objects are gone</title>
<updated>2013-03-27T02:41:13Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mguzik@redhat.com</email>
</author>
<published>2013-03-08T15:30:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=53bd21b81773db2526f59a60fcb1d069380ca011'/>
<id>urn:sha1:53bd21b81773db2526f59a60fcb1d069380ca011</id>
<content type='text'>
commit 24261fc23db950951760d00c188ba63cc756b932 upstream.

cifsFileInfo objects hold references to dentries and it is possible that
these will still be around in workqueues when VFS decides to kill super
block during unmount.

This results in panics like this one:
BUG: Dentry ffff88001f5e76c0{i=66b4a,n=1M-2} still in use (1) [unmount of cifs cifs]
------------[ cut here ]------------
kernel BUG at fs/dcache.c:943!
[..]
Process umount (pid: 1781, threadinfo ffff88003d6e8000, task ffff880035eeaec0)
[..]
Call Trace:
 [&lt;ffffffff811b44f3&gt;] shrink_dcache_for_umount+0x33/0x60
 [&lt;ffffffff8119f7fc&gt;] generic_shutdown_super+0x2c/0xe0
 [&lt;ffffffff8119f946&gt;] kill_anon_super+0x16/0x30
 [&lt;ffffffffa036623a&gt;] cifs_kill_sb+0x1a/0x30 [cifs]
 [&lt;ffffffff8119fcc7&gt;] deactivate_locked_super+0x57/0x80
 [&lt;ffffffff811a085e&gt;] deactivate_super+0x4e/0x70
 [&lt;ffffffff811bb417&gt;] mntput_no_expire+0xd7/0x130
 [&lt;ffffffff811bc30c&gt;] sys_umount+0x9c/0x3c0
 [&lt;ffffffff81657c19&gt;] system_call_fastpath+0x16/0x1b

Fix this by making each cifsFileInfo object hold a reference to cifs
super block, which implicitly keeps VFS super block around as well.

Signed-off-by: Mateusz Guzik &lt;mguzik@redhat.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reported-and-Tested-by: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: Steve French &lt;sfrench@us.ibm.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
</feed>
