<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs, branch v4.2.5</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>nfsd/blocklayout: accept any minlength</title>
<updated>2015-10-27T00:53:38+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2015-10-09T13:03:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0d6b6d7625050575f3fdc973cc0258ec04c9f401'/>
<id>0d6b6d7625050575f3fdc973cc0258ec04c9f401</id>
<content type='text'>
commit 8c3ad9cb7343dc5f61b8cf3cdbe1016c5e7c2c8b upstream.

Recent Linux clients have started to send GETLAYOUT requests with
minlength less than blocksize.

Servers aren't really allowed to impose this kind of restriction on
layouts; see RFC 5661 section 18.43.3 for details.

This has been observed to cause indefinite hangs on fsx runs on some
clients.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8c3ad9cb7343dc5f61b8cf3cdbe1016c5e7c2c8b upstream.

Recent Linux clients have started to send GETLAYOUT requests with
minlength less than blocksize.

Servers aren't really allowed to impose this kind of restriction on
layouts; see RFC 5661 section 18.43.3 for details.

This has been observed to cause indefinite hangs on fsx runs on some
clients.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: fix use after free iterating extrefs</title>
<updated>2015-10-27T00:53:38+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@fb.com</email>
</author>
<published>2015-10-13T18:06:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e5b73597da65ef419bc46f904d15a415af55776b'/>
<id>e5b73597da65ef419bc46f904d15a415af55776b</id>
<content type='text'>
commit dc6c5fb3b514221f2e9d21ee626a9d95d3418dff upstream.

The code for btrfs inode-resolve has never worked properly for
files with enough hard links to trigger extrefs.  It was trying to
get the leaf out of a path after freeing the path:

	btrfs_release_path(path);
	leaf = path-&gt;nodes[0];
	item_size = btrfs_item_size_nr(leaf, slot);

The fix here is to use the extent buffer we cloned just a little higher
up to avoid deadlocks caused by using the leaf in the path.

Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
cc: Mark Fasheh &lt;mfasheh@suse.de&gt;
Reviewed-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-by: Mark Fasheh &lt;mfasheh@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit dc6c5fb3b514221f2e9d21ee626a9d95d3418dff upstream.

The code for btrfs inode-resolve has never worked properly for
files with enough hard links to trigger extrefs.  It was trying to
get the leaf out of a path after freeing the path:

	btrfs_release_path(path);
	leaf = path-&gt;nodes[0];
	item_size = btrfs_item_size_nr(leaf, slot);

The fix here is to use the extent buffer we cloned just a little higher
up to avoid deadlocks caused by using the leaf in the path.

Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
cc: Mark Fasheh &lt;mfasheh@suse.de&gt;
Reviewed-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-by: Mark Fasheh &lt;mfasheh@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: check unsupported filters in balance arguments</title>
<updated>2015-10-27T00:53:38+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.com</email>
</author>
<published>2015-10-12T14:55:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bf595083549df3aae42f71812f2a66b5a2066053'/>
<id>bf595083549df3aae42f71812f2a66b5a2066053</id>
<content type='text'>
commit 8eb934591f8bf584969454a658f629cd06e59f3a upstream.

We don't verify that all the balance filter arguments supplemented by
the flags are actually known to the kernel. Thus we let it silently pass
and do nothing.

At the moment this means only the 'limit' filter, but we're going to add
a few more soon so it's better to have that fixed. Also in older stable
kernels so that it works with newer userspace tools.

Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8eb934591f8bf584969454a658f629cd06e59f3a upstream.

We don't verify that all the balance filter arguments supplemented by
the flags are actually known to the kernel. Thus we let it silently pass
and do nothing.

At the moment this means only the 'limit' filter, but we're going to add
a few more soon so it's better to have that fixed. Also in older stable
kernels so that it works with newer userspace tools.

Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>namei: results of d_is_negative() should be checked after dentry revalidation</title>
<updated>2015-10-22T21:49:34+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2015-10-09T17:44:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f03b7a659257a1e1c578ca36ebfd9d65bb3e2594'/>
<id>f03b7a659257a1e1c578ca36ebfd9d65bb3e2594</id>
<content type='text'>
commit daf3761c9fcde0f4ca64321cbed6c1c86d304193 upstream.

Leandro Awa writes:
 "After switching to version 4.1.6, our parallelized and distributed
  workflows now fail consistently with errors of the form:

  T34: ./regex.c:39:22: error: config.h: No such file or directory

  From our 'git bisect' testing, the following commit appears to be the
  possible cause of the behavior we've been seeing: commit 766c4cbfacd8"

Al Viro says:
 "What happens is that 766c4cbfacd8 got the things subtly wrong.

  We used to treat d_is_negative() after lookup_fast() as "fall with
  ENOENT".  That was wrong - checking -&gt;d_flags outside of -&gt;d_seq
  protection is unreliable and failing with hard error on what should've
  fallen back to non-RCU pathname resolution is a bug.

  Unfortunately, we'd pulled the test too far up and ran afoul of
  another kind of staleness.  The dentry might have been absolutely
  stable from the RCU point of view (and we might be on UP, etc), but
  stale from the remote fs point of view.  If -&gt;d_revalidate() returns
  "it's actually stale", dentry gets thrown away and the original code
  wouldn't even have looked at its -&gt;d_flags.

  What we need is to check -&gt;d_flags where 766c4cbfacd8 does (prior to
  -&gt;d_seq validation) but only use the result in cases where we do not
  discard this dentry outright"

