linux/net/caif
David Windsor 93070d339d caif: Define usercopy region in caif proto slab cache
The CAIF channel connection request parameters need to be copied to/from
userspace. In support of usercopy hardening, this patch defines a region
in the struct proto slab cache in which userspace copy operations are
allowed.

example usage trace:

    net/caif/caif_socket.c:
        setsockopt(...):
            ...
            copy_from_user(&cf_sk->conn_req.param.data, ..., ol)

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 modified 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: split from network patch, provide usage trace]
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
2018-01-15 12:08:00 -08:00
..
Kconfig Kconfig: replace "--- help ---" with "---help---" 2012-05-07 15:01:22 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
caif_dev.c netns: make struct pernet_operations::id unsigned int 2016-11-18 10:59:15 -05:00
caif_socket.c caif: Define usercopy region in caif proto slab cache 2018-01-15 12:08:00 -08:00
caif_usb.c caif_usb: use target structure member in memset 2014-10-14 16:05:45 -04:00
cfcnfg.c net caif: insert missing spaces in pr_* messages and unbreak multi-line strings 2016-10-28 13:47:33 -04:00
cfctrl.c caif: remove unnecessary break after goto 2014-07-15 16:27:01 -07:00
cfdbgl.c caif: Remove my bouncing email address. 2013-04-23 13:25:51 -04:00
cfdgml.c caif: Remove my bouncing email address. 2013-04-23 13:25:51 -04:00
cffrml.c caif: fix a signedness bug in cfpkt_iterate() 2015-02-20 17:35:14 -05:00
cfmuxl.c caif: replace kmalloc/memset 0 by kzalloc 2014-10-14 16:04:07 -04:00
cfpkt_skbuff.c net: caif: Fix a sleep-in-atomic bug in cfpkt_create_pfx 2017-06-10 18:19:45 -04:00
cfrfml.c net: caif: fix erroneous return value 2016-02-18 14:59:35 -05:00
cfserl.c caif: Remove my bouncing email address. 2013-04-23 13:25:51 -04:00
cfsrvl.c net: Include appropriate header file in caif/cfsrvl.c 2014-02-09 17:32:49 -08:00
cfutill.c caif: Remove my bouncing email address. 2013-04-23 13:25:51 -04:00
cfveil.c caif: Remove my bouncing email address. 2013-04-23 13:25:51 -04:00
cfvidl.c caif: Remove my bouncing email address. 2013-04-23 13:25:51 -04:00
chnl_net.c net: add netlink_ext_ack argument to rtnl_link_ops.changelink 2017-06-26 23:13:22 -04:00