linux/fs/cifs
David Windsor de04644904 cifs: Define usercopy region in cifs_request slab cache
CIFS request buffers, stored in the cifs_request slab cache, need to be
copied to/from userspace.

cache object allocation:
    fs/cifs/cifsfs.c:
        cifs_init_request_bufs():
            ...
            cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,
                                                      cifs_req_cachep);

    fs/cifs/misc.c:
        cifs_buf_get():
            ...
            ret_buf = mempool_alloc(cifs_req_poolp, GFP_NOFS);
            ...
            return ret_buf;

In support of usercopy hardening, this patch defines a region in the
cifs_request slab cache in which userspace copy operations are allowed.

This region is known as the slab cache's usercopy region. Slab caches
can now check that each dynamically sized copy operation involving
cache-managed memory falls entirely within the slab's usercopy region.

This patch is verbatim from Brad Spengler/PaX Team's PAX_USERCOPY
whitelisting code in the last public patch of grsecurity/PaX based on my
understanding of the code. Changes or omissions from the original code are
mine and don't reflect the original grsecurity/PaX code.

Signed-off-by: David Windsor <dave@nullcore.net>
[kees: adjust commit log, provide usage trace]
Cc: Steve French <sfrench@samba.org>
Cc: linux-cifs@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
2018-01-15 12:07:57 -08:00
..
asn1.c
cache.c fscache: remove unused ->now_uncached callback 2017-09-06 17:27:26 -07:00
cifs_debug.c [SMB3] Update session and share information displayed for debugging SMB2/SMB3 2017-09-20 16:46:49 -05:00
cifs_debug.h
cifs_dfs_ref.c
cifs_fs_sb.h Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
cifs_ioctl.h
cifs_spnego.c
cifs_spnego.h
cifs_unicode.c [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
cifs_unicode.h [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
cifs_uniupr.h
cifsacl.c
cifsacl.h
cifsencrypt.c
cifsfs.c cifs: Define usercopy region in cifs_request slab cache 2018-01-15 12:07:57 -08:00
cifsfs.h Update version of cifs module 2017-09-17 23:10:48 -05:00
cifsglob.h Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
cifspdu.h
cifsproto.h cifs: Add support for writing attributes on SMB2+ 2017-09-04 14:03:45 -05:00
cifssmb.c enable xattr support for smb3 and also a bugfix 2017-09-07 16:06:14 -07:00
connect.c cifs: release auth_key.response for reconnect. 2017-09-20 18:46:23 -05:00
dir.c cifs: check MaxPathNameComponentLength != 0 before using it 2017-10-30 02:11:38 -05:00
dns_resolve.c
dns_resolve.h
export.c
file.c cifs: use find_get_pages_range_tag() 2017-11-15 18:21:04 -08:00
fscache.c
fscache.h
inode.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
ioctl.c [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
Kconfig cifs: Select all required crypto modules 2017-10-25 12:57:50 -05:00
link.c [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
misc.c [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
netmisc.c
nterr.c
nterr.h
ntlmssp.h
readdir.c
rfc1002pdu.h
sess.c
smb1ops.c
smb2file.c
smb2glob.h
smb2inode.c
smb2maperror.c cifs: handle large EA requests more gracefully in smb2+ 2017-10-18 11:52:39 -05:00
smb2misc.c
smb2ops.c Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-11-14 10:52:09 -08:00
smb2pdu.c SMB3: Validate negotiate request must always be signed 2017-10-26 12:20:59 -05:00
smb2pdu.h CIFS: SMBD: Fix the definition for SMB2_CHANNEL_RDMA_V1_INVALIDATE 2017-10-18 11:52:39 -05:00
smb2proto.h cifs: handle large EA requests more gracefully in smb2+ 2017-10-18 11:52:39 -05:00
smb2status.h
smb2transport.c Fix encryption labels and lengths for SMB3.1.1 2017-10-18 11:52:39 -05:00
smbencrypt.c
smberr.h
smbfsctl.h
transport.c
winucase.c
xattr.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00