Reported-by: Leandro Awa &lt;lawa@nvidia.com&gt;
Link: https://bugzilla.kernel.org/show_bug.cgi?id=104911
Fixes: 766c4cbfacd8 ("namei: d_is_negative() should be checked...")
Tested-by: Leandro Awa &lt;lawa@nvidia.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Acked-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit daf3761c9fcde0f4ca64321cbed6c1c86d304193 upstream.

Leandro Awa writes:
 "After switching to version 4.1.6, our parallelized and distributed
  workflows now fail consistently with errors of the form:

  T34: ./regex.c:39:22: error: config.h: No such file or directory

  From our 'git bisect' testing, the following commit appears to be the
  possible cause of the behavior we've been seeing: commit 766c4cbfacd8"

Al Viro says:
 "What happens is that 766c4cbfacd8 got the things subtly wrong.

  We used to treat d_is_negative() after lookup_fast() as "fall with
  ENOENT".  That was wrong - checking -&gt;d_flags outside of -&gt;d_seq
  protection is unreliable and failing with hard error on what should've
  fallen back to non-RCU pathname resolution is a bug.

  Unfortunately, we'd pulled the test too far up and ran afoul of
  another kind of staleness.  The dentry might have been absolutely
  stable from the RCU point of view (and we might be on UP, etc), but
  stale from the remote fs point of view.  If -&gt;d_revalidate() returns
  "it's actually stale", dentry gets thrown away and the original code
  wouldn't even have looked at its -&gt;d_flags.

  What we need is to check -&gt;d_flags where 766c4cbfacd8 does (prior to
  -&gt;d_seq validation) but only use the result in cases where we do not
  discard this dentry outright"

Reported-by: Leandro Awa &lt;lawa@nvidia.com&gt;
Link: https://bugzilla.kernel.org/show_bug.cgi?id=104911
Fixes: 766c4cbfacd8 ("namei: d_is_negative() should be checked...")
Tested-by: Leandro Awa &lt;lawa@nvidia.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Acked-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>nfs/filelayout: Fix NULL reference caused by double freeing of fh_array</title>
<updated>2015-10-22T21:49:33+00:00</updated>
<author>
<name>Kinglong Mee</name>
<email>kinglongmee@gmail.com</email>
</author>
<published>2015-09-14T12:12:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=52402501ca51e4c13ad2025c21fd808201004b0b'/>
<id>52402501ca51e4c13ad2025c21fd808201004b0b</id>
<content type='text'>
commit 3ec0c97959abff33a42db9081c22132bcff5b4f2 upstream.

If filelayout_decode_layout fail, _filelayout_free_lseg will causes
a double freeing of fh_array.

