This is the 4.9.126 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAluVX/YACgkQONu9yGCS
aT5cHhAApha2JGf7uUZP9pVDBIWh/9il4jkA6w2Fs8pj5RFwTCDtxBe9iNMOloLV
j9mPd2ToEPI4H6Je5clOiLQxkM/tZ2/MQVITLpCM+9lahWB5pOxqC9buAlEYzN0v
NQ9ppUJIakeAJwJJqFxtqhb4tL+hng9BifL57+PPFykFb2xLEcmj8zMXZL5TvaCh
MF+bckiRZgZ8HgoQ2HUC3Jl5x/4QqUjhNBEzCNJ2iC8+h94lE7LoBMiRoC+QF1th
5c3Uqg+vNS/s6FOYlFGEeL2/VvzPYboIqWUFTNb39lws+hGaQ/9Ba5soFpPMuHz4
wLS+fFWuUSWi3XO1Id1imHWFaVAnbAro5vFJ/qvM6j2m3feryI6NCWEyQsEJpoLH
SRt+Lv4lllNgm1I9ieVfEldqyVfHsW6rtp0cV9uRBCgdVMOnOktO0ra1sN25IIA4
97JgOKmrFD/OAOzr5Yz0b3WKseZw+gD4iJwVAFClX9F2n0dWbPHqPPitmxu6iafu
Z1+Pw7V2HmAT2KkaLeSFSOFBa28zbXLzkzdKSabqDr5rPS7tbz4M+Gne7D803K//
sLbRfAm4YM/OirroGVDcFpugGtu4xDmqvkVVpXvjc83CNrqKkX60Jc3kJY9gweiv
v2s+gfTrK0s+tiUcIyKjtBqlBa9jHPfbzkorq3g0ia9ioO8fSWI=
=22ds
-----END PGP SIGNATURE-----
Merge 4.9.126 into android-4.9
Changes in 4.9.126
net: 6lowpan: fix reserved space for single frames
net: mac802154: tx: expand tailroom if necessary
9p/net: Fix zero-copy path in the 9p virtio transport
spi: davinci: fix a NULL pointer dereference
spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe
drm/i915/userptr: reject zero user_size
libertas: fix suspend and resume for SDIO connected cards
mailbox: xgene-slimpro: Fix potential NULL pointer dereference
powerpc/fadump: handle crash memory ranges array index overflow
powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
PCI: Add wrappers for dev_printk()
powerpc/powernv/pci: Work around races in PCI bridge enabling
cxl: Fix wrong comparison in cxl_adapter_context_get()
ib_srpt: Fix a use-after-free in srpt_close_ch()
RDMA/rxe: Set wqe->status correctly if an unexpected response is received
fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
9p/virtio: fix off-by-one error in sg list bounds check
net/9p/client.c: version pointer uninitialized
net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
dm thin: stop no_space_timeout worker when switching to write-mode
dm cache metadata: save in-core policy_hint_size to on-disk superblock
uart: fix race between uart_put_char() and uart_shutdown()
iio: ad9523: Fix displayed phase
iio: ad9523: Fix return value for ad952x_store()
vmw_balloon: fix inflation of 64-bit GFNs
vmw_balloon: do not use 2MB without batching
vmw_balloon: VMCI_DOORBELL_SET does not check status
vmw_balloon: fix VMCI use when balloon built into kernel
rtc: omap: fix potential crash on power off
tracing: Do not call start/stop() functions when tracing_on does not change
tracing/blktrace: Fix to allow setting same value
uprobes: Use synchronize_rcu() not synchronize_sched()
mfd: hi655x: Fix regmap area declared size for hi655x
9p: fix multiple NULL-pointer-dereferences
PM / sleep: wakeup: Fix build error caused by missing SRCU support
KVM: VMX: fixes for vmentry_l1d_flush module parameter
xtensa: limit offsets in __loop_cache_{all,page}
xtensa: increase ranges in ___invalidate_{i,d}cache_all
pnfs/blocklayout: off by one in bl_map_stripe()
NFSv4 client live hangs after live data migration recovery
ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
Replace magic for trusting the secondary keyring with #define
Fix kexec forbidding kernels signed with keys in the secondary keyring to boot
mm/tlb: Remove tlb_remove_table() non-concurrent condition
iommu/vt-d: Add definitions for PFSID
iommu/vt-d: Fix dev iotlb pfsid use
osf_getdomainname(): use copy_to_user()
sys: don't hold uts_sem while accessing userspace memory
userns: move user access out of the mutex
ubifs: Fix memory leak in lprobs self-check
Revert "UBIFS: Fix potential integer overflow in allocation"
ubifs: Check data node size before truncate
ubifs: Fix synced_i_size calculation for xattr inodes
pwm: tiehrpwm: Fix disabling of output of PWMs
fb: fix lost console when the user unplugs a USB adapter
udlfb: set optimal write delay
getxattr: use correct xattr length
libnvdimm: fix ars_status output length calculation
printk/tracing: Do not trace printk_nmi_enter()
bcache: release dc->writeback_lock properly in bch_writeback_thread()
perf auxtrace: Fix queue resize
crypto: vmx - Fix sleep-in-atomic bugs
crypto: caam/jr - fix descriptor DMA unmapping
fs/quota: Fix spectre gadget in do_quotactl
Linux 4.9.126
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
a8c1ea6c63
68 changed files with 665 additions and 339 deletions
2
Makefile
2
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 125
|
||||
SUBLEVEL = 126
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
|
|
|||
|
|
@ -526,24 +526,19 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path,
|
|||
SYSCALL_DEFINE1(osf_utsname, char __user *, name)
|
||||
{
|
||||
int error;
|
||||
char tmp[5 * 32];
|
||||
|
||||
down_read(&uts_sem);
|
||||
error = -EFAULT;
|
||||
if (copy_to_user(name + 0, utsname()->sysname, 32))
|
||||
goto out;
|
||||
if (copy_to_user(name + 32, utsname()->nodename, 32))
|
||||
goto out;
|
||||
if (copy_to_user(name + 64, utsname()->release, 32))
|
||||
goto out;
|
||||
if (copy_to_user(name + 96, utsname()->version, 32))
|
||||
goto out;
|
||||
if (copy_to_user(name + 128, utsname()->machine, 32))
|
||||
goto out;
|
||||
memcpy(tmp + 0 * 32, utsname()->sysname, 32);
|
||||
memcpy(tmp + 1 * 32, utsname()->nodename, 32);
|
||||
memcpy(tmp + 2 * 32, utsname()->release, 32);
|
||||
memcpy(tmp + 3 * 32, utsname()->version, 32);
|
||||
memcpy(tmp + 4 * 32, utsname()->machine, 32);
|
||||
up_read(&uts_sem);
|
||||
|
||||
error = 0;
|
||||
out:
|
||||
up_read(&uts_sem);
|
||||
return error;
|
||||
if (copy_to_user(name, tmp, sizeof(tmp)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE0(getpagesize)
|
||||
|
|
@ -561,24 +556,22 @@ SYSCALL_DEFINE0(getdtablesize)
|
|||
*/
|
||||
SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen)
|
||||
{
|
||||
unsigned len;
|
||||
int i;
|
||||
int len, err = 0;
|
||||
char *kname;
|
||||
char tmp[32];
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, name, namelen))
|
||||
return -EFAULT;
|
||||
|
||||
len = namelen;
|
||||
if (len > 32)
|
||||
len = 32;
|
||||
if (namelen < 0 || namelen > 32)
|
||||
namelen = 32;
|
||||
|
||||
down_read(&uts_sem);
|
||||
for (i = 0; i < len; ++i) {
|
||||
__put_user(utsname()->domainname[i], name + i);
|
||||
if (utsname()->domainname[i] == '\0')
|
||||
break;
|
||||
}
|
||||
kname = utsname()->domainname;
|
||||
len = strnlen(kname, namelen);
|
||||
len = min(len + 1, namelen);
|
||||
memcpy(tmp, kname, len);
|
||||
up_read(&uts_sem);
|
||||
|
||||
if (copy_to_user(name, tmp, len))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -741,13 +734,14 @@ SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count)
|
|||
};
|
||||
unsigned long offset;
|
||||
const char *res;
|
||||
long len, err = -EINVAL;
|
||||
long len;
|
||||
char tmp[__NEW_UTS_LEN + 1];
|
||||
|
||||
offset = command-1;
|
||||
if (offset >= ARRAY_SIZE(sysinfo_table)) {
|
||||
/* Digital UNIX has a few unpublished interfaces here */
|
||||
printk("sysinfo(%d)", command);
|
||||
goto out;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
down_read(&uts_sem);
|
||||
|
|
@ -755,13 +749,11 @@ SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count)
|
|||
len = strlen(res)+1;
|
||||
if ((unsigned long)len > (unsigned long)count)
|
||||
len = count;
|
||||
if (copy_to_user(buf, res, len))
|
||||
err = -EFAULT;
|
||||
else
|
||||
err = 0;
|
||||
memcpy(tmp, res, len);
|
||||
up_read(&uts_sem);
|
||||
out:
|
||||
return err;
|
||||
if (copy_to_user(buf, tmp, len))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer,
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@
|
|||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <0x70>;
|
||||
reset-gpio = <&gpio TEGRA_GPIO(BB, 0) GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -190,9 +190,6 @@ struct fadump_crash_info_header {
|
|||
struct cpumask online_mask;
|
||||
};
|
||||
|
||||
/* Crash memory ranges */
|
||||
#define INIT_CRASHMEM_RANGES (INIT_MEMBLOCK_REGIONS + 2)
|
||||
|
||||
struct fad_crash_memory_ranges {
|
||||
unsigned long long base;
|
||||
unsigned long long size;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include <linux/crash_dump.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <asm/page.h>
|
||||
#include <asm/prom.h>
|
||||
|
|
@ -48,8 +49,10 @@ static struct fadump_mem_struct fdm;
|
|||
static const struct fadump_mem_struct *fdm_active;
|
||||
|
||||
static DEFINE_MUTEX(fadump_mutex);
|
||||
struct fad_crash_memory_ranges crash_memory_ranges[INIT_CRASHMEM_RANGES];
|
||||
struct fad_crash_memory_ranges *crash_memory_ranges;
|
||||
int crash_memory_ranges_size;
|
||||
int crash_mem_ranges;
|
||||
int max_crash_mem_ranges;
|
||||
|
||||
/* Scan the Firmware Assisted dump configuration details. */
|
||||
int __init early_init_dt_scan_fw_dump(unsigned long node,
|
||||
|
|
@ -731,38 +734,88 @@ static int __init process_fadump(const struct fadump_mem_struct *fdm_active)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline void fadump_add_crash_memory(unsigned long long base,
|
||||
unsigned long long end)
|
||||
static void free_crash_memory_ranges(void)
|
||||
{
|
||||
kfree(crash_memory_ranges);
|
||||
crash_memory_ranges = NULL;
|
||||
crash_memory_ranges_size = 0;
|
||||
max_crash_mem_ranges = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate or reallocate crash memory ranges array in incremental units
|
||||
* of PAGE_SIZE.
|
||||
*/
|
||||
static int allocate_crash_memory_ranges(void)
|
||||
{
|
||||
struct fad_crash_memory_ranges *new_array;
|
||||
u64 new_size;
|
||||
|
||||
new_size = crash_memory_ranges_size + PAGE_SIZE;
|
||||
pr_debug("Allocating %llu bytes of memory for crash memory ranges\n",
|
||||
new_size);
|
||||
|
||||
new_array = krealloc(crash_memory_ranges, new_size, GFP_KERNEL);
|
||||
if (new_array == NULL) {
|
||||
pr_err("Insufficient memory for setting up crash memory ranges\n");
|
||||
free_crash_memory_ranges();
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
crash_memory_ranges = new_array;
|
||||
crash_memory_ranges_size = new_size;
|
||||
max_crash_mem_ranges = (new_size /
|
||||
sizeof(struct fad_crash_memory_ranges));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int fadump_add_crash_memory(unsigned long long base,
|
||||
unsigned long long end)
|
||||
{
|
||||
if (base == end)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
if (crash_mem_ranges == max_crash_mem_ranges) {
|
||||
int ret;
|
||||
|
||||
ret = allocate_crash_memory_ranges();
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
pr_debug("crash_memory_range[%d] [%#016llx-%#016llx], %#llx bytes\n",
|
||||
crash_mem_ranges, base, end - 1, (end - base));
|
||||
crash_memory_ranges[crash_mem_ranges].base = base;
|
||||
crash_memory_ranges[crash_mem_ranges].size = end - base;
|
||||
crash_mem_ranges++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void fadump_exclude_reserved_area(unsigned long long start,
|
||||
static int fadump_exclude_reserved_area(unsigned long long start,
|
||||
unsigned long long end)
|
||||
{
|
||||
unsigned long long ra_start, ra_end;
|
||||
int ret = 0;
|
||||
|
||||
ra_start = fw_dump.reserve_dump_area_start;
|
||||
ra_end = ra_start + fw_dump.reserve_dump_area_size;
|
||||
|
||||
if ((ra_start < end) && (ra_end > start)) {
|
||||
if ((start < ra_start) && (end > ra_end)) {
|
||||
fadump_add_crash_memory(start, ra_start);
|
||||
fadump_add_crash_memory(ra_end, end);
|
||||
ret = fadump_add_crash_memory(start, ra_start);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = fadump_add_crash_memory(ra_end, end);
|
||||
} else if (start < ra_start) {
|
||||
fadump_add_crash_memory(start, ra_start);
|
||||
ret = fadump_add_crash_memory(start, ra_start);
|
||||
} else if (ra_end < end) {
|
||||
fadump_add_crash_memory(ra_end, end);
|
||||
ret = fadump_add_crash_memory(ra_end, end);
|
||||
}
|
||||
} else
|
||||
fadump_add_crash_memory(start, end);
|
||||
ret = fadump_add_crash_memory(start, end);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int fadump_init_elfcore_header(char *bufp)
|
||||
|
|
@ -802,10 +855,11 @@ static int fadump_init_elfcore_header(char *bufp)
|
|||
* Traverse through memblock structure and setup crash memory ranges. These
|
||||
* ranges will be used create PT_LOAD program headers in elfcore header.
|
||||
*/
|
||||
static void fadump_setup_crash_memory_ranges(void)
|
||||
static int fadump_setup_crash_memory_ranges(void)
|
||||
{
|
||||
struct memblock_region *reg;
|
||||
unsigned long long start, end;
|
||||
int ret;
|
||||
|
||||
pr_debug("Setup crash memory ranges.\n");
|
||||
crash_mem_ranges = 0;
|
||||
|
|
@ -816,7 +870,9 @@ static void fadump_setup_crash_memory_ranges(void)
|
|||
* specified during fadump registration. We need to create a separate
|
||||
* program header for this chunk with the correct offset.
|
||||
*/
|
||||
fadump_add_crash_memory(RMA_START, fw_dump.boot_memory_size);
|
||||
ret = fadump_add_crash_memory(RMA_START, fw_dump.boot_memory_size);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
for_each_memblock(memory, reg) {
|
||||
start = (unsigned long long)reg->base;
|
||||
|
|
@ -825,8 +881,12 @@ static void fadump_setup_crash_memory_ranges(void)
|
|||
start = fw_dump.boot_memory_size;
|
||||
|
||||
/* add this range excluding the reserved dump area. */
|
||||
fadump_exclude_reserved_area(start, end);
|
||||
ret = fadump_exclude_reserved_area(start, end);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -950,6 +1010,7 @@ static void register_fadump(void)
|
|||
{
|
||||
unsigned long addr;
|
||||
void *vaddr;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* If no memory is reserved then we can not register for firmware-
|
||||
|
|
@ -958,7 +1019,9 @@ static void register_fadump(void)
|
|||
if (!fw_dump.reserve_dump_area_size)
|
||||
return;
|
||||
|
||||
fadump_setup_crash_memory_ranges();
|
||||
ret = fadump_setup_crash_memory_ranges();
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
addr = be64_to_cpu(fdm.rmr_region.destination_address) + be64_to_cpu(fdm.rmr_region.source_len);
|
||||
/* Initialize fadump crash info header. */
|
||||
|
|
@ -1036,6 +1099,7 @@ void fadump_cleanup(void)
|
|||
} else if (fw_dump.dump_registered) {
|
||||
/* Un-register Firmware-assisted dump if it was registered. */
|
||||
fadump_unregister_dump(&fdm);
|
||||
free_crash_memory_ranges();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3124,12 +3124,49 @@ static void pnv_pci_ioda_create_dbgfs(void)
|
|||
#endif /* CONFIG_DEBUG_FS */
|
||||
}
|
||||
|
||||
static void pnv_pci_enable_bridge(struct pci_bus *bus)
|
||||
{
|
||||
struct pci_dev *dev = bus->self;
|
||||
struct pci_bus *child;
|
||||
|
||||
/* Empty bus ? bail */
|
||||
if (list_empty(&bus->devices))
|
||||
return;
|
||||
|
||||
/*
|
||||
* If there's a bridge associated with that bus enable it. This works
|
||||
* around races in the generic code if the enabling is done during
|
||||
* parallel probing. This can be removed once those races have been
|
||||
* fixed.
|
||||
*/
|
||||
if (dev) {
|
||||
int rc = pci_enable_device(dev);
|
||||
if (rc)
|
||||
pci_err(dev, "Error enabling bridge (%d)\n", rc);
|
||||
pci_set_master(dev);
|
||||
}
|
||||
|
||||
/* Perform the same to child busses */
|
||||
list_for_each_entry(child, &bus->children, node)
|
||||
pnv_pci_enable_bridge(child);
|
||||
}
|
||||
|
||||
static void pnv_pci_enable_bridges(void)
|
||||
{
|
||||
struct pci_controller *hose;
|
||||
|
||||
list_for_each_entry(hose, &hose_list, list_node)
|
||||
pnv_pci_enable_bridge(hose->bus);
|
||||
}
|
||||
|
||||
static void pnv_pci_ioda_fixup(void)
|
||||
{
|
||||
pnv_pci_ioda_setup_PEs();
|
||||
pnv_pci_ioda_setup_iommu_api();
|
||||
pnv_pci_ioda_create_dbgfs();
|
||||
|
||||
pnv_pci_enable_bridges();
|
||||
|
||||
#ifdef CONFIG_EEH
|
||||
eeh_init();
|
||||
eeh_addr_cache_build();
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)
|
|||
}
|
||||
|
||||
savep = __va(regs->gpr[3]);
|
||||
regs->gpr[3] = savep[0]; /* restore original r3 */
|
||||
regs->gpr[3] = be64_to_cpu(savep[0]); /* restore original r3 */
|
||||
|
||||
/* If it isn't an extended log we can use the per cpu 64bit buffer */
|
||||
h = (struct rtas_error_log *)&savep[1];
|
||||
|
|
|
|||
|
|
@ -201,23 +201,27 @@ SYSCALL_DEFINE5(rt_sigaction, int, sig,
|
|||
|
||||
asmlinkage long sys_getdomainname(char __user *name, int len)
|
||||
{
|
||||
int nlen, err;
|
||||
|
||||
int nlen, err;
|
||||
char tmp[__NEW_UTS_LEN + 1];
|
||||
|
||||
if (len < 0)
|
||||
return -EINVAL;
|
||||
|
||||
down_read(&uts_sem);
|
||||
|
||||
down_read(&uts_sem);
|
||||
|
||||
nlen = strlen(utsname()->domainname) + 1;
|
||||
err = -EINVAL;
|
||||
if (nlen > len)
|
||||
goto out;
|
||||
goto out_unlock;
|
||||
memcpy(tmp, utsname()->domainname, nlen);
|
||||
|
||||
err = -EFAULT;
|
||||
if (!copy_to_user(name, utsname()->domainname, nlen))
|
||||
err = 0;
|
||||
up_read(&uts_sem);
|
||||
|
||||
out:
|
||||
if (copy_to_user(name, tmp, nlen))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
|
||||
out_unlock:
|
||||
up_read(&uts_sem);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -524,23 +524,27 @@ extern void check_pending(int signum);
|
|||
|
||||
SYSCALL_DEFINE2(getdomainname, char __user *, name, int, len)
|
||||
{
|
||||
int nlen, err;
|
||||
int nlen, err;
|
||||
char tmp[__NEW_UTS_LEN + 1];
|
||||
|
||||
if (len < 0)
|
||||
return -EINVAL;
|
||||
|
||||
down_read(&uts_sem);
|
||||
|
||||
down_read(&uts_sem);
|
||||
|
||||
nlen = strlen(utsname()->domainname) + 1;
|
||||
err = -EINVAL;
|
||||
if (nlen > len)
|
||||
goto out;
|
||||
goto out_unlock;
|
||||
memcpy(tmp, utsname()->domainname, nlen);
|
||||
|
||||
err = -EFAULT;
|
||||
if (!copy_to_user(name, utsname()->domainname, nlen))
|
||||
err = 0;
|
||||
up_read(&uts_sem);
|
||||
|
||||
out:
|
||||
if (copy_to_user(name, tmp, nlen))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
|
||||
out_unlock:
|
||||
up_read(&uts_sem);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ static int bzImage64_cleanup(void *loader_data)
|
|||
static int bzImage64_verify_sig(const char *kernel, unsigned long kernel_len)
|
||||
{
|
||||
return verify_pefile_signature(kernel, kernel_len,
|
||||
NULL,
|
||||
VERIFY_USE_SECONDARY_KEYRING,
|
||||
VERIFYING_KEXEC_PE_SIGNATURE);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -198,12 +198,14 @@ static enum vmx_l1d_flush_state __read_mostly vmentry_l1d_flush_param = VMENTER_
|
|||
|
||||
static const struct {
|
||||
const char *option;
|
||||
enum vmx_l1d_flush_state cmd;
|
||||
bool for_parse;
|
||||
} vmentry_l1d_param[] = {
|
||||
{"auto", VMENTER_L1D_FLUSH_AUTO},
|
||||
{"never", VMENTER_L1D_FLUSH_NEVER},
|
||||
{"cond", VMENTER_L1D_FLUSH_COND},
|
||||
{"always", VMENTER_L1D_FLUSH_ALWAYS},
|
||||
[VMENTER_L1D_FLUSH_AUTO] = {"auto", true},
|
||||
[VMENTER_L1D_FLUSH_NEVER] = {"never", true},
|
||||
[VMENTER_L1D_FLUSH_COND] = {"cond", true},
|
||||
[VMENTER_L1D_FLUSH_ALWAYS] = {"always", true},
|
||||
[VMENTER_L1D_FLUSH_EPT_DISABLED] = {"EPT disabled", false},
|
||||
[VMENTER_L1D_FLUSH_NOT_REQUIRED] = {"not required", false},
|
||||
};
|
||||
|
||||
#define L1D_CACHE_ORDER 4
|
||||
|
|
@ -287,8 +289,9 @@ static int vmentry_l1d_flush_parse(const char *s)
|
|||
|
||||
if (s) {
|
||||
for (i = 0; i < ARRAY_SIZE(vmentry_l1d_param); i++) {
|
||||
if (sysfs_streq(s, vmentry_l1d_param[i].option))
|
||||
return vmentry_l1d_param[i].cmd;
|
||||
if (vmentry_l1d_param[i].for_parse &&
|
||||
sysfs_streq(s, vmentry_l1d_param[i].option))
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -EINVAL;
|
||||
|
|
@ -298,13 +301,13 @@ static int vmentry_l1d_flush_set(const char *s, const struct kernel_param *kp)
|
|||
{
|
||||
int l1tf, ret;
|
||||
|
||||
if (!boot_cpu_has(X86_BUG_L1TF))
|
||||
return 0;
|
||||
|
||||
l1tf = vmentry_l1d_flush_parse(s);
|
||||
if (l1tf < 0)
|
||||
return l1tf;
|
||||
|
||||
if (!boot_cpu_has(X86_BUG_L1TF))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Has vmx_init() run already? If not then this is the pre init
|
||||
* parameter parsing. In that case just store the value and let
|
||||
|
|
@ -324,6 +327,9 @@ static int vmentry_l1d_flush_set(const char *s, const struct kernel_param *kp)
|
|||
|
||||
static int vmentry_l1d_flush_get(char *s, const struct kernel_param *kp)
|
||||
{
|
||||
if (WARN_ON_ONCE(l1tf_vmx_mitigation >= ARRAY_SIZE(vmentry_l1d_param)))
|
||||
return sprintf(s, "???\n");
|
||||
|
||||
return sprintf(s, "%s\n", vmentry_l1d_param[l1tf_vmx_mitigation].option);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,16 +31,32 @@
|
|||
*
|
||||
*/
|
||||
|
||||
.macro __loop_cache_all ar at insn size line_width
|
||||
|
||||
.macro __loop_cache_unroll ar at insn size line_width max_immed
|
||||
|
||||
.if (1 << (\line_width)) > (\max_immed)
|
||||
.set _reps, 1
|
||||
.elseif (2 << (\line_width)) > (\max_immed)
|
||||
.set _reps, 2
|
||||
.else
|
||||
.set _reps, 4
|
||||
.endif
|
||||
|
||||
__loopi \ar, \at, \size, (_reps << (\line_width))
|
||||
.set _index, 0
|
||||
.rep _reps
|
||||
\insn \ar, _index << (\line_width)
|
||||
.set _index, _index + 1
|
||||
.endr
|
||||
__endla \ar, \at, _reps << (\line_width)
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro __loop_cache_all ar at insn size line_width max_immed
|
||||
|
||||
movi \ar, 0
|
||||
|
||||
__loopi \ar, \at, \size, (4 << (\line_width))
|
||||
\insn \ar, 0 << (\line_width)
|
||||
\insn \ar, 1 << (\line_width)
|
||||
\insn \ar, 2 << (\line_width)
|
||||
\insn \ar, 3 << (\line_width)
|
||||
__endla \ar, \at, 4 << (\line_width)
|
||||
__loop_cache_unroll \ar, \at, \insn, \size, \line_width, \max_immed
|
||||
|
||||
.endm
|
||||
|
||||
|
|
@ -57,14 +73,9 @@
|
|||
.endm
|
||||
|
||||
|
||||
.macro __loop_cache_page ar at insn line_width
|
||||
.macro __loop_cache_page ar at insn line_width max_immed
|
||||
|
||||
__loopi \ar, \at, PAGE_SIZE, 4 << (\line_width)
|
||||
\insn \ar, 0 << (\line_width)
|
||||
\insn \ar, 1 << (\line_width)
|
||||
\insn \ar, 2 << (\line_width)
|
||||
\insn \ar, 3 << (\line_width)
|
||||
__endla \ar, \at, 4 << (\line_width)
|
||||
__loop_cache_unroll \ar, \at, \insn, PAGE_SIZE, \line_width, \max_immed
|
||||
|
||||
.endm
|
||||
|
||||
|
|
@ -72,7 +83,8 @@
|
|||
.macro ___unlock_dcache_all ar at
|
||||
|
||||
#if XCHAL_DCACHE_LINE_LOCKABLE && XCHAL_DCACHE_SIZE
|
||||
__loop_cache_all \ar \at diu XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
|
||||
__loop_cache_all \ar \at diu XCHAL_DCACHE_SIZE \
|
||||
XCHAL_DCACHE_LINEWIDTH 240
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
|
@ -81,7 +93,8 @@
|
|||
.macro ___unlock_icache_all ar at
|
||||
|
||||
#if XCHAL_ICACHE_LINE_LOCKABLE && XCHAL_ICACHE_SIZE
|
||||
__loop_cache_all \ar \at iiu XCHAL_ICACHE_SIZE XCHAL_ICACHE_LINEWIDTH
|
||||
__loop_cache_all \ar \at iiu XCHAL_ICACHE_SIZE \
|
||||
XCHAL_ICACHE_LINEWIDTH 240
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
|
@ -90,7 +103,8 @@
|
|||
.macro ___flush_invalidate_dcache_all ar at
|
||||
|
||||
#if XCHAL_DCACHE_SIZE
|
||||
__loop_cache_all \ar \at diwbi XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
|
||||
__loop_cache_all \ar \at diwbi XCHAL_DCACHE_SIZE \
|
||||
XCHAL_DCACHE_LINEWIDTH 240
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
|
@ -99,7 +113,8 @@
|
|||
.macro ___flush_dcache_all ar at
|
||||
|
||||
#if XCHAL_DCACHE_SIZE
|
||||
__loop_cache_all \ar \at diwb XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
|
||||
__loop_cache_all \ar \at diwb XCHAL_DCACHE_SIZE \
|
||||
XCHAL_DCACHE_LINEWIDTH 240
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
|
@ -108,8 +123,8 @@
|
|||
.macro ___invalidate_dcache_all ar at
|
||||
|
||||
#if XCHAL_DCACHE_SIZE
|
||||
__loop_cache_all \ar \at dii __stringify(DCACHE_WAY_SIZE) \
|
||||
XCHAL_DCACHE_LINEWIDTH
|
||||
__loop_cache_all \ar \at dii XCHAL_DCACHE_SIZE \
|
||||
XCHAL_DCACHE_LINEWIDTH 1020
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
|
@ -118,8 +133,8 @@
|
|||
.macro ___invalidate_icache_all ar at
|
||||
|
||||
#if XCHAL_ICACHE_SIZE
|
||||
__loop_cache_all \ar \at iii __stringify(ICACHE_WAY_SIZE) \
|
||||
XCHAL_ICACHE_LINEWIDTH
|
||||
__loop_cache_all \ar \at iii XCHAL_ICACHE_SIZE \
|
||||
XCHAL_ICACHE_LINEWIDTH 1020
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
|
@ -166,7 +181,7 @@
|
|||
.macro ___flush_invalidate_dcache_page ar as
|
||||
|
||||
#if XCHAL_DCACHE_SIZE
|
||||
__loop_cache_page \ar \as dhwbi XCHAL_DCACHE_LINEWIDTH
|
||||
__loop_cache_page \ar \as dhwbi XCHAL_DCACHE_LINEWIDTH 1020
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
|
@ -175,7 +190,7 @@
|
|||
.macro ___flush_dcache_page ar as
|
||||
|
||||
#if XCHAL_DCACHE_SIZE
|
||||
__loop_cache_page \ar \as dhwb XCHAL_DCACHE_LINEWIDTH
|
||||
__loop_cache_page \ar \as dhwb XCHAL_DCACHE_LINEWIDTH 1020
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
|
@ -184,7 +199,7 @@
|
|||
.macro ___invalidate_dcache_page ar as
|
||||
|
||||
#if XCHAL_DCACHE_SIZE
|
||||
__loop_cache_page \ar \as dhi XCHAL_DCACHE_LINEWIDTH
|
||||
__loop_cache_page \ar \as dhi XCHAL_DCACHE_LINEWIDTH 1020
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
|
@ -193,7 +208,7 @@
|
|||
.macro ___invalidate_icache_page ar as
|
||||
|
||||
#if XCHAL_ICACHE_SIZE
|
||||
__loop_cache_page \ar \as ihi XCHAL_ICACHE_LINEWIDTH
|
||||
__loop_cache_page \ar \as ihi XCHAL_ICACHE_LINEWIDTH 1020
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/cred.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/verification.h>
|
||||
#include <keys/asymmetric-type.h>
|
||||
#include <keys/system_keyring.h>
|
||||
#include <crypto/pkcs7.h>
|
||||
|
|
@ -207,7 +208,7 @@ int verify_pkcs7_signature(const void *data, size_t len,
|
|||
|
||||
if (!trusted_keys) {
|
||||
trusted_keys = builtin_trusted_keys;
|
||||
} else if (trusted_keys == (void *)1UL) {
|
||||
} else if (trusted_keys == VERIFY_USE_SECONDARY_KEYRING) {
|
||||
#ifdef CONFIG_SECONDARY_TRUSTED_KEYRING
|
||||
trusted_keys = secondary_trusted_keys;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ static int pkcs7_preparse(struct key_preparsed_payload *prep)
|
|||
|
||||
return verify_pkcs7_signature(NULL, 0,
|
||||
prep->data, prep->datalen,
|
||||
(void *)1UL, usage,
|
||||
VERIFY_USE_SECONDARY_KEYRING, usage,
|
||||
pkcs7_view_content, prep);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,7 +189,8 @@ static void caam_jr_dequeue(unsigned long devarg)
|
|||
BUG_ON(CIRC_CNT(head, tail + i, JOBR_DEPTH) <= 0);
|
||||
|
||||
/* Unmap just-run descriptor so we can post-process */
|
||||
dma_unmap_single(dev, jrp->outring[hw_idx].desc,
|
||||
dma_unmap_single(dev,
|
||||
caam_dma_to_cpu(jrp->outring[hw_idx].desc),
|
||||
jrp->entinfo[sw_idx].desc_size,
|
||||
DMA_TO_DEVICE);
|
||||
|
||||
|
|
|
|||
|
|
@ -111,24 +111,23 @@ static int p8_aes_cbc_encrypt(struct blkcipher_desc *desc,
|
|||
ret = crypto_blkcipher_encrypt(&fallback_desc, dst, src,
|
||||
nbytes);
|
||||
} else {
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
|
||||
blkcipher_walk_init(&walk, dst, src, nbytes);
|
||||
ret = blkcipher_walk_virt(desc, &walk);
|
||||
while ((nbytes = walk.nbytes)) {
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
aes_p8_cbc_encrypt(walk.src.virt.addr,
|
||||
walk.dst.virt.addr,
|
||||
nbytes & AES_BLOCK_MASK,
|
||||
&ctx->enc_key, walk.iv, 1);
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
|
||||
nbytes &= AES_BLOCK_SIZE - 1;
|
||||
ret = blkcipher_walk_done(desc, &walk, nbytes);
|
||||
}
|
||||
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
@ -152,24 +151,23 @@ static int p8_aes_cbc_decrypt(struct blkcipher_desc *desc,
|
|||
ret = crypto_blkcipher_decrypt(&fallback_desc, dst, src,
|
||||
nbytes);
|
||||
} else {
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
|
||||
blkcipher_walk_init(&walk, dst, src, nbytes);
|
||||
ret = blkcipher_walk_virt(desc, &walk);
|
||||
while ((nbytes = walk.nbytes)) {
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
aes_p8_cbc_encrypt(walk.src.virt.addr,
|
||||
walk.dst.virt.addr,
|
||||
nbytes & AES_BLOCK_MASK,
|
||||
&ctx->dec_key, walk.iv, 0);
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
|
||||
nbytes &= AES_BLOCK_SIZE - 1;
|
||||
ret = blkcipher_walk_done(desc, &walk, nbytes);
|
||||
}
|
||||
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -123,32 +123,39 @@ static int p8_aes_xts_crypt(struct blkcipher_desc *desc,
|
|||
ret = enc ? crypto_blkcipher_encrypt(&fallback_desc, dst, src, nbytes) :
|
||||
crypto_blkcipher_decrypt(&fallback_desc, dst, src, nbytes);
|
||||
} else {
|
||||
blkcipher_walk_init(&walk, dst, src, nbytes);
|
||||
|
||||
ret = blkcipher_walk_virt(desc, &walk);
|
||||
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
|
||||
blkcipher_walk_init(&walk, dst, src, nbytes);
|
||||
|
||||
ret = blkcipher_walk_virt(desc, &walk);
|
||||
iv = walk.iv;
|
||||
memset(tweak, 0, AES_BLOCK_SIZE);
|
||||
aes_p8_encrypt(iv, tweak, &ctx->tweak_key);
|
||||
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
|
||||
while ((nbytes = walk.nbytes)) {
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
if (enc)
|
||||
aes_p8_xts_encrypt(walk.src.virt.addr, walk.dst.virt.addr,
|
||||
nbytes & AES_BLOCK_MASK, &ctx->enc_key, NULL, tweak);
|
||||
else
|
||||
aes_p8_xts_decrypt(walk.src.virt.addr, walk.dst.virt.addr,
|
||||
nbytes & AES_BLOCK_MASK, &ctx->dec_key, NULL, tweak);
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
|
||||
nbytes &= AES_BLOCK_SIZE - 1;
|
||||
ret = blkcipher_walk_done(desc, &walk, nbytes);
|
||||
}
|
||||
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -778,6 +778,9 @@ i915_gem_userptr_ioctl(struct drm_device *dev, void *data, struct drm_file *file
|
|||
I915_USERPTR_UNSYNCHRONIZED))
|
||||
return -EINVAL;
|
||||
|
||||
if (!args->user_size)
|
||||
return -EINVAL;
|
||||
|
||||
if (offset_in_page(args->user_ptr | args->user_size))
|
||||
return -EINVAL;
|
||||
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ static ssize_t ad9523_store(struct device *dev,
|
|||
return ret;
|
||||
|
||||
if (!state)
|
||||
return 0;
|
||||
return len;
|
||||
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
switch ((u32)this_attr->address) {
|
||||
|
|
@ -642,7 +642,7 @@ static int ad9523_read_raw(struct iio_dev *indio_dev,
|
|||
code = (AD9523_CLK_DIST_DIV_PHASE_REV(ret) * 3141592) /
|
||||
AD9523_CLK_DIST_DIV_REV(ret);
|
||||
*val = code / 1000000;
|
||||
*val2 = (code % 1000000) * 10;
|
||||
*val2 = code % 1000000;
|
||||
return IIO_VAL_INT_PLUS_MICRO;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -273,6 +273,7 @@ static inline enum comp_state check_ack(struct rxe_qp *qp,
|
|||
case IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE:
|
||||
if (wqe->wr.opcode != IB_WR_RDMA_READ &&
|
||||
wqe->wr.opcode != IB_WR_RDMA_READ_WITH_INV) {
|
||||
wqe->status = IB_WC_FATAL_ERR;
|
||||
return COMPST_ERROR;
|
||||
}
|
||||
reset_retry_counters(qp);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue