<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/fs/cifs/smbencrypt.c, branch standardize-docs</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=standardize-docs</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=standardize-docs'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2016-12-14T07:44:16+00:00</updated>
<entry>
<title>cifs: Fix smbencrypt() to stop pointing a scatterlist at the stack</title>
<updated>2016-12-14T07:44:16+00:00</updated>
<author>
<name>Andy Lutomirski</name>
<email>luto@kernel.org</email>
</author>
<published>2016-12-12T20:54:37+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=06deeec77a5a689cc94b21a8a91a76e42176685d'/>
<id>urn:sha1:06deeec77a5a689cc94b21a8a91a76e42176685d</id>
<content type='text'>
smbencrypt() points a scatterlist to the stack, which is breaks if
CONFIG_VMAP_STACK=y.

Fix it by switching to crypto_cipher_encrypt_one().  The new code
should be considerably faster as an added benefit.

This code is nearly identical to some code that Eric Biggers
suggested.

Cc: stable@vger.kernel.org # 4.9 only
Reported-by: Eric Biggers &lt;ebiggers3@gmail.com&gt;
Signed-off-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Acked-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: Use skcipher</title>
<updated>2016-01-27T12:35:53+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2016-01-24T13:17:17+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9651ddbac81f9c2676a963ce836d2f02ba2fe9c0'/>
<id>urn:sha1:9651ddbac81f9c2676a963ce836d2f02ba2fe9c0</id>
<content type='text'>
This patch replaces uses of blkcipher with skcipher.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>cifs: use memzero_explicit to clear stack buffer</title>
<updated>2015-01-19T21:32:13+00:00</updated>
<author>
<name>Giel van Schijndel</name>
<email>me@mortis.eu</email>
</author>
<published>2015-01-06T21:37:00+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f99dbfa4b39f90c3ba95169000cc2cdd59413f4e'/>
<id>urn:sha1:f99dbfa4b39f90c3ba95169000cc2cdd59413f4e</id>
<content type='text'>
When leaving a function use memzero_explicit instead of memset(0) to
clear stack allocated buffers. memset(0) may be optimized away.

This particular buffer is highly likely to contain sensitive data which
we shouldn't leak (it's named 'passwd' after all).

Signed-off-by: Giel van Schijndel &lt;me@mortis.eu&gt;
Acked-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Reported-at: http://www.viva64.com/en/b/0299/
Reported-by: Andrey Karpov
Reported-by: Svyatoslav Razmyslov
Signed-off-by: Steve French &lt;steve.french@primarydata.com&gt;
</content>
</entry>
<entry>
<title>Remap reserved posix characters by default (part 3/3)</title>
<updated>2014-10-16T20:20:20+00:00</updated>
<author>
<name>Steve French</name>
<email>smfrench@gmail.com</email>
</author>
<published>2014-09-27T07:19:01+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2baa2682531ff02928e2d3904800696d9e7193db'/>
<id>urn:sha1:2baa2682531ff02928e2d3904800696d9e7193db</id>
<content type='text'>
This is a bigger patch, but its size is mostly due to
a single change for how we check for remapping illegal characters
in file names - a lot of repeated, small changes to
the way callers request converting file names.

The final patch in the series does the following:

1) changes default behavior for cifs to be more intuitive.
Currently we do not map by default to seven reserved characters,
ie those valid in POSIX but not in NTFS/CIFS/SMB3/Windows,
unless a mount option (mapchars) is specified.  Change this
to by default always map and map using the SFM maping
(like the Mac uses) unless the server negotiates the CIFS Unix
Extensions (like Samba does when mounting with the cifs protocol)
when the remapping of the characters is unnecessary.  This should
help SMB3 mounts in particular since Samba will likely be
able to implement this mapping with its new "vfs_fruit" module
as it will be doing for the Mac.
2) if the user specifies the existing "mapchars" mount option then
use the "SFU" (Microsoft Services for Unix, SUA) style mapping of
the seven characters instead.
3) if the user specifies "nomapposix" then disable SFM/MAC style mapping
(so no character remapping would be used unless the user specifies
"mapchars" on mount as well, as above).
4) change all the places in the code that check for the superblock
flag on the mount which is set by mapchars and passed in on all
path based operation and change it to use a small function call
instead to set the mapping type properly (and check for the
mapping type in the cifs unicode functions)

Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>[CIFS] cifs: Rename cERROR and cFYI to cifs_dbg</title>
<updated>2013-05-05T03:17:23+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2013-05-05T03:12:25+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f96637be081141d6f8813429499f164260b49d70'/>
<id>urn:sha1:f96637be081141d6f8813429499f164260b49d70</id>
<content type='text'>
It's not obvious from reading the macro names that these macros
are for debugging.  Convert the names to a single more typical
kernel style cifs_dbg macro.

	cERROR(1, ...)   -&gt; cifs_dbg(VFS, ...)
	cFYI(1, ...)     -&gt; cifs_dbg(FYI, ...)
	cFYI(DBG2, ...)  -&gt; cifs_dbg(NOISY, ...)

Move the terminating format newline from the macro to the call site.

Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the
"CIFS VFS: " prefix for VFS messages.

Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y)