[ 1179.279800] BUG: unable to handle kernel NULL pointer dereference at           (null)
[ 1179.280198] IP: [&lt;ffffffffa027222d&gt;] filelayout_free_fh_array.isra.11+0x1d/0x70 [nfs_layout_nfsv41_files]
[ 1179.281010] PGD 0
[ 1179.281443] Oops: 0000 [#1]
[ 1179.281831] Modules linked in: nfs_layout_nfsv41_files(OE) nfsv4(OE) nfs(OE) fscache(E) xfs libcrc32c coretemp nfsd crct10dif_pclmul ppdev crc32_pclmul crc32c_intel auth_rpcgss ghash_clmulni_intel nfs_acl lockd vmw_balloon grace sunrpc parport_pc vmw_vmci parport shpchp i2c_piix4 vmwgfx drm_kms_helper ttm drm serio_raw mptspi scsi_transport_spi mptscsih e1000 mptbase ata_generic pata_acpi [last unloaded: fscache]
[ 1179.283891] CPU: 0 PID: 13336 Comm: cat Tainted: G           OE   4.3.0-rc1-pnfs+ #244
[ 1179.284323] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/20/2014
[ 1179.285206] task: ffff8800501d48c0 ti: ffff88003e3c4000 task.ti: ffff88003e3c4000
[ 1179.285668] RIP: 0010:[&lt;ffffffffa027222d&gt;]  [&lt;ffffffffa027222d&gt;] filelayout_free_fh_array.isra.11+0x1d/0x70 [nfs_layout_nfsv41_files]
[ 1179.286612] RSP: 0018:ffff88003e3c77f8  EFLAGS: 00010202
[ 1179.287092] RAX: 0000000000000000 RBX: ffff88001fe78900 RCX: 0000000000000000
[ 1179.287731] RDX: ffffea0000f40760 RSI: ffff88001fe789c8 RDI: ffff88001fe789c0
[ 1179.288383] RBP: ffff88003e3c7810 R08: ffffea0000f40760 R09: 0000000000000000
[ 1179.289170] R10: 0000000000000000 R11: 0000000000000001 R12: ffff88001fe789c8
[ 1179.289959] R13: ffff88001fe789c0 R14: ffff88004ec05a80 R15: ffff88004f935b88
[ 1179.290791] FS:  00007f4e66bb5700(0000) GS:ffffffff81c29000(0000) knlGS:0000000000000000
[ 1179.291580] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1179.292209] CR2: 0000000000000000 CR3: 00000000203f8000 CR4: 00000000001406f0
[ 1179.292731] Stack:
[ 1179.293195]  ffff88001fe78900 00000000000000d0 ffff88001fe78178 ffff88003e3c7868
[ 1179.293676]  ffffffffa0272737 0000000000000001 0000000000000001 ffff88001fe78800
[ 1179.294151]  00000000614fffce ffffffff81727671 ffff88001fe78100 ffff88001fe78100
[ 1179.294623] Call Trace:
[ 1179.295092]  [&lt;ffffffffa0272737&gt;] filelayout_alloc_lseg+0xa7/0x2d0 [nfs_layout_nfsv41_files]
[ 1179.295625]  [&lt;ffffffff81727671&gt;] ? out_of_line_wait_on_bit+0x81/0xb0
[ 1179.296133]  [&lt;ffffffffa040407e&gt;] pnfs_layout_process+0xae/0x320 [nfsv4]
[ 1179.296632]  [&lt;ffffffffa03e0a01&gt;] nfs4_proc_layoutget+0x2b1/0x360 [nfsv4]
[ 1179.297134]  [&lt;ffffffffa0402983&gt;] pnfs_update_layout+0x853/0xb30 [nfsv4]
[ 1179.297632]  [&lt;ffffffffa039db24&gt;] ? nfs_get_lock_context+0x74/0x170 [nfs]
[ 1179.298158]  [&lt;ffffffffa0271807&gt;] filelayout_pg_init_read+0x37/0x50 [nfs_layout_nfsv41_files]
[ 1179.298834]  [&lt;ffffffffa03a72d9&gt;] __nfs_pageio_add_request+0x119/0x460 [nfs]
[ 1179.299385]  [&lt;ffffffffa03a6bd7&gt;] ? nfs_create_request.part.9+0x37/0x2e0 [nfs]
[ 1179.299872]  [&lt;ffffffffa03a7cc3&gt;] nfs_pageio_add_request+0xa3/0x1b0 [nfs]
[ 1179.300362]  [&lt;ffffffffa03a8635&gt;] readpage_async_filler+0x85/0x260 [nfs]
[ 1179.300907]  [&lt;ffffffff81180cb1&gt;] read_cache_pages+0x91/0xd0
[ 1179.301391]  [&lt;ffffffffa03a85b0&gt;] ? nfs_read_completion+0x220/0x220 [nfs]
[ 1179.301867]  [&lt;ffffffffa03a8dc8&gt;] nfs_readpages+0x128/0x200 [nfs]
[ 1179.302330]  [&lt;ffffffff81180ef3&gt;] __do_page_cache_readahead+0x203/0x280
[ 1179.302784]  [&lt;ffffffff81180dc8&gt;] ? __do_page_cache_readahead+0xd8/0x280
[ 1179.303413]  [&lt;ffffffff81181116&gt;] ondemand_readahead+0x1a6/0x2f0
[ 1179.303855]  [&lt;ffffffff81181371&gt;] page_cache_sync_readahead+0x31/0x50
[ 1179.304286]  [&lt;ffffffff811750a6&gt;] generic_file_read_iter+0x4a6/0x5c0
[ 1179.304711]  [&lt;ffffffffa03a0316&gt;] ? __nfs_revalidate_mapping+0x1f6/0x240 [nfs]
[ 1179.305132]  [&lt;ffffffffa039ccf2&gt;] nfs_file_read+0x52/0xa0 [nfs]
[ 1179.305540]  [&lt;ffffffff811e343c&gt;] __vfs_read+0xcc/0x100
[ 1179.305936]  [&lt;ffffffff811e3d15&gt;] vfs_read+0x85/0x130
[ 1179.306326]  [&lt;ffffffff811e4a98&gt;] SyS_read+0x58/0xd0
[ 1179.306708]  [&lt;ffffffff8172caaf&gt;] entry_SYSCALL_64_fastpath+0x12/0x76
[ 1179.307094] Code: c4 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 8b 07 49 89 f4 85 c0 74 47 48 8b 06 49 89 fd &lt;48&gt; 8b 38 48 85 ff 74 22 31 db eb 0c 48 63 d3 48 8b 3c d0 48 85
[ 1179.308357] RIP  [&lt;ffffffffa027222d&gt;] filelayout_free_fh_array.isra.11+0x1d/0x70 [nfs_layout_nfsv41_files]
[ 1179.309177]  RSP &lt;ffff88003e3c77f8&gt;
[ 1179.309582] CR2: 0000000000000000

Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Cc: William Dauchy &lt;william@gandi.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3ec0c97959abff33a42db9081c22132bcff5b4f2 upstream.

If filelayout_decode_layout fail, _filelayout_free_lseg will causes
a double freeing of fh_array.

