aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compat.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-03-23 11:24:57 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-23 11:31:58 -0400
commit03fe2debbb2771fb90881e4ce8109b09cf772a5c (patch)
treefbaf8738296b2e9dcba81c6daef2d515b6c4948c /include/linux/compat.h
parent6686c459e1449a3ee5f3fd313b0a559ace7a700e (diff)
parentf36b7534b83357cf52e747905de6d65b4f7c2512 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Fun set of conflict resolutions here... For the mac80211 stuff, these were fortunately just parallel adds. Trivially resolved. In drivers/net/phy/phy.c we had a bug fix in 'net' that moved the function phy_disable_interrupts() earlier in the file, whilst in 'net-next' the phy_error() call from this function was removed. In net/ipv4/xfrm4_policy.c, David Ahern's changes to remove the 'rt_table_id' member of rtable collided with a bug fix in 'net' that added a new struct member "rt_mtu_locked" which needs to be copied over here. The mlxsw driver conflict consisted of net-next separating the span code and definitions into separate files, whilst a 'net' bug fix made some changes to that moved code. The mlx5 infiniband conflict resolution was quite non-trivial, the RDMA tree's merge commit was used as a guide here, and here are their notes: ==================== Due to bug fixes found by the syzkaller bot and taken into the for-rc branch after development for the 4.17 merge window had already started being taken into the for-next branch, there were fairly non-trivial merge issues that would need to be resolved between the for-rc branch and the for-next branch. This merge resolves those conflicts and provides a unified base upon which ongoing development for 4.17 can be based. Conflicts: drivers/infiniband/hw/mlx5/main.c - Commit 42cea83f9524 (IB/mlx5: Fix cleanup order on unload) added to for-rc and commit b5ca15ad7e61 (IB/mlx5: Add proper representors support) add as part of the devel cycle both needed to modify the init/de-init functions used by mlx5. To support the new representors, the new functions added by the cleanup patch needed to be made non-static, and the init/de-init list added by the representors patch needed to be modified to match the init/de-init list changes made by the cleanup patch. Updates: drivers/infiniband/hw/mlx5/mlx5_ib.h - Update function prototypes added by representors patch to reflect new function names as changed by cleanup patch drivers/infiniband/hw/mlx5/ib_rep.c - Update init/de-init stage list to match new order from cleanup patch ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/compat.h')
-rw-r--r--include/linux/compat.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 8a9643857c4a..16c3027074a2 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -17,6 +17,7 @@
17#include <linux/if.h> 17#include <linux/if.h>
18#include <linux/fs.h> 18#include <linux/fs.h>
19#include <linux/aio_abi.h> /* for aio_context_t */ 19#include <linux/aio_abi.h> /* for aio_context_t */
20#include <linux/uaccess.h>
20#include <linux/unistd.h> 21#include <linux/unistd.h>
21 22
22#include <asm/compat.h> 23#include <asm/compat.h>
@@ -229,13 +230,13 @@ typedef struct compat_siginfo {
229 short int _addr_lsb; /* Valid LSB of the reported address. */ 230 short int _addr_lsb; /* Valid LSB of the reported address. */
230 /* used when si_code=SEGV_BNDERR */ 231 /* used when si_code=SEGV_BNDERR */
231 struct { 232 struct {
232 short _dummy_bnd; 233 compat_uptr_t _dummy_bnd;
233 compat_uptr_t _lower; 234 compat_uptr_t _lower;
234 compat_uptr_t _upper; 235 compat_uptr_t _upper;
235 } _addr_bnd; 236 } _addr_bnd;
236 /* used when si_code=SEGV_PKUERR */ 237 /* used when si_code=SEGV_PKUERR */
237 struct { 238 struct {
238 short _dummy_pkey; 239 compat_uptr_t _dummy_pkey;
239 u32 _pkey; 240 u32 _pkey;
240 } _addr_pkey; 241 } _addr_pkey;
241 }; 242 };
@@ -550,8 +551,29 @@ asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv,
550asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); 551asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
551 552
552extern int get_compat_sigset(sigset_t *set, const compat_sigset_t __user *compat); 553extern int get_compat_sigset(sigset_t *set, const compat_sigset_t __user *compat);
553extern int put_compat_sigset(compat_sigset_t __user *compat, 554
554 const sigset_t *set, unsigned int size); 555/*
556 * Defined inline such that size can be compile time constant, which avoids
557 * CONFIG_HARDENED_USERCOPY complaining about copies from task_struct
558 */
559static inline int
560put_compat_sigset(compat_sigset_t __user *compat, const sigset_t *set,
561 unsigned int size)
562{
563 /* size <= sizeof(compat_sigset_t) <= sizeof(sigset_t) */
564#ifdef __BIG_ENDIAN
565 compat_sigset_t v;
566 switch (_NSIG_WORDS) {
567 case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3];
568 case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
569 case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
570 case 1: v.sig[1] = (set->sig[0] >> 32); v.sig[0] = set->sig[0];
571 }
572 return copy_to_user(compat, &v, size) ? -EFAULT : 0;
573#else
574 return copy_to_user(compat, set, size) ? -EFAULT : 0;
575#endif
576}
555 577
556asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, 578asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
557 compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes, 579 compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes,