Refreshed all patches.
Remove upstreamed:
- 096-mips-math-emu-Write-protect-delay-slot-emulation-pages.patch
Altered patches:
- 024-7-net-reorganize-struct-sock-for-better-data-locality.patch
Compile-tested on: ar7
Runtime-tested on: none
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
LINUX_RELEASE?=1
LINUX_VERSION-3.18 = .132
-LINUX_VERSION-4.9 = .148
+LINUX_VERSION-4.9 = .150
LINUX_VERSION-4.14 = .93
LINUX_VERSION-4.19 = .9
LINUX_KERNEL_HASH-3.18.132 = c187bd0322372bd34c862cbb06a1996a63524ccb401466362b57ede45901a879
-LINUX_KERNEL_HASH-4.9.148 = 6067151b0225a8de1ab79abc9be7bae237eaca0cd838eb26684169560d88a994
+LINUX_KERNEL_HASH-4.9.150 = 94cc177ba2b433e4e30fefef38de33248ba1e2499ebda905096a8822097117e4
LINUX_KERNEL_HASH-4.14.93 = bb125fb204f7089782e179126121dd0f0aad9f02b7517ce3744982254c221bad
LINUX_KERNEL_HASH-4.19.9 = fc116cc6829c73944215d3b3ac0fc368dde9e8235b456744afffde001269dbf2
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
-@@ -688,6 +688,8 @@ static int bcm2835_spi_setup(struct spi_
+@@ -686,6 +686,8 @@ static int bcm2835_spi_setup(struct spi_
{
int err;
struct gpio_chip *chip;
/*
* sanity checking the native-chipselects
*/
-@@ -704,15 +706,42 @@ static int bcm2835_spi_setup(struct spi_
+@@ -702,15 +704,42 @@ static int bcm2835_spi_setup(struct spi_
"setup: only two native chip-selects are supported\n");
return -EINVAL;
}
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
-@@ -707,6 +707,7 @@ static int bcm2835_spi_setup(struct spi_
+@@ -705,6 +705,7 @@ static int bcm2835_spi_setup(struct spi_
return -EINVAL;
}
/* now translate native cs to GPIO */
/* first look for chip select pins in the devices pin groups */
for (pingroup_index = 0;
-@@ -756,6 +757,7 @@ static int bcm2835_spi_setup(struct spi_
+@@ -754,6 +755,7 @@ static int bcm2835_spi_setup(struct spi_
spi->chip_select, spi->cs_gpio, err);
return err;
}
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
-@@ -679,17 +679,8 @@ static void bcm2835_spi_set_cs(struct sp
+@@ -677,17 +677,8 @@ static void bcm2835_spi_set_cs(struct sp
bcm2835_wr(bs, BCM2835_SPI_CS, cs);
}
/*
* sanity checking the native-chipselects
*/
-@@ -707,58 +698,6 @@ static int bcm2835_spi_setup(struct spi_
+@@ -705,58 +696,6 @@ static int bcm2835_spi_setup(struct spi_
return -EINVAL;
}
--- a/include/net/sock.h
+++ b/include/net/sock.h
-@@ -343,6 +343,9 @@ struct sock {
+@@ -344,6 +344,9 @@ struct sock {
#define sk_rxhash __sk_common.skc_rxhash
socket_lock_t sk_lock;
struct sk_buff_head sk_receive_queue;
/*
* The backlog queue is special, it is always used with
-@@ -359,14 +362,13 @@ struct sock {
+@@ -360,14 +363,13 @@ struct sock {
struct sk_buff *tail;
} sk_backlog;
#define sk_rmem_alloc sk_backlog.rmem_alloc
int sk_rcvbuf;
struct sk_filter __rcu *sk_filter;
-@@ -379,11 +381,30 @@ struct sock {
+@@ -380,11 +382,30 @@ struct sock {
#endif
struct dst_entry *sk_rx_dst;
struct dst_entry __rcu *sk_dst_cache;
/*
* Because of non atomicity rules, all
-@@ -399,41 +420,23 @@ struct sock {
+@@ -400,31 +421,17 @@ struct sock {
#define SK_PROTOCOL_MAX U8_MAX
kmemcheck_bitfield_end(flags);
- long sk_sndtimeo;
- struct timer_list sk_timer;
ktime_t sk_stamp;
- u16 sk_tsflags;
- u8 sk_shutdown;
+ #if BITS_PER_LONG==32
+ seqlock_t sk_stamp_seq;
+@@ -434,10 +441,6 @@ struct sock {
u32 sk_tskey;
struct socket *sk_socket;
void *sk_user_data;
* @sk_lingertime: %SO_LINGER l_linger setting
* @sk_backlog: always used with the per-socket spinlock held
* @sk_callback_lock: used with the callbacks in the end of this struct
-@@ -421,6 +422,8 @@ struct sock {
+@@ -422,6 +423,8 @@ struct sock {
kmemcheck_bitfield_end(flags);
u16 sk_gso_max_segs;
rwlock_t sk_callback_lock;
--- a/net/core/sock.c
+++ b/net/core/sock.c
-@@ -2475,6 +2475,7 @@ void sock_init_data(struct socket *sock,
+@@ -2478,6 +2478,7 @@ void sock_init_data(struct socket *sock,
sk->sk_max_pacing_rate = ~0U;
sk->sk_pacing_rate = ~0U;
"NAPI Complete, did %d packets with budget %d\n",
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
-@@ -658,7 +658,7 @@ static int xgene_enet_napi(struct napi_s
+@@ -655,7 +655,7 @@ static int xgene_enet_napi(struct napi_s
processed = xgene_enet_process_ring(ring, budget);
if (processed != budget) {
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
-@@ -1320,7 +1320,7 @@ restart_poll:
+@@ -1324,7 +1324,7 @@ restart_poll:
ibmveth_replenish_task(adapter);
if (frames_processed < budget) {
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
-@@ -957,7 +957,7 @@ static void init_tel_txopt(struct ipv6_t
+@@ -958,7 +958,7 @@ static void init_tel_txopt(struct ipv6_t
opt->dst_opt[5] = IPV6_TLV_PADN;
opt->dst_opt[6] = 1;
opt->ops.opt_nflen = 8;
}
-@@ -1199,7 +1199,7 @@ route_lookup:
+@@ -1200,7 +1200,7 @@ route_lookup:
if (encap_limit >= 0) {
init_tel_txopt(&opt, encap_limit);
+++ /dev/null
-From adcc81f148d733b7e8e641300c5590a2cdc13bf3 Mon Sep 17 00:00:00 2001
-From: Paul Burton <paul.burton@mips.com>
-Date: Thu, 20 Dec 2018 17:45:43 +0000
-Subject: MIPS: math-emu: Write-protect delay slot emulation pages
-
-Mapping the delay slot emulation page as both writeable & executable
-presents a security risk, in that if an exploit can write to & jump into
-the page then it can be used as an easy way to execute arbitrary code.
-
-Prevent this by mapping the page read-only for userland, and using
-access_process_vm() with the FOLL_FORCE flag to write to it from
-mips_dsemul().
-
-This will likely be less efficient due to copy_to_user_page() performing
-cache maintenance on a whole page, rather than a single line as in the
-previous use of flush_cache_sigtramp(). However this delay slot
-emulation code ought not to be running in any performance critical paths
-anyway so this isn't really a problem, and we can probably do better in
-copy_to_user_page() anyway in future.
-
-A major advantage of this approach is that the fix is small & simple to
-backport to stable kernels.
-
-Reported-by: Andy Lutomirski <luto@kernel.org>
-Signed-off-by: Paul Burton <paul.burton@mips.com>
-Fixes: 432c6bacbd0c ("MIPS: Use per-mm page to execute branch delay slot instructions")
-Cc: stable@vger.kernel.org # v4.8+
-Cc: linux-mips@vger.kernel.org
-Cc: linux-kernel@vger.kernel.org
-Cc: Rich Felker <dalias@libc.org>
-Cc: David Daney <david.daney@cavium.com>
----
- arch/mips/kernel/vdso.c | 4 ++--
- arch/mips/math-emu/dsemul.c | 38 ++++++++++++++++++++------------------
- 2 files changed, 22 insertions(+), 20 deletions(-)
-
---- a/arch/mips/kernel/vdso.c
-+++ b/arch/mips/kernel/vdso.c
-@@ -111,8 +111,8 @@ int arch_setup_additional_pages(struct l
-
- /* Map delay slot emulation page */
- base = mmap_region(NULL, STACK_TOP, PAGE_SIZE,
-- VM_READ|VM_WRITE|VM_EXEC|
-- VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC,
-+ VM_READ | VM_EXEC |
-+ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC,
- 0);
- if (IS_ERR_VALUE(base)) {
- ret = base;
---- a/arch/mips/math-emu/dsemul.c
-+++ b/arch/mips/math-emu/dsemul.c
-@@ -211,8 +211,9 @@ int mips_dsemul(struct pt_regs *regs, mi
- {
- int isa16 = get_isa16_mode(regs->cp0_epc);
- mips_instruction break_math;
-- struct emuframe __user *fr;
-- int err, fr_idx;
-+ unsigned long fr_uaddr;
-+ struct emuframe fr;
-+ int fr_idx, ret;
-
- /* NOP is easy */
- if (ir == 0)
-@@ -247,27 +248,31 @@ int mips_dsemul(struct pt_regs *regs, mi
- fr_idx = alloc_emuframe();
- if (fr_idx == BD_EMUFRAME_NONE)
- return SIGBUS;
-- fr = &dsemul_page()[fr_idx];
-
- /* Retrieve the appropriately encoded break instruction */
- break_math = BREAK_MATH(isa16);
-
- /* Write the instructions to the frame */
- if (isa16) {
-- err = __put_user(ir >> 16,
-- (u16 __user *)(&fr->emul));
-- err |= __put_user(ir & 0xffff,
-- (u16 __user *)((long)(&fr->emul) + 2));
-- err |= __put_user(break_math >> 16,
-- (u16 __user *)(&fr->badinst));
-- err |= __put_user(break_math & 0xffff,
-- (u16 __user *)((long)(&fr->badinst) + 2));
-+ union mips_instruction _emul = {
-+ .halfword = { ir >> 16, ir }
-+ };
-+ union mips_instruction _badinst = {
-+ .halfword = { break_math >> 16, break_math }
-+ };
-+
-+ fr.emul = _emul.word;
-+ fr.badinst = _badinst.word;
- } else {
-- err = __put_user(ir, &fr->emul);
-- err |= __put_user(break_math, &fr->badinst);
-+ fr.emul = ir;
-+ fr.badinst = break_math;
- }
-
-- if (unlikely(err)) {
-+ /* Write the frame to user memory */
-+ fr_uaddr = (unsigned long)&dsemul_page()[fr_idx];
-+ ret = access_process_vm(current, fr_uaddr, &fr, sizeof(fr),
-+ FOLL_FORCE | FOLL_WRITE);
-+ if (unlikely(ret != sizeof(fr))) {
- MIPS_FPU_EMU_INC_STATS(errors);
- free_emuframe(fr_idx, current->mm);
- return SIGBUS;
-@@ -279,10 +284,7 @@ int mips_dsemul(struct pt_regs *regs, mi
- atomic_set(¤t->thread.bd_emu_frame, fr_idx);
-
- /* Change user register context to execute the frame */
-- regs->cp0_epc = (unsigned long)&fr->emul | isa16;
--
-- /* Ensure the icache observes our newly written frame */
-- flush_cache_sigtramp((unsigned long)&fr->emul);
-+ regs->cp0_epc = fr_uaddr | isa16;
-
- return 0;
- }
arch/arm/mach-cns3xxx/pcie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c
-index 5e11ad3164e0..95a11d5b3587 100644
--- a/arch/arm/mach-cns3xxx/pcie.c
+++ b/arch/arm/mach-cns3xxx/pcie.c
-@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
+@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struc
u32 mask = (0x1ull << (size * 8)) - 1;
int shift = (where % 4) * 8;
if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn &&
(where & 0xffc) == PCI_CLASS_REVISION)
---
-2.17.1
-
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
-@@ -1312,6 +1312,9 @@ int genphy_update_link(struct phy_device
+@@ -1309,6 +1309,9 @@ int genphy_update_link(struct phy_device
{
int status;
--- a/net/core/sock.c
+++ b/net/core/sock.c
-@@ -3084,6 +3084,8 @@ static __net_initdata struct pernet_oper
+@@ -3087,6 +3087,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{
+
config SPI_ATMEL_QUADSPI
tristate "Atmel Quad SPI Controller"
- depends on ARCH_AT91 || (ARM && COMPILE_TEST)
+ depends on ARCH_AT91 || (ARM && COMPILE_TEST && !ARCH_EBSA110)
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1648,10 +1648,12 @@ int spi_nor_scan(struct spi_nor *nor, co
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
-@@ -3262,6 +3264,7 @@ static int packet_create(struct net *net
+@@ -3266,6 +3268,7 @@ static int packet_create(struct net *net
mutex_init(&po->pg_vec_lock);
po->rollover = NULL;
po->prot_hook.func = packet_rcv;
if (sock->type == SOCK_PACKET)
po->prot_hook.func = packet_rcv_spkt;
-@@ -3875,6 +3878,16 @@ packet_setsockopt(struct socket *sock, i
+@@ -3879,6 +3882,16 @@ packet_setsockopt(struct socket *sock, i
po->xmit = val ? packet_direct_xmit : dev_queue_xmit;
return 0;
}
default:
return -ENOPROTOOPT;
}
-@@ -3927,6 +3940,13 @@ static int packet_getsockopt(struct sock
+@@ -3931,6 +3944,13 @@ static int packet_getsockopt(struct sock
case PACKET_VNET_HDR:
val = po->has_vnet_hdr;
break;
__skb_tunnel_rx(skb, tunnel->dev, tunnel->net);
err = dscp_ecn_decapsulate(tunnel, ipv6h, skb);
-@@ -961,6 +1100,7 @@ static void init_tel_txopt(struct ipv6_t
+@@ -962,6 +1101,7 @@ static void init_tel_txopt(struct ipv6_t
opt->ops.opt_nflen = 8;
}
/**
* ip6_tnl_addr_conflict - compare packet addresses to tunnel's own
* @t: the outgoing tunnel device
-@@ -1299,6 +1439,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1300,6 +1440,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
{
struct ip6_tnl *t = netdev_priv(dev);
struct ipv6hdr *ipv6h;
int encap_limit = -1;
__u16 offset;
struct flowi6 fl6;
-@@ -1361,6 +1502,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1362,6 +1503,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
fl6.flowi6_mark = skb->mark;
}
if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
return -1;
-@@ -1488,6 +1641,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
+@@ -1489,6 +1642,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
t->parms.flowinfo = p->flowinfo;
t->parms.link = p->link;
t->parms.proto = p->proto;
dst_cache_reset(&t->dst_cache);
ip6_tnl_link_config(t);
return 0;
-@@ -1526,6 +1687,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
+@@ -1527,6 +1688,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
p->flowinfo = u->flowinfo;
p->link = u->link;
p->proto = u->proto;
memcpy(p->name, u->name, sizeof(u->name));
}
-@@ -1903,6 +2065,15 @@ static int ip6_tnl_validate(struct nlatt
+@@ -1904,6 +2066,15 @@ static int ip6_tnl_validate(struct nlatt
return 0;
}
static void ip6_tnl_netlink_parms(struct nlattr *data[],
struct __ip6_tnl_parm *parms)
{
-@@ -1937,6 +2108,46 @@ static void ip6_tnl_netlink_parms(struct
+@@ -1938,6 +2109,46 @@ static void ip6_tnl_netlink_parms(struct
if (data[IFLA_IPTUN_COLLECT_METADATA])
parms->collect_md = true;
}
static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[],
-@@ -2050,6 +2261,12 @@ static void ip6_tnl_dellink(struct net_d
+@@ -2051,6 +2262,12 @@ static void ip6_tnl_dellink(struct net_d
static size_t ip6_tnl_get_size(const struct net_device *dev)
{
return
/* IFLA_IPTUN_LINK */
nla_total_size(4) +
-@@ -2077,6 +2294,24 @@ static size_t ip6_tnl_get_size(const str
+@@ -2078,6 +2295,24 @@ static size_t ip6_tnl_get_size(const str
nla_total_size(2) +
/* IFLA_IPTUN_COLLECT_METADATA */
nla_total_size(0) +
0;
}
-@@ -2084,6 +2319,9 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2085,6 +2320,9 @@ static int ip6_tnl_fill_info(struct sk_b
{
struct ip6_tnl *tunnel = netdev_priv(dev);
struct __ip6_tnl_parm *parm = &tunnel->parms;
if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
-@@ -2092,9 +2330,27 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2093,9 +2331,27 @@ static int ip6_tnl_fill_info(struct sk_b
nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) ||
nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) ||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) ||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) ||
-@@ -2132,6 +2388,7 @@ static const struct nla_policy ip6_tnl_p
+@@ -2133,6 +2389,7 @@ static const struct nla_policy ip6_tnl_p
[IFLA_IPTUN_ENCAP_SPORT] = { .type = NLA_U16 },
[IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 },
[IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG },
static inline const char *rtn_type(char *buf, size_t len, unsigned int t)
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
-@@ -157,6 +157,7 @@ static int ipmr_rule_action(struct fib_r
+@@ -159,6 +159,7 @@ static int ipmr_rule_action(struct fib_r
case FR_ACT_UNREACHABLE:
return -ENETUNREACH;
case FR_ACT_PROHIBIT:
tb_id = fib_rule_get_table(rule, arg);
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
-@@ -167,6 +167,8 @@ static int ip6mr_rule_action(struct fib_
+@@ -169,6 +169,8 @@ static int ip6mr_rule_action(struct fib_
return -ENETUNREACH;
case FR_ACT_PROHIBIT:
return -EACCES;
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
-@@ -1001,6 +1001,9 @@ void phy_detach(struct phy_device *phyde
+@@ -998,6 +998,9 @@ void phy_detach(struct phy_device *phyde
struct mii_bus *bus;
int i;