[ 1179.279800] BUG: unable to handle kernel NULL pointer dereference at           (null)
[ 1179.280198] IP: [&lt;ffffffffa027222d&gt;] filelayout_free_fh_array.isra.11+0x1d/0x70 [nfs_layout_nfsv41_files]
[ 1179.281010] PGD 0
[ 1179.281443] Oops: 0000 [#1]
[ 1179.281831] Modules linked in: nfs_layout_nfsv41_files(OE) nfsv4(OE) nfs(OE) fscache(E) xfs libcrc32c coretemp nfsd crct10dif_pclmul ppdev crc32_pclmul crc32c_intel auth_rpcgss ghash_clmulni_intel nfs_acl lockd vmw_balloon grace sunrpc parport_pc vmw_vmci parport shpchp i2c_piix4 vmwgfx drm_kms_helper ttm drm serio_raw mptspi scsi_transport_spi mptscsih e1000 mptbase ata_generic pata_acpi [last unloaded: fscache]
[ 1179.283891] CPU: 0 PID: 13336 Comm: cat Tainted: G           OE   4.3.0-rc1-pnfs+ #244
[ 1179.284323] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/20/2014
[ 1179.285206] task: ffff8800501d48c0 ti: ffff88003e3c4000 task.ti: ffff88003e3c4000
[ 1179.285668] RIP: 0010:[&lt;ffffffffa027222d&gt;]  [&lt;ffffffffa027222d&gt;] filelayout_free_fh_array.isra.11+0x1d/0x70 [nfs_layout_nfsv41_files]
[ 1179.286612] RSP: 0018:ffff88003e3c77f8  EFLAGS: 00010202
[ 1179.287092] RAX: 0000000000000000 RBX: ffff88001fe78900 RCX: 0000000000000000
[ 1179.287731] RDX: ffffea0000f40760 RSI: ffff88001fe789c8 RDI: ffff88001fe789c0
[ 1179.288383] RBP: ffff88003e3c7810 R08: ffffea0000f40760 R09: 0000000000000000
[ 1179.289170] R10: 0000000000000000 R11: 0000000000000001 R12: ffff88001fe789c8
[ 1179.289959] R13: ffff88001fe789c0 R14: ffff88004ec05a80 R15: ffff88004f935b88
[ 1179.290791] FS:  00007f4e66bb5700(0000) GS:ffffffff81c29000(0000) knlGS:0000000000000000
[ 1179.291580] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1179.292209] CR2: 0000000000000000 CR3: 00000000203f8000 CR4: 00000000001406f0
[ 1179.292731] Stack:
[ 1179.293195]  ffff88001fe78900 00000000000000d0 ffff88001fe78178 ffff88003e3c7868
[ 1179.293676]  ffffffffa0272737 0000000000000001 0000000000000001 ffff88001fe78800
[ 1179.294151]  00000000614fffce ffffffff81727671 ffff88001fe78100 ffff88001fe78100
[ 1179.294623] Call Trace:
[ 1179.295092]  [&lt;ffffffffa0272737&gt;] filelayout_alloc_lseg+0xa7/0x2d0 [nfs_layout_nfsv41_files]
[ 1179.295625]  [&lt;ffffffff81727671&gt;] ? out_of_line_wait_on_bit+0x81/0xb0
[ 1179.296133]  [&lt;ffffffffa040407e&gt;] pnfs_layout_process+0xae/0x320 [nfsv4]
[ 1179.296632]  [&lt;ffffffffa03e0a01&gt;] nfs4_proc_layoutget+0x2b1/0x360 [nfsv4]
[ 1179.297134]  [&lt;ffffffffa0402983&gt;] pnfs_update_layout+0x853/0xb30 [nfsv4]
[ 1179.297632]  [&lt;ffffffffa039db24&gt;] ? nfs_get_lock_context+0x74/0x170 [nfs]
[ 1179.298158]  [&lt;ffffffffa0271807&gt;] filelayout_pg_init_read+0x37/0x50 [nfs_layout_nfsv41_files]
[ 1179.298834]  [&lt;ffffffffa03a72d9&gt;] __nfs_pageio_add_request+0x119/0x460 [nfs]
[ 1179.299385]  [&lt;ffffffffa03a6bd7&gt;] ? nfs_create_request.part.9+0x37/0x2e0 [nfs]
[ 1179.299872]  [&lt;ffffffffa03a7cc3&gt;] nfs_pageio_add_request+0xa3/0x1b0 [nfs]
[ 1179.300362]  [&lt;ffffffffa03a8635&gt;] readpage_async_filler+0x85/0x260 [nfs]
[ 1179.300907]  [&lt;ffffffff81180cb1&gt;] read_cache_pages+0x91/0xd0
[ 1179.301391]  [&lt;ffffffffa03a85b0&gt;] ? nfs_read_completion+0x220/0x220 [nfs]
[ 1179.301867]  [&lt;ffffffffa03a8dc8&gt;] nfs_readpages+0x128/0x200 [nfs]
[ 1179.302330]  [&lt;ffffffff81180ef3&gt;] __do_page_cache_readahead+0x203/0x280
[ 1179.302784]  [&lt;ffffffff81180dc8&gt;] ? __do_page_cache_readahead+0xd8/0x280
[ 1179.303413]  [&lt;ffffffff81181116&gt;] ondemand_readahead+0x1a6/0x2f0
[ 1179.303855]  [&lt;ffffffff81181371&gt;] page_cache_sync_readahead+0x31/0x50
[ 1179.304286]  [&lt;ffffffff811750a6&gt;] generic_file_read_iter+0x4a6/0x5c0
[ 1179.304711]  [&lt;ffffffffa03a0316&gt;] ? __nfs_revalidate_mapping+0x1f6/0x240 [nfs]
[ 1179.305132]  [&lt;ffffffffa039ccf2&gt;] nfs_file_read+0x52/0xa0 [nfs]
[ 1179.305540]  [&lt;ffffffff811e343c&gt;] __vfs_read+0xcc/0x100
[ 1179.305936]  [&lt;ffffffff811e3d15&gt;] vfs_read+0x85/0x130
[ 1179.306326]  [&lt;ffffffff811e4a98&gt;] SyS_read+0x58/0xd0
[ 1179.306708]  [&lt;ffffffff8172caaf&gt;] entry_SYSCALL_64_fastpath+0x12/0x76
[ 1179.307094] Code: c4 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 8b 07 49 89 f4 85 c0 74 47 48 8b 06 49 89 fd &lt;48&gt; 8b 38 48 85 ff 74 22 31 db eb 0c 48 63 d3 48 8b 3c d0 48 85
[ 1179.308357] RIP  [&lt;ffffffffa027222d&gt;] filelayout_free_fh_array.isra.11+0x1d/0x70 [nfs_layout_nfsv41_files]
[ 1179.309177]  RSP &lt;ffff88003e3c77f8&gt;
[ 1179.309582] CR2: 0000000000000000

Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Cc: William Dauchy &lt;william@gandi.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: Test for and handle paths that are unreachable from their mnt_root</title>
<updated>2015-10-22T21:49:32+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-08-16T01:27:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6522d3d55687efc94e9e276ed657daf3a7a7543a'/>
<id>6522d3d55687efc94e9e276ed657daf3a7a7543a</id>
<content type='text'>
commit 397d425dc26da728396e66d392d5dcb8dac30c37 upstream.