$ size fs/cifs/cifs.ko*
   text    data     bss     dec     hex filename
 265245	   2525	    132	 267902	  4167e	fs/cifs/cifs.ko.new
 268359    2525     132  271016   422a8 fs/cifs/cifs.ko.old

Other miscellaneous changes around these conversions:

o Miscellaneous typo fixes
o Add terminating \n's to almost all formats and remove them
  from the macros to be more kernel style like.  A few formats
  previously had defective \n's
o Remove unnecessary OOM messages as kmalloc() calls dump_stack
o Coalesce formats to make grep easier,
  added missing spaces when coalescing formats
o Use %s, __func__ instead of embedded function name
o Removed unnecessary "cifs: " prefixes
o Convert kzalloc with multiply to kcalloc
o Remove unused cifswarn macro

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: remove extraneous newlines from cERROR and cFYI calls</title>
<updated>2012-07-23T21:36:26+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2012-07-23T17:14:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ac3aa2f8ae29c186c4742d15e39712af417c6d68'/>
<id>urn:sha1:ac3aa2f8ae29c186c4742d15e39712af417c6d68</id>
<content type='text'>
Those macros add a newline on their own, so there's not any need to
embed one in the message itself.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>CIFS: Rename *UCS* functions to *UTF16*</title>
<updated>2012-01-19T04:32:33+00:00</updated>
<author>
<name>Steve French</name>
<email>sfrench@us.ibm.com</email>
</author>
<published>2012-01-19T04:32:33+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=acbbb76a26648dfae6fed0989879e40d75692bfc'/>
<id>urn:sha1:acbbb76a26648dfae6fed0989879e40d75692bfc</id>
<content type='text'>
to reflect the unicode encoding used by CIFS protocol.

Signed-off-by: Pavel Shilovsky &lt;piastry@etersoft.ru&gt;
Acked-by: Jeff Layton &lt;jlayton@samba.org&gt;
Reviewed-by: Shirish Pargaonkar &lt;shirishpargaonkar@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: Fix sparse warning when calling cifs_strtoUCS</title>
<updated>2011-11-10T18:48:20+00:00</updated>
<author>
<name>Steve French</name>
<email>sfrench@us.ibm.com</email>
</author>
<published>2011-11-10T18:48:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9c32c63bb70b2fafc3b18bee29959c3bf245ceba'/>
<id>urn:sha1:9c32c63bb70b2fafc3b18bee29959c3bf245ceba</id>
<content type='text'>
Fix sparse endian check warning while calling cifs_strtoUCS

CHECK   fs/cifs/smbencrypt.c
fs/cifs/smbencrypt.c:216:37: warning: incorrect type in argument 1
(different base types)
fs/cifs/smbencrypt.c:216:37:    expected restricted __le16 [usertype] *&lt;noident&gt;
fs/cifs/smbencrypt.c:216:37:    got unsigned short *&lt;noident&gt;

Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Acked-by: Shirish Pargaonkar &lt;shirishpargaonkar@gmail.com
</content>
</entry>
<entry>
<title>cifs: Assume passwords are encoded according to iocharset (try #2)</title>
<updated>2011-10-30T03:06:54+00:00</updated>
<author>
<name>Shirish Pargaonkar</name>
<email>shirishpargaonkar@gmail.com</email>
</author>
<published>2011-10-20T18:21:59+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9ef5992e442b2b0bf6364bfcc5574e983a983159'/>
<id>urn:sha1:9ef5992e442b2b0bf6364bfcc5574e983a983159</id>
<content type='text'>
Re-posting a patch originally posted by Oskar Liljeblad after
rebasing on 3.2.

Modify cifs to assume that the supplied password is encoded according
to iocharset.  Before this patch passwords would be treated as
raw 8-bit data, which made authentication with Unicode passwords impossible
(at least passwords with characters &gt; 0xFF).

The previous code would as a side effect accept passwords encoded with
ISO 8859-1, since Unicode &lt; 0x100 basically is ISO 8859-1.  Software which
relies on that will no longer support password chars &gt; 0x7F unless it also
uses iocharset=iso8859-1.  (mount.cifs does not care about the encoding so
it will work as expected.)

Signed-off-by: Oskar Liljeblad &lt;oskar@osk.mine.nu&gt;
Signed-off-by: Shirish Pargaonkar &lt;shirishpargaonkar@gmail.com&gt;
Reviewed-by: Pavel Shilovsky &lt;piastry@etersoft.ru&gt;
Tested-by: A &lt;nimbus1_03087@yahoo.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: clean up unused encryption code</title>
<updated>2011-10-13T04:42:21+00:00</updated>
<author>
<name>Shirish Pargaonkar</name>
<email>shirishpargaonkar@gmail.com</email>
</author>
<published>2011-09-21T19:33:31+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d02616869221517582dea7972c9b5063ac9a2ae7'/>
<id>urn:sha1:d02616869221517582dea7972c9b5063ac9a2ae7</id>
<content type='text'>
Remove unsed  #if 0 encryption code.

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;
</content>
</entry>
</feed>