In rare cases a directory can be renamed out from under a bind mount.
In those cases without special handling it becomes possible to walk up
the directory tree to the root dentry of the filesystem and down
from the root dentry to every other file or directory on the filesystem.

Like division by zero .. from an unconnected path can not be given
a useful semantic as there is no predicting at which path component
the code will realize it is unconnected.  We certainly can not match
the current behavior as the current behavior is a security hole.

Therefore when encounting .. when following an unconnected path
return -ENOENT.

- Add a function path_connected to verify path-&gt;dentry is reachable
  from path-&gt;mnt.mnt_root.  AKA to validate that rename did not do
  something nasty to the bind mount.

  To avoid races path_connected must be called after following a path
  component to it's next path component.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 397d425dc26da728396e66d392d5dcb8dac30c37 upstream.

In rare cases a directory can be renamed out from under a bind mount.
In those cases without special handling it becomes possible to walk up
the directory tree to the root dentry of the filesystem and down
from the root dentry to every other file or directory on the filesystem.

Like division by zero .. from an unconnected path can not be given
a useful semantic as there is no predicting at which path component
the code will realize it is unconnected.  We certainly can not match
the current behavior as the current behavior is a security hole.

Therefore when encounting .. when following an unconnected path
return -ENOENT.

- Add a function path_connected to verify path-&gt;dentry is reachable
  from path-&gt;mnt.mnt_root.  AKA to validate that rename did not do
  something nasty to the bind mount.

  To avoid races path_connected must be called after following a path
  component to it's next path component.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>dcache: Handle escaped paths in prepend_path</title>
<updated>2015-10-22T21:49:32+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-08-15T18:36:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e47bf8170acc88ad29627d8e42757d7d6ae56611'/>
<id>e47bf8170acc88ad29627d8e42757d7d6ae56611</id>
<content type='text'>
commit cde93be45a8a90d8c264c776fab63487b5038a65 upstream.

A rename can result in a dentry that by walking up d_parent
will never reach it's mnt_root.  For lack of a better term
I call this an escaped path.

prepend_path is called by four different functions __d_path,
d_absolute_path, d_path, and getcwd.

__d_path only wants to see paths are connected to the root it passes
in.  So __d_path needs prepend_path to return an error.

d_absolute_path similarly wants to see paths that are connected to
some root.  Escaped paths are not connected to any mnt_root so
d_absolute_path needs prepend_path to return an error greater
than 1.  So escaped paths will be treated like paths on lazily
unmounted mounts.

getcwd needs to prepend "(unreachable)" so getcwd also needs
prepend_path to return an error.

d_path is the interesting hold out.  d_path just wants to print
something, and does not care about the weird cases.  Which raises
the question what should be printed?

Given that &lt;escaped_path&gt;/&lt;anything&gt; should result in -ENOENT I
believe it is desirable for escaped paths to be printed as empty
paths.  As there are not really any meaninful path components when
considered from the perspective of a mount tree.

So tweak prepend_path to return an empty path with an new error
code of 3 when it encounters an escaped path.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit cde93be45a8a90d8c264c776fab63487b5038a65 upstream.

A rename can result in a dentry that by walking up d_parent
will never reach it's mnt_root.  For lack of a better term
I call this an escaped path.

prepend_path is called by four different functions __d_path,
d_absolute_path, d_path, and getcwd.

__d_path only wants to see paths are connected to the root it passes
in.  So __d_path needs prepend_path to return an error.

d_absolute_path similarly wants to see paths that are connected to
some root.  Escaped paths are not connected to any mnt_root so
d_absolute_path needs prepend_path to return an error greater
than 1.  So escaped paths will be treated like paths on lazily
unmounted mounts.

getcwd needs to prepend "(unreachable)" so getcwd also needs
prepend_path to return an error.

d_path is the interesting hold out.  d_path just wants to print
something, and does not care about the weird cases.  Which raises
the question what should be printed?

Given that &lt;escaped_path&gt;/&lt;anything&gt; should result in -ENOENT I
believe it is desirable for escaped paths to be printed as empty
paths.  As there are not really any meaninful path components when
considered from the perspective of a mount tree.

So tweak prepend_path to return an empty path with an new error
code of 3 when it encounters an escaped path.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>UBIFS: Kill unneeded locking in ubifs_init_security</title>
<updated>2015-10-22T21:49:31+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2015-07-08T09:46:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b8e759b6839ac3595d958fdb61828f7fb9066f49'/>
<id>b8e759b6839ac3595d958fdb61828f7fb9066f49</id>
<content type='text'>
commit cf6f54e3f133229f02a90c04fe0ff9dd9d3264b4 upstream.

Fixes the following lockdep splat:
[    1.244527] =============================================
[    1.245193] [ INFO: possible recursive locking detected ]
[    1.245193] 4.2.0-rc1+ #37 Not tainted
[    1.245193] ---------------------------------------------
[    1.245193] cp/742 is trying to acquire lock:
[    1.245193]  (&amp;sb-&gt;s_type-&gt;i_mutex_key#9){+.+.+.}, at: [&lt;ffffffff812b3f69&gt;] ubifs_init_security+0x29/0xb0
[    1.245193]
[    1.245193] but task is already holding lock:
[    1.245193]  (&amp;sb-&gt;s_type-&gt;i_mutex_key#9){+.+.+.}, at: [&lt;ffffffff81198e7f&gt;] path_openat+0x3af/0x1280
[    1.245193]
[    1.245193] other info that might help us debug this:
[    1.245193]  Possible unsafe locking scenario:
[    1.245193]
[    1.245193]        CPU0
[    1.245193]        ----
[    1.245193]   lock(&amp;sb-&gt;s_type-&gt;i_mutex_key#9);
[    1.245193]   lock(&amp;sb-&gt;s_type-&gt;i_mutex_key#9);
[    1.245193]
[    1.245193]  *** DEADLOCK ***
[    1.245193]
[    1.245193]  May be due to missing lock nesting notation
[    1.245193]
[    1.245193] 2 locks held by cp/742:
[    1.245193]  #0:  (sb_writers#5){.+.+.+}, at: [&lt;ffffffff811ad37f&gt;] mnt_want_write+0x1f/0x50
[    1.245193]  #1:  (&amp;sb-&gt;s_type-&gt;i_mutex_key#9){+.+.+.}, at: [&lt;ffffffff81198e7f&gt;] path_openat+0x3af/0x1280
[    1.245193]
[    1.245193] stack backtrace:
[    1.245193] CPU: 2 PID: 742 Comm: cp Not tainted 4.2.0-rc1+ #37
[    1.245193] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140816_022509-build35 04/01/2014
[    1.245193]  ffffffff8252d530 ffff88007b023a38 ffffffff814f6f49 ffffffff810b56c5
[    1.245193]  ffff88007c30cc80 ffff88007b023af8 ffffffff810a150d ffff88007b023a68
[    1.245193]  000000008101302a ffff880000000000 00000008f447e23f ffffffff8252d500
[    1.245193] Call Trace:
[    1.245193]  [&lt;ffffffff814f6f49&gt;] dump_stack+0x4c/0x65
[    1.245193]  [&lt;ffffffff810b56c5&gt;] ? console_unlock+0x1c5/0x510
[    1.245193]  [&lt;ffffffff810a150d&gt;] __lock_acquire+0x1a6d/0x1ea0
[    1.245193]  [&lt;ffffffff8109fa78&gt;] ? __lock_is_held+0x58/0x80
[    1.245193]  [&lt;ffffffff810a1a93&gt;] lock_acquire+0xd3/0x270
[    1.245193]  [&lt;ffffffff812b3f69&gt;] ? ubifs_init_security+0x29/0xb0
[    1.245193]  [&lt;ffffffff814fc83b&gt;] mutex_lock_nested+0x6b/0x3a0
[    1.245193]  [&lt;ffffffff812b3f69&gt;] ? ubifs_init_security+0x29/0xb0
[    1.245193]  [&lt;ffffffff812b3f69&gt;] ? ubifs_init_security+0x29/0xb0
[    1.245193]  [&lt;ffffffff812b3f69&gt;] ubifs_init_security+0x29/0xb0
[    1.245193]  [&lt;ffffffff8128e286&gt;] ubifs_create+0xa6/0x1f0
[    1.245193]  [&lt;ffffffff81198e7f&gt;] ? path_openat+0x3af/0x1280
[    1.245193]  [&lt;ffffffff81195d15&gt;] vfs_create+0x95/0xc0
[    1.245193]  [&lt;ffffffff8119929c&gt;] path_openat+0x7cc/0x1280
[    1.245193]  [&lt;ffffffff8109ffe3&gt;] ? __lock_acquire+0x543/0x1ea0
[    1.245193]  [&lt;ffffffff81088f20&gt;] ? sched_clock_cpu+0x90/0xc0
[    1.245193]  [&lt;ffffffff81088c00&gt;] ? calc_global_load_tick+0x60/0x90
[    1.245193]  [&lt;ffffffff81088f20&gt;] ? sched_clock_cpu+0x90/0xc0
[    1.245193]  [&lt;ffffffff811a9cef&gt;] ? __alloc_fd+0xaf/0x180
[    1.245193]  [&lt;ffffffff8119ac55&gt;] do_filp_open+0x75/0xd0
[    1.245193]  [&lt;ffffffff814ffd86&gt;] ? _raw_spin_unlock+0x26/0x40
[    1.245193]  [&lt;ffffffff811a9cef&gt;] ? __alloc_fd+0xaf/0x180
[    1.245193]  [&lt;ffffffff81189bd9&gt;] do_sys_open+0x129/0x200
[    1.245193]  [&lt;ffffffff81189cc9&gt;] SyS_open+0x19/0x20
[    1.245193]  [&lt;ffffffff81500717&gt;] entry_SYSCALL_64_fastpath+0x12/0x6f

While the lockdep splat is a false positive, becuase path_openat holds i_mutex
of the parent directory and ubifs_init_security() tries to acquire i_mutex
of a new inode, it reveals that taking i_mutex in ubifs_init_security() is
in vain because it is only being called in the inode allocation path
and therefore nobody else can see the inode yet.

Reported-and-tested-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Reviewed-and-tested-by: Dongsheng Yang &lt;yangds.fnst@cn.fujitsu.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: dedekind1@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit cf6f54e3f133229f02a90c04fe0ff9dd9d3264b4 upstream.

Fixes the following lockdep splat:
[    1.244527] =============================================
[    1.245193] [ INFO: possible recursive locking detected ]
[    1.245193] 4.2.0-rc1+ #37 Not tainted
[    1.245193] ---------------------------------------------
[    1.245193] cp/742 is trying to acquire lock:
[    1.245193]  (&amp;sb-&gt;s_type-&gt;i_mutex_key#9){+.+.+.}, at: [&lt;ffffffff812b3f69&gt;] ubifs_init_security+0x29/0xb0
[    1.245193]
[    1.245193] but task is already holding lock:
[    1.245193]  (&amp;sb-&gt;s_type-&gt;i_mutex_key#9){+.+.+.}, at: [&lt;ffffffff81198e7f&gt;] path_openat+0x3af/0x1280
[    1.245193]
[    1.245193] other info that might help us debug this:
[    1.245193]  Possible unsafe locking scenario:
[    1.245193]
[    1.245193]        CPU0
[    1.245193]        ----
[    1.245193]   lock(&amp;sb-&gt;s_type-&gt;i_mutex_key#9);
[    1.245193]   lock(&amp;sb-&gt;s_type-&gt;i_mutex_key#9);
[    1.245193]
[    1.245193]  *** DEADLOCK ***
[    1.245193]
[    1.245193]  May be due to missing lock nesting notation
[    1.245193]
[    1.245193] 2 locks held by cp/742:
[    1.245193]  #0:  (sb_writers#5){.+.+.+}, at: [&lt;ffffffff811ad37f&gt;] mnt_want_write+0x1f/0x50
[    1.245193]  #1:  (&amp;sb-&gt;s_type-&gt;i_mutex_key#9){+.+.+.}, at: [&lt;ffffffff81198e7f&gt;] path_openat+0x3af/0x1280
[    1.245193]
[    1.245193] stack backtrace:
[    1.245193] CPU: 2 PID: 742 Comm: cp Not tainted 4.2.0-rc1+ #37
[    1.245193] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140816_022509-build35 04/01/2014
[    1.245193]  ffffffff8252d530 ffff88007b023a38 ffffffff814f6f49 ffffffff810b56c5
[    1.245193]  ffff88007c30cc80 ffff88007b023af8 ffffffff810a150d ffff88007b023a68
[    1.245193]  000000008101302a ffff880000000000 00000008f447e23f ffffffff8252d500
[    1.245193] Call Trace:
[    1.245193]  [&lt;ffffffff814f6f49&gt;] dump_stack+0x4c/0x65
[    1.245193]  [&lt;ffffffff810b56c5&gt;] ? console_unlock+0x1c5/0x510
[    1.245193]  [&lt;ffffffff810a150d&gt;] __lock_acquire+0x1a6d/0x1ea0
[    1.245193]  [&lt;ffffffff8109fa78&gt;] ? __lock_is_held+0x58/0x80
[    1.245193]  [&lt;ffffffff810a1a93&gt;] lock_acquire+0xd3/0x270
[    1.245193]  [&lt;ffffffff812b3f69&gt;] ? ubifs_init_security+0x29/0xb0
[    1.245193]  [&lt;ffffffff814fc83b&gt;] mutex_lock_nested+0x6b/0x3a0
[    1.245193]  [&lt;ffffffff812b3f69&gt;] ? ubifs_init_security+0x29/0xb0
[    1.245193]  [&lt;ffffffff812b3f69&gt;] ? ubifs_init_security+0x29/0xb0
[    1.245193]  [&lt;ffffffff812b3f69&gt;] ubifs_init_security+0x29/0xb0
[    1.245193]  [&lt;ffffffff8128e286&gt;] ubifs_create+0xa6/0x1f0
[    1.245193]  [&lt;ffffffff81198e7f&gt;] ? path_openat+0x3af/0x1280
[    1.245193]  [&lt;ffffffff81195d15&gt;] vfs_create+0x95/0xc0
[    1.245193]  [&lt;ffffffff8119929c&gt;] path_openat+0x7cc/0x1280
[    1.245193]  [&lt;ffffffff8109ffe3&gt;] ? __lock_acquire+0x543/0x1ea0
[    1.245193]  [&lt;ffffffff81088f20&gt;] ? sched_clock_cpu+0x90/0xc0
[    1.245193]  [&lt;ffffffff81088c00&gt;] ? calc_global_load_tick+0x60/0x90
[    1.245193]  [&lt;ffffffff81088f20&gt;] ? sched_clock_cpu+0x90/0xc0
[    1.245193]  [&lt;ffffffff811a9cef&gt;] ? __alloc_fd+0xaf/0x180
[    1.245193]  [&lt;ffffffff8119ac55&gt;] do_filp_open+0x75/0xd0
[    1.245193]  [&lt;ffffffff814ffd86&gt;] ? _raw_spin_unlock+0x26/0x40
[    1.245193]  [&lt;ffffffff811a9cef&gt;] ? __alloc_fd+0xaf/0x180
[    1.245193]  [&lt;ffffffff81189bd9&gt;] do_sys_open+0x129/0x200
[    1.245193]  [&lt;ffffffff81189cc9&gt;] SyS_open+0x19/0x20
[    1.245193]  [&lt;ffffffff81500717&gt;] entry_SYSCALL_64_fastpath+0x12/0x6f

While the lockdep splat is a false positive, becuase path_openat holds i_mutex
of the parent directory and ubifs_init_security() tries to acquire i_mutex
of a new inode, it reveals that taking i_mutex in ubifs_init_security() is
in vain because it is only being called in the inode allocation path
and therefore nobody else can see the inode yet.

Reported-and-tested-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Reviewed-and-tested-by: Dongsheng Yang &lt;yangds.fnst@cn.fujitsu.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: dedekind1@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>cifs: use server timestamp for ntlmv2 authentication</title>
<updated>2015-10-22T21:49:27+00:00</updated>
<author>
<name>Peter Seiderer</name>
<email>ps.report@gmx.net</email>
</author>
<published>2015-09-17T19:40:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4ca3a6e823901b869b71355a1f84f64b9fec15e6'/>
<id>4ca3a6e823901b869b71355a1f84f64b9fec15e6</id>
<content type='text'>
commit 98ce94c8df762d413b3ecb849e2b966b21606d04 upstream.

Linux cifs mount with ntlmssp against an Mac OS X (Yosemite
10.10.5) share fails in case the clocks differ more than +/-2h:

digest-service: digest-request: od failed with 2 proto=ntlmv2
digest-service: digest-request: kdc failed with -1561745592 proto=ntlmv2

Fix this by (re-)using the given server timestamp for the
ntlmv2 authentication (as Windows 7 does).

A related problem was also reported earlier by Namjae Jaen (see below):

Windows machine has extended security feature which refuse to allow
authentication when there is time difference between server time and
client time when ntlmv2 negotiation is used. This problem is prevalent
in embedded enviornment where system time is set to default 1970.

Modern servers send the server timestamp in the TargetInfo Av_Pair
structure in the challenge message [see MS-NLMP 2.2.2.1]
In [MS-NLMP 3.1.5.1.2] it is explicitly mentioned that the client must
use the server provided timestamp if present OR current time if it is
not

Reported-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Peter Seiderer &lt;ps.report@gmx.net&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 98ce94c8df762d413b3ecb849e2b966b21606d04 upstream.

Linux cifs mount with ntlmssp against an Mac OS X (Yosemite
10.10.5) share fails in case the clocks differ more than +/-2h:

digest-service: digest-request: od failed with 2 proto=ntlmv2
digest-service: digest-request: kdc failed with -1561745592 proto=ntlmv2

Fix this by (re-)using the given server timestamp for the
ntlmv2 authentication (as Windows 7 does).

A related problem was also reported earlier by Namjae Jaen (see below):

Windows machine has extended security feature which refuse to allow
authentication when there is time difference between server time and
client time when ntlmv2 negotiation is used. This problem is prevalent
in embedded enviornment where system time is set to default 1970.

Modern servers send the server timestamp in the TargetInfo Av_Pair
structure in the challenge message [see MS-NLMP 2.2.2.1]
In [MS-NLMP 3.1.5.1.2] it is explicitly mentioned that the client must
use the server provided timestamp if present OR current time if it is
not

Reported-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Peter Seiderer &lt;ps.report@gmx.net&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Do not fall back to SMBWriteX in set_file_size error cases</title>
<updated>2015-10-22T21:49:24+00:00</updated>
<author>
<name>Steve French</name>
<email>smfrench@gmail.com</email>
</author>
<published>2015-09-28T22:21:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=357223fe135f0d4ba34d041ea9e8a5340054eed4'/>
<id>357223fe135f0d4ba34d041ea9e8a5340054eed4</id>
<content type='text'>
commit 646200a041203f440fb6fcf9cacd9efeda9de74c upstream.

The error paths in set_file_size for cifs and smb3 are incorrect.

In the unlikely event that a server did not support set file info
of the file size, the code incorrectly falls back to trying SMBWriteX
(note that only the original core SMB Write, used for example by DOS,
can set the file size this way - this actually  does not work for the more
recent SMBWriteX).  The idea was since the old DOS SMB Write could set
the file size if you write zero bytes at that offset then use that if
server rejects the normal set file info call.

Fortunately the SMBWriteX will never be sent on the wire (except when
file size is zero) since the length and offset fields were reversed
in the two places in this function that call SMBWriteX causing
the fall back path to return an error. It is also important to never call
an SMB request from an SMB2/sMB3 session (which theoretically would
be possible, and can cause a brief session drop, although the client
recovers) so this should be fixed.  In practice this path does not happen
with modern servers but the error fall back to SMBWriteX is clearly wrong.

Removing the calls to SMBWriteX in the error paths in cifs_set_file_size

Pointed out by PaX/grsecurity team

Signed-off-by: Steve French &lt;steve.french@primarydata.com&gt;
Reported-by: PaX Team &lt;pageexec@freemail.hu&gt;
CC: Emese Revfy &lt;re.emese@gmail.com&gt;
CC: Brad Spengler &lt;spender@grsecurity.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 646200a041203f440fb6fcf9cacd9efeda9de74c upstream.

The error paths in set_file_size for cifs and smb3 are incorrect.

In the unlikely event that a server did not support set file info
of the file size, the code incorrectly falls back to trying SMBWriteX
(note that only the original core SMB Write, used for example by DOS,
can set the file size this way - this actually  does not work for the more
recent SMBWriteX).  The idea was since the old DOS SMB Write could set
the file size if you write zero bytes at that offset then use that if
server rejects the normal set file info call.

Fortunately the SMBWriteX will never be sent on the wire (except when
file size is zero) since the length and offset fields were reversed
in the two places in this function that call SMBWriteX causing
the fall back path to return an error. It is also important to never call
an SMB request from an SMB2/sMB3 session (which theoretically would
be possible, and can cause a brief session drop, although the client
recovers) so this should be fixed.  In practice this path does not happen
with modern servers but the error fall back to SMBWriteX is clearly wrong.

Removing the calls to SMBWriteX in the error paths in cifs_set_file_size

Pointed out by PaX/grsecurity team

Signed-off-by: Steve French &lt;steve.french@primarydata.com&gt;
Reported-by: PaX Team &lt;pageexec@freemail.hu&gt;
CC: Emese Revfy &lt;re.emese@gmail.com&gt;
CC: Brad Spengler &lt;spender@grsecurity.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
