mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
Merge remote-tracking branch 'google/android-4.14-stable' into next
* google/android-4.14-stable: ANDROID: android-verity: Prevent double-freeing metadata Linux 4.14.282 bpf: Enlarge offset check value to INT_MAX in bpf_skb_{load,store}_bytes NFSD: Fix possible sleep during nfsd4_release_lockowner() docs: submitting-patches: Fix crossref to 'The canonical patch format' tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe() dm verity: set DM_TARGET_IMMUTABLE feature flag dm stats: add cond_resched when looping over entries dm crypt: make printing of the key constant-time dm integrity: fix error code in dm_integrity_ctr() zsmalloc: fix races between asynchronous zspage free and page migration netfilter: conntrack: re-fetch conntrack after insertion exec: Force single empty string when argv is empty block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency() assoc_array: Fix BUG_ON during garbage collect drivers: i2c: thunderx: Allow driver to work with ACPI defined TWSI controllers net: ftgmac100: Disable hardware checksum on AST2600 net: af_key: check encryption module availability consistency ACPI: sysfs: Fix BERT error region memory mapping ACPI: sysfs: Make sparse happy about address space in use secure_seq: use the 64 bits of the siphash for port offset calculation tcp: change source port randomizarion at connect() time staging: rtl8723bs: prevent ->Ssid overflow in rtw_wx_set_scan() x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests Linux 4.14.281 Reinstate some of "swiotlb: rework "fix info leak with DMA_FROM_DEVICE"" swiotlb: fix info leak with DMA_FROM_DEVICE net: atlantic: verify hw_head_ lies within TX buffer ring net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_probe() ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one() mac80211: fix rx reordering with non explicit / psmp ack policy scsi: qla2xxx: Fix missed DMA unmap for aborted commands perf bench numa: Address compiler error on s390 gpio: mvebu/pwm: Refuse requests with inverted polarity gpio: gpio-vf610: do not touch other bits when set the target bit net: bridge: Clear offload_fwd_mark when passing frame up bridge interface. igb: skip phy status check where unavailable ARM: 9197/1: spectre-bhb: fix loop8 sequence for Thumb2 ARM: 9196/1: spectre-bhb: enable for Cortex-A15 net: af_key: add check for pfkey_broadcast in function pfkey_process NFC: nci: fix sleep in atomic context bugs caused by nci_skb_alloc net/qla3xxx: Fix a test in ql_reset_work() clk: at91: generated: consider range when calculating best rate net: vmxnet3: fix possible NULL pointer dereference in vmxnet3_rq_cleanup() net: vmxnet3: fix possible use-after-free bugs in vmxnet3_rq_alloc_rx_buf() mmc: core: Default to generic_cmd6_time as timeout in __mmc_switch() mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD mmc: core: Specify timeouts for BKOPS and CACHE_FLUSH for eMMC drm/dp/mst: fix a possible memory leak in fetch_monitor_name() perf: Fix sys_perf_event_open() race against self ALSA: wavefront: Proper check of get_user() error ARM: 9191/1: arm/stacktrace, kasan: Silence KASAN warnings in unwind_frame() drbd: remove usage of list iterator variable after loop MIPS: lantiq: check the return value of kzalloc() Input: stmfts - fix reference leak in stmfts_input_open Input: add bounds checking to input_set_capability() um: Cleanup syscall_handler_t definition/cast, fix warning floppy: use a statically allocated error counter
This commit is contained in:
commit
2d15b1d525
@ -133,7 +133,7 @@ as you intend it to.
|
||||
|
||||
The maintainer will thank you if you write your patch description in a
|
||||
form which can be easily pulled into Linux's source code management
|
||||
system, ``git``, as a "commit log". See :ref:`explicit_in_reply_to`.
|
||||
system, ``git``, as a "commit log". See :ref:`the_canonical_patch_format`.
|
||||
|
||||
Solve only one problem per patch. If your description starts to get
|
||||
long, that's a sign that you probably need to split up your patch.
|
||||
|
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 280
|
||||
SUBLEVEL = 282
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
|
@ -1071,7 +1071,7 @@ vector_bhb_loop8_\name:
|
||||
|
||||
@ bhb workaround
|
||||
mov r0, #8
|
||||
3: b . + 4
|
||||
3: W(b) . + 4
|
||||
subs r0, r0, #1
|
||||
bne 3b
|
||||
dsb
|
||||
|
@ -51,17 +51,17 @@ int notrace unwind_frame(struct stackframe *frame)
|
||||
return -EINVAL;
|
||||
|
||||
frame->sp = frame->fp;
|
||||
frame->fp = *(unsigned long *)(fp);
|
||||
frame->pc = *(unsigned long *)(fp + 4);
|
||||
frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp));
|
||||
frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 4));
|
||||
#else
|
||||
/* check current frame pointer is within bounds */
|
||||
if (fp < low + 12 || fp > high - 4)
|
||||
return -EINVAL;
|
||||
|
||||
/* restore the registers from the stack frame */
|
||||
frame->fp = *(unsigned long *)(fp - 12);
|
||||
frame->sp = *(unsigned long *)(fp - 8);
|
||||
frame->pc = *(unsigned long *)(fp - 4);
|
||||
frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 12));
|
||||
frame->sp = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 8));
|
||||
frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 4));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -297,6 +297,7 @@ void cpu_v7_ca15_ibe(void)
|
||||
{
|
||||
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0)))
|
||||
cpu_v7_spectre_v2_init();
|
||||
cpu_v7_spectre_bhb_init();
|
||||
}
|
||||
|
||||
void cpu_v7_bugs_init(void)
|
||||
|
@ -169,6 +169,8 @@ static inline void clkdev_add_sys(const char *dev, unsigned int module,
|
||||
{
|
||||
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
clk->cl.dev_id = dev;
|
||||
clk->cl.con_id = NULL;
|
||||
clk->cl.clk = clk;
|
||||
|
@ -124,6 +124,8 @@ static inline void clkdev_add_gptu(struct device *dev, const char *con,
|
||||
{
|
||||
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
clk->cl.dev_id = dev_name(dev);
|
||||
clk->cl.con_id = con;
|
||||
clk->cl.clk = clk;
|
||||
|
@ -313,6 +313,8 @@ static void clkdev_add_pmu(const char *dev, const char *con, bool deactivate,
|
||||
{
|
||||
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
clk->cl.dev_id = dev;
|
||||
clk->cl.con_id = con;
|
||||
clk->cl.clk = clk;
|
||||
@ -336,6 +338,8 @@ static void clkdev_add_cgu(const char *dev, const char *con,
|
||||
{
|
||||
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
clk->cl.dev_id = dev;
|
||||
clk->cl.con_id = con;
|
||||
clk->cl.clk = clk;
|
||||
@ -354,24 +358,28 @@ static void clkdev_add_pci(void)
|
||||
struct clk *clk_ext = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
|
||||
/* main pci clock */
|
||||
clk->cl.dev_id = "17000000.pci";
|
||||
clk->cl.con_id = NULL;
|
||||
clk->cl.clk = clk;
|
||||
clk->rate = CLOCK_33M;
|
||||
clk->rates = valid_pci_rates;
|
||||
clk->enable = pci_enable;
|
||||
clk->disable = pmu_disable;
|
||||
clk->module = 0;
|
||||
clk->bits = PMU_PCI;
|
||||
clkdev_add(&clk->cl);
|
||||
if (clk) {
|
||||
clk->cl.dev_id = "17000000.pci";
|
||||
clk->cl.con_id = NULL;
|
||||
clk->cl.clk = clk;
|
||||
clk->rate = CLOCK_33M;
|
||||
clk->rates = valid_pci_rates;
|
||||
clk->enable = pci_enable;
|
||||
clk->disable = pmu_disable;
|
||||
clk->module = 0;
|
||||
clk->bits = PMU_PCI;
|
||||
clkdev_add(&clk->cl);
|
||||
}
|
||||
|
||||
/* use internal/external bus clock */
|
||||
clk_ext->cl.dev_id = "17000000.pci";
|
||||
clk_ext->cl.con_id = "external";
|
||||
clk_ext->cl.clk = clk_ext;
|
||||
clk_ext->enable = pci_ext_enable;
|
||||
clk_ext->disable = pci_ext_disable;
|
||||
clkdev_add(&clk_ext->cl);
|
||||
if (clk_ext) {
|
||||
clk_ext->cl.dev_id = "17000000.pci";
|
||||
clk_ext->cl.con_id = "external";
|
||||
clk_ext->cl.clk = clk_ext;
|
||||
clk_ext->enable = pci_ext_enable;
|
||||
clk_ext->disable = pci_ext_disable;
|
||||
clkdev_add(&clk_ext->cl);
|
||||
}
|
||||
}
|
||||
|
||||
/* xway socs can generate clocks on gpio pins */
|
||||
@ -391,9 +399,15 @@ static void clkdev_add_clkout(void)
|
||||
char *name;
|
||||
|
||||
name = kzalloc(sizeof("clkout0"), GFP_KERNEL);
|
||||
if (!name)
|
||||
continue;
|
||||
sprintf(name, "clkout%d", i);
|
||||
|
||||
clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
if (!clk) {
|
||||
kfree(name);
|
||||
continue;
|
||||
}
|
||||
clk->cl.dev_id = "1f103000.cgu";
|
||||
clk->cl.con_id = name;
|
||||
clk->cl.clk = clk;
|
||||
|
@ -442,6 +442,11 @@ void __init xen_msi_init(void)
|
||||
|
||||
x86_msi.setup_msi_irqs = xen_hvm_setup_msi_irqs;
|
||||
x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
|
||||
/*
|
||||
* With XEN PIRQ/Eventchannels in use PCI/MSI[-X] masking is solely
|
||||
* controlled by the hypervisor.
|
||||
*/
|
||||
pci_msi_ignore_mask = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -10,13 +10,12 @@
|
||||
#include <linux/msg.h>
|
||||
#include <linux/shm.h>
|
||||
|
||||
typedef long syscall_handler_t(void);
|
||||
typedef long syscall_handler_t(long, long, long, long, long, long);
|
||||
|
||||
extern syscall_handler_t *sys_call_table[];
|
||||
|
||||
#define EXECUTE_SYSCALL(syscall, regs) \
|
||||
(((long (*)(long, long, long, long, long, long)) \
|
||||
(*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(®s->regs), \
|
||||
(((*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(®s->regs), \
|
||||
UPT_SYSCALL_ARG2(®s->regs), \
|
||||
UPT_SYSCALL_ARG3(®s->regs), \
|
||||
UPT_SYSCALL_ARG4(®s->regs), \
|
||||
|
@ -1682,7 +1682,7 @@ struct bio *bio_copy_kern(struct request_queue *q, void *data, unsigned int len,
|
||||
if (bytes > len)
|
||||
bytes = len;
|
||||
|
||||
page = alloc_page(q->bounce_gfp | gfp_mask);
|
||||
page = alloc_page(q->bounce_gfp | __GFP_ZERO | gfp_mask);
|
||||
if (!page)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -438,18 +438,29 @@ static ssize_t acpi_data_show(struct file *filp, struct kobject *kobj,
|
||||
{
|
||||
struct acpi_data_attr *data_attr;
|
||||
void __iomem *base;
|
||||
ssize_t rc;
|
||||
ssize_t size;
|
||||
|
||||
data_attr = container_of(bin_attr, struct acpi_data_attr, attr);
|
||||
size = data_attr->attr.size;
|
||||
|
||||
base = acpi_os_map_memory(data_attr->addr, data_attr->attr.size);
|
||||
if (offset < 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (offset >= size)
|
||||
return 0;
|
||||
|
||||
if (count > size - offset)
|
||||
count = size - offset;
|
||||
|
||||
base = acpi_os_map_iomem(data_attr->addr, size);
|
||||
if (!base)
|
||||
return -ENOMEM;
|
||||
rc = memory_read_from_buffer(buf, count, &offset, base,
|
||||
data_attr->attr.size);
|
||||
acpi_os_unmap_memory(base, data_attr->attr.size);
|
||||
|
||||
return rc;
|
||||
memcpy_fromio(buf, base + offset, count);
|
||||
|
||||
acpi_os_unmap_iomem(base, size);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static int acpi_bert_data_init(void *th, struct acpi_data_attr *data_attr)
|
||||
|
@ -195,7 +195,7 @@ void tl_release(struct drbd_connection *connection, unsigned int barrier_nr,
|
||||
unsigned int set_size)
|
||||
{
|
||||
struct drbd_request *r;
|
||||
struct drbd_request *req = NULL;
|
||||
struct drbd_request *req = NULL, *tmp = NULL;
|
||||
int expect_epoch = 0;
|
||||
int expect_size = 0;
|
||||
|
||||
@ -249,8 +249,11 @@ void tl_release(struct drbd_connection *connection, unsigned int barrier_nr,
|
||||
* to catch requests being barrier-acked "unexpectedly".
|
||||
* It usually should find the same req again, or some READ preceding it. */
|
||||
list_for_each_entry(req, &connection->transfer_log, tl_requests)
|
||||
if (req->epoch == expect_epoch)
|
||||
if (req->epoch == expect_epoch) {
|
||||
tmp = req;
|
||||
break;
|
||||
}
|
||||
req = list_prepare_entry(tmp, &connection->transfer_log, tl_requests);
|
||||
list_for_each_entry_safe_from(req, r, &connection->transfer_log, tl_requests) {
|
||||
if (req->epoch != expect_epoch)
|
||||
break;
|
||||
|
@ -516,8 +516,8 @@ static unsigned long fdc_busy;
|
||||
static DECLARE_WAIT_QUEUE_HEAD(fdc_wait);
|
||||
static DECLARE_WAIT_QUEUE_HEAD(command_done);
|
||||
|
||||
/* Errors during formatting are counted here. */
|
||||
static int format_errors;
|
||||
/* errors encountered on the current (or last) request */
|
||||
static int floppy_errors;
|
||||
|
||||
/* Format request descriptor. */
|
||||
static struct format_descr format_req;
|
||||
@ -537,7 +537,6 @@ static struct format_descr format_req;
|
||||
static char *floppy_track_buffer;
|
||||
static int max_buffer_sectors;
|
||||
|
||||
static int *errors;
|
||||
typedef void (*done_f)(int);
|
||||
static const struct cont_t {
|
||||
void (*interrupt)(void);
|
||||
@ -1426,7 +1425,7 @@ static int interpret_errors(void)
|
||||
if (DP->flags & FTD_MSG)
|
||||
DPRINT("Over/Underrun - retrying\n");
|
||||
bad = 0;
|
||||
} else if (*errors >= DP->max_errors.reporting) {
|
||||
} else if (floppy_errors >= DP->max_errors.reporting) {
|
||||
print_errors();
|
||||
}
|
||||
if (ST2 & ST2_WC || ST2 & ST2_BC)
|
||||
@ -2049,7 +2048,7 @@ static void bad_flp_intr(void)
|
||||
if (!next_valid_format())
|
||||
return;
|
||||
}
|
||||
err_count = ++(*errors);
|
||||
err_count = ++floppy_errors;
|
||||
INFBOUND(DRWE->badness, err_count);
|
||||
if (err_count > DP->max_errors.abort)
|
||||
cont->done(0);
|
||||
@ -2194,9 +2193,8 @@ static int do_format(int drive, struct format_descr *tmp_format_req)
|
||||
return -EINVAL;
|
||||
}
|
||||
format_req = *tmp_format_req;
|
||||
format_errors = 0;
|
||||
cont = &format_cont;
|
||||
errors = &format_errors;
|
||||
floppy_errors = 0;
|
||||
ret = wait_til_done(redo_format, true);
|
||||
if (ret == -EINTR)
|
||||
return -EINTR;
|
||||
@ -2679,7 +2677,7 @@ static int make_raw_rw_request(void)
|
||||
*/
|
||||
if (!direct ||
|
||||
(indirect * 2 > direct * 3 &&
|
||||
*errors < DP->max_errors.read_track &&
|
||||
floppy_errors < DP->max_errors.read_track &&
|
||||
((!probing ||
|
||||
(DP->read_track & (1 << DRS->probed_format)))))) {
|
||||
max_size = blk_rq_sectors(current_req);
|
||||
@ -2813,7 +2811,7 @@ static int set_next_request(void)
|
||||
if (q) {
|
||||
current_req = blk_fetch_request(q);
|
||||
if (current_req) {
|
||||
current_req->error_count = 0;
|
||||
floppy_errors = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2875,7 +2873,6 @@ do_request:
|
||||
_floppy = floppy_type + DP->autodetect[DRS->probed_format];
|
||||
} else
|
||||
probing = 0;
|
||||
errors = &(current_req->error_count);
|
||||
tmp = make_raw_rw_request();
|
||||
if (tmp < 2) {
|
||||
request_done(tmp);
|
||||
|
@ -692,6 +692,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
|
||||
if (!wait_event_timeout(ibmvtpm->crq_queue.wq,
|
||||
ibmvtpm->rtce_buf != NULL,
|
||||
HZ)) {
|
||||
rc = -ENODEV;
|
||||
dev_err(dev, "CRQ response timed out\n");
|
||||
goto init_irq_cleanup;
|
||||
}
|
||||
|
@ -119,6 +119,10 @@ static void clk_generated_best_diff(struct clk_rate_request *req,
|
||||
tmp_rate = parent_rate;
|
||||
else
|
||||
tmp_rate = parent_rate / div;
|
||||
|
||||
if (tmp_rate < req->min_rate || tmp_rate > req->max_rate)
|
||||
return;
|
||||
|
||||
tmp_diff = abs(req->rate - tmp_rate);
|
||||
|
||||
if (*best_diff < 0 || *best_diff > tmp_diff) {
|
||||
|
@ -694,6 +694,9 @@ static int mvebu_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
|
||||
unsigned long flags;
|
||||
unsigned int on, off;
|
||||
|
||||
if (state->polarity != PWM_POLARITY_NORMAL)
|
||||
return -EINVAL;
|
||||
|
||||
val = (unsigned long long) mvpwm->clk_rate * state->duty_cycle;
|
||||
do_div(val, NSEC_PER_SEC);
|
||||
if (val > UINT_MAX)
|
||||
|
@ -135,9 +135,13 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
|
||||
{
|
||||
struct vf610_gpio_port *port = gpiochip_get_data(chip);
|
||||
unsigned long mask = BIT(gpio);
|
||||
u32 val;
|
||||
|
||||
if (port->sdata && port->sdata->have_paddr)
|
||||
vf610_gpio_writel(mask, port->gpio_base + GPIO_PDDR);
|
||||
if (port->sdata && port->sdata->have_paddr) {
|
||||
val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR);
|
||||
val |= mask;
|
||||
vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR);
|
||||
}
|
||||
|
||||
vf610_gpio_set(chip, gpio, value);
|
||||
|
||||
|
@ -3043,6 +3043,7 @@ static void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr,
|
||||
|
||||
mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port);
|
||||
drm_edid_get_monitor_name(mst_edid, name, namelen);
|
||||
kfree(mst_edid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2793,7 +2793,7 @@ hsw_compute_linetime_wm(const struct intel_crtc_state *cstate)
|
||||
}
|
||||
|
||||
static void intel_read_wm_latency(struct drm_i915_private *dev_priv,
|
||||
uint16_t wm[8])
|
||||
uint16_t wm[])
|
||||
{
|
||||
if (INTEL_GEN(dev_priv) >= 9) {
|
||||
uint32_t val;
|
||||
|
@ -215,6 +215,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev,
|
||||
i2c->adap.bus_recovery_info = &octeon_i2c_recovery_info;
|
||||
i2c->adap.dev.parent = dev;
|
||||
i2c->adap.dev.of_node = pdev->dev.of_node;
|
||||
i2c->adap.dev.fwnode = dev->fwnode;
|
||||
snprintf(i2c->adap.name, sizeof(i2c->adap.name),
|
||||
"Cavium ThunderX i2c adapter at %s", dev_name(dev));
|
||||
i2c_set_adapdata(&i2c->adap, i2c);
|
||||
|
@ -50,6 +50,17 @@ static DEFINE_MUTEX(input_mutex);
|
||||
|
||||
static const struct input_value input_value_sync = { EV_SYN, SYN_REPORT, 1 };
|
||||
|
||||
static const unsigned int input_max_code[EV_CNT] = {
|
||||
[EV_KEY] = KEY_MAX,
|
||||
[EV_REL] = REL_MAX,
|
||||
[EV_ABS] = ABS_MAX,
|
||||
[EV_MSC] = MSC_MAX,
|
||||
[EV_SW] = SW_MAX,
|
||||
[EV_LED] = LED_MAX,
|
||||
[EV_SND] = SND_MAX,
|
||||
[EV_FF] = FF_MAX,
|
||||
};
|
||||
|
||||
static inline int is_event_supported(unsigned int code,
|
||||
unsigned long *bm, unsigned int max)
|
||||
{
|
||||
@ -1915,6 +1926,14 @@ EXPORT_SYMBOL(input_free_device);
|
||||
*/
|
||||
void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code)
|
||||
{
|
||||
if (type < EV_CNT && input_max_code[type] &&
|
||||
code > input_max_code[type]) {
|
||||
pr_err("%s: invalid code %u for type %u\n", __func__, code,
|
||||
type);
|
||||
dump_stack();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case EV_KEY:
|
||||
__set_bit(code, dev->keybit);
|
||||
|
@ -344,11 +344,11 @@ static int stmfts_input_open(struct input_dev *dev)
|
||||
|
||||
err = pm_runtime_get_sync(&sdata->client->dev);
|
||||
if (err < 0)
|
||||
return err;
|
||||
goto out;
|
||||
|
||||
err = i2c_smbus_write_byte(sdata->client, STMFTS_MS_MT_SENSE_ON);
|
||||
if (err)
|
||||
return err;
|
||||
goto out;
|
||||
|
||||
mutex_lock(&sdata->mutex);
|
||||
sdata->running = true;
|
||||
@ -371,7 +371,9 @@ static int stmfts_input_open(struct input_dev *dev)
|
||||
"failed to enable touchkey\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
out:
|
||||
pm_runtime_put_noidle(&sdata->client->dev);
|
||||
return err;
|
||||
}
|
||||
|
||||
static void stmfts_input_close(struct input_dev *dev)
|
||||
|
@ -671,7 +671,7 @@ static int create_linear_device(struct dm_target *ti, dev_t dev,
|
||||
static int android_verity_ctr(struct dm_target *ti, unsigned argc, char **argv)
|
||||
{
|
||||
dev_t uninitialized_var(dev);
|
||||
struct android_metadata *metadata = NULL;
|
||||
struct android_metadata *metadata;
|
||||
int err = 0, i, mode;
|
||||
char *key_id = NULL, *table_ptr, dummy, *target_device;
|
||||
char *verity_table_args[VERITY_TABLE_ARGS + 2 + VERITY_TABLE_OPT_FEC_ARGS];
|
||||
@ -733,7 +733,7 @@ static int android_verity_ctr(struct dm_target *ti, unsigned argc, char **argv)
|
||||
}
|
||||
DMERR("Error while extracting metadata");
|
||||
handle_error();
|
||||
goto free_metadata;
|
||||
return err;
|
||||
}
|
||||
|
||||
if (verity_enabled) {
|
||||
@ -864,11 +864,10 @@ static int android_verity_ctr(struct dm_target *ti, unsigned argc, char **argv)
|
||||
}
|
||||
|
||||
free_metadata:
|
||||
if (metadata) {
|
||||
kfree(metadata->header);
|
||||
kfree(metadata->verity_table);
|
||||
}
|
||||
kfree(metadata->header);
|
||||
kfree(metadata->verity_table);
|
||||
kfree(metadata);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -2950,6 +2950,11 @@ static int crypt_map(struct dm_target *ti, struct bio *bio)
|
||||
return DM_MAPIO_SUBMITTED;
|
||||
}
|
||||
|
||||
static char hex2asc(unsigned char c)
|
||||
{
|
||||
return c + '0' + ((unsigned)(9 - c) >> 4 & 0x27);
|
||||
}
|
||||
|
||||
static void crypt_status(struct dm_target *ti, status_type_t type,
|
||||
unsigned status_flags, char *result, unsigned maxlen)
|
||||
{
|
||||
@ -2968,9 +2973,12 @@ static void crypt_status(struct dm_target *ti, status_type_t type,
|
||||
if (cc->key_size > 0) {
|
||||
if (cc->key_string)
|
||||
DMEMIT(":%u:%s", cc->key_size, cc->key_string);
|
||||
else
|
||||
for (i = 0; i < cc->key_size; i++)
|
||||
DMEMIT("%02x", cc->key[i]);
|
||||
else {
|
||||
for (i = 0; i < cc->key_size; i++) {
|
||||
DMEMIT("%c%c", hex2asc(cc->key[i] >> 4),
|
||||
hex2asc(cc->key[i] & 0xf));
|
||||
}
|
||||
}
|
||||
} else
|
||||
DMEMIT("-");
|
||||
|
||||
|
@ -3156,8 +3156,6 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv)
|
||||
}
|
||||
|
||||
if (should_write_sb) {
|
||||
int r;
|
||||
|
||||
init_journal(ic, 0, ic->journal_sections, 0);
|
||||
r = dm_integrity_failed(ic);
|
||||
if (unlikely(r)) {
|
||||
|
@ -224,6 +224,7 @@ void dm_stats_cleanup(struct dm_stats *stats)
|
||||
atomic_read(&shared->in_flight[READ]),
|
||||
atomic_read(&shared->in_flight[WRITE]));
|
||||
}
|
||||
cond_resched();
|
||||
}
|
||||
dm_stat_free(&s->rcu_head);
|
||||
}
|
||||
@ -312,6 +313,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
|
||||
for (ni = 0; ni < n_entries; ni++) {
|
||||
atomic_set(&s->stat_shared[ni].in_flight[READ], 0);
|
||||
atomic_set(&s->stat_shared[ni].in_flight[WRITE], 0);
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
if (s->n_histogram_entries) {
|
||||
@ -324,6 +326,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
|
||||
for (ni = 0; ni < n_entries; ni++) {
|
||||
s->stat_shared[ni].tmp.histogram = hi;
|
||||
hi += s->n_histogram_entries + 1;
|
||||
cond_resched();
|
||||
}
|
||||
}
|
||||
|
||||
@ -344,6 +347,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
|
||||
for (ni = 0; ni < n_entries; ni++) {
|
||||
p[ni].histogram = hi;
|
||||
hi += s->n_histogram_entries + 1;
|
||||
cond_resched();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -473,6 +477,7 @@ static int dm_stats_list(struct dm_stats *stats, const char *program,
|
||||
}
|
||||
DMEMIT("\n");
|
||||
}
|
||||
cond_resched();
|
||||
}
|
||||
mutex_unlock(&stats->mutex);
|
||||
|
||||
@ -749,6 +754,7 @@ static void __dm_stat_clear(struct dm_stat *s, size_t idx_start, size_t idx_end,
|
||||
local_irq_enable();
|
||||
}
|
||||
}
|
||||
cond_resched();
|
||||
}
|
||||
}
|
||||
|
||||
@ -864,6 +870,8 @@ static int dm_stats_print(struct dm_stats *stats, int id,
|
||||
|
||||
if (unlikely(sz + 1 >= maxlen))
|
||||
goto buffer_overflow;
|
||||
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
if (clear)
|
||||
|
@ -1244,6 +1244,7 @@ EXPORT_SYMBOL_GPL(verity_ctr);
|
||||
|
||||
static struct target_type verity_target = {
|
||||
.name = "verity",
|
||||
.features = DM_TARGET_IMMUTABLE,
|
||||
.version = {1, 4, 0},
|
||||
.module = THIS_MODULE,
|
||||
.ctr = verity_ctr,
|
||||
|
@ -1814,7 +1814,7 @@ static void mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
|
||||
arg == MMC_TRIM_ARG ?
|
||||
INAND_CMD38_ARG_TRIM :
|
||||
INAND_CMD38_ARG_ERASE,
|
||||
0);
|
||||
card->ext_csd.generic_cmd6_time);
|
||||
}
|
||||
if (!err)
|
||||
err = mmc_erase(card, from, nr, arg);
|
||||
@ -1856,7 +1856,7 @@ retry:
|
||||
arg == MMC_SECURE_TRIM1_ARG ?
|
||||
INAND_CMD38_ARG_SECTRIM1 :
|
||||
INAND_CMD38_ARG_SECERASE,
|
||||
0);
|
||||
card->ext_csd.generic_cmd6_time);
|
||||
if (err)
|
||||
goto out_retry;
|
||||
}
|
||||
@ -1874,7 +1874,7 @@ retry:
|
||||
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
||||
INAND_CMD38_ARG_EXT_CSD,
|
||||
INAND_CMD38_ARG_SECTRIM2,
|
||||
0);
|
||||
card->ext_csd.generic_cmd6_time);
|
||||
if (err)
|
||||
goto out_retry;
|
||||
}
|
||||
|
@ -23,7 +23,9 @@
|
||||
#include "host.h"
|
||||
#include "mmc_ops.h"
|
||||
|
||||
#define MMC_OPS_TIMEOUT_MS (10 * 60 * 1000) /* 10 minute timeout */
|
||||
#define MMC_OPS_TIMEOUT_MS (10 * 60 * 1000) /* 10min*/
|
||||
#define MMC_BKOPS_TIMEOUT_MS (120 * 1000) /* 120s */
|
||||
#define MMC_CACHE_FLUSH_TIMEOUT_MS (30 * 1000) /* 30s */
|
||||
|
||||
static const u8 tuning_blk_pattern_4bit[] = {
|
||||
0xff, 0x0f, 0xff, 0x00, 0xff, 0xcc, 0xc3, 0xcc,
|
||||
@ -465,10 +467,6 @@ static int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms,
|
||||
bool busy = false;
|
||||
int retries = 5;
|
||||
|
||||
/* We have an unspecified cmd timeout, use the fallback value. */
|
||||
if (!timeout_ms)
|
||||
timeout_ms = MMC_OPS_TIMEOUT_MS;
|
||||
|
||||
/*
|
||||
* In cases when not allowed to poll by using CMD13 or because we aren't
|
||||
* capable of polling by using ->card_busy(), then rely on waiting the
|
||||
@ -587,14 +585,20 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
|
||||
|
||||
mmc_retune_hold(host);
|
||||
|
||||
if (!timeout_ms) {
|
||||
pr_warn("%s: unspecified timeout for CMD6 - use generic\n",
|
||||
mmc_hostname(host));
|
||||
timeout_ms = card->ext_csd.generic_cmd6_time;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the cmd timeout and the max_busy_timeout of the host are both
|
||||
* specified, let's validate them. A failure means we need to prevent
|
||||
* the host from doing hw busy detection, which is done by converting
|
||||
* to a R1 response instead of a R1B.
|
||||
*/
|
||||
if (timeout_ms && host->max_busy_timeout &&
|
||||
(timeout_ms > host->max_busy_timeout))
|
||||
if (host->max_busy_timeout &&
|
||||
(timeout_ms > host->max_busy_timeout))
|
||||
use_r1b_resp = false;
|
||||
|
||||
mmc_prepare_switch(&cmd, index, value, set, timeout_ms,
|
||||
@ -1061,7 +1065,7 @@ void mmc_start_bkops(struct mmc_card *card, bool from_exception)
|
||||
|
||||
mmc_claim_host(card->host);
|
||||
if (card->ext_csd.raw_bkops_status >= EXT_CSD_BKOPS_LEVEL_2) {
|
||||
timeout = MMC_OPS_TIMEOUT_MS;
|
||||
timeout = MMC_BKOPS_TIMEOUT_MS;
|
||||
use_busy_signal = true;
|
||||
} else {
|
||||
timeout = 0;
|
||||
@ -1105,7 +1109,8 @@ int mmc_flush_cache(struct mmc_card *card)
|
||||
(card->ext_csd.cache_ctrl & 1) &&
|
||||
(!(card->quirks & MMC_QUIRK_CACHE_DISABLE))) {
|
||||
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
||||
EXT_CSD_FLUSH_CACHE, 1, 0);
|
||||
EXT_CSD_FLUSH_CACHE, 1,
|
||||
MMC_CACHE_FLUSH_TIMEOUT_MS);
|
||||
if (err == -ETIMEDOUT) {
|
||||
pr_err("%s: cache flush timeout\n",
|
||||
mmc_hostname(card->host));
|
||||
|
@ -625,6 +625,13 @@ static int hw_atl_b0_hw_ring_tx_head_update(struct aq_hw_s *self,
|
||||
err = -ENXIO;
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
/* Validate that the new hw_head_ is reasonable. */
|
||||
if (hw_head_ >= ring->size) {
|
||||
err = -ENXIO;
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
ring->hw_head = hw_head_;
|
||||
err = aq_hw_err_from_flags(self);
|
||||
|
||||
|
@ -1410,8 +1410,10 @@ static int tulip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
|
||||
/* alloc_etherdev ensures aligned and zeroed private structures */
|
||||
dev = alloc_etherdev (sizeof (*tp));
|
||||
if (!dev)
|
||||
if (!dev) {
|
||||
pci_disable_device(pdev);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) {
|
||||
@ -1789,6 +1791,7 @@ err_out_free_res:
|
||||
|
||||
err_out_free_netdev:
|
||||
free_netdev (dev);
|
||||
pci_disable_device(pdev);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
@ -1845,6 +1845,11 @@ static int ftgmac100_probe(struct platform_device *pdev)
|
||||
/* AST2400 doesn't have working HW checksum generation */
|
||||
if (np && (of_device_is_compatible(np, "aspeed,ast2400-mac")))
|
||||
netdev->hw_features &= ~NETIF_F_HW_CSUM;
|
||||
|
||||
/* AST2600 tx checksum with NCSI is broken */
|
||||
if (priv->use_ncsi && of_device_is_compatible(np, "aspeed,ast2600-mac"))
|
||||
netdev->hw_features &= ~NETIF_F_HW_CSUM;
|
||||
|
||||
if (np && of_get_property(np, "no-hw-checksum", NULL))
|
||||
netdev->hw_features &= ~(NETIF_F_HW_CSUM | NETIF_F_RXCSUM);
|
||||
netdev->features |= netdev->hw_features;
|
||||
|
@ -4622,7 +4622,8 @@ static void igb_watchdog_task(struct work_struct *work)
|
||||
break;
|
||||
}
|
||||
|
||||
if (adapter->link_speed != SPEED_1000)
|
||||
if (adapter->link_speed != SPEED_1000 ||
|
||||
!hw->phy.ops.read_reg)
|
||||
goto no_wait;
|
||||
|
||||
/* wait for Remote receiver status OK */
|
||||
|
@ -3629,7 +3629,8 @@ static void ql_reset_work(struct work_struct *work)
|
||||
qdev->mem_map_registers;
|
||||
unsigned long hw_flags;
|
||||
|
||||
if (test_bit((QL_RESET_PER_SCSI | QL_RESET_START), &qdev->flags)) {
|
||||
if (test_bit(QL_RESET_PER_SCSI, &qdev->flags) ||
|
||||
test_bit(QL_RESET_START, &qdev->flags)) {
|
||||
clear_bit(QL_LINK_MASTER, &qdev->flags);
|
||||
|
||||
/*
|
||||
|
@ -261,7 +261,7 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
|
||||
return -ENOMEM;
|
||||
|
||||
/* Enable pci device */
|
||||
ret = pci_enable_device(pdev);
|
||||
ret = pcim_enable_device(pdev);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "%s: ERROR: failed to enable device\n",
|
||||
__func__);
|
||||
@ -313,8 +313,6 @@ static void stmmac_pci_remove(struct pci_dev *pdev)
|
||||
pcim_iounmap_regions(pdev, BIT(i));
|
||||
break;
|
||||
}
|
||||
|
||||
pci_disable_device(pdev);
|
||||
}
|
||||
|
||||
static int __maybe_unused stmmac_pci_suspend(struct device *dev)
|
||||
|
@ -595,6 +595,7 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx,
|
||||
if (dma_mapping_error(&adapter->pdev->dev,
|
||||
rbi->dma_addr)) {
|
||||
dev_kfree_skb_any(rbi->skb);
|
||||
rbi->skb = NULL;
|
||||
rq->stats.rx_buf_alloc_failure++;
|
||||
break;
|
||||
}
|
||||
@ -619,6 +620,7 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx,
|
||||
if (dma_mapping_error(&adapter->pdev->dev,
|
||||
rbi->dma_addr)) {
|
||||
put_page(rbi->page);
|
||||
rbi->page = NULL;
|
||||
rq->stats.rx_buf_alloc_failure++;
|
||||
break;
|
||||
}
|
||||
@ -1571,6 +1573,10 @@ vmxnet3_rq_cleanup(struct vmxnet3_rx_queue *rq,
|
||||
u32 i, ring_idx;
|
||||
struct Vmxnet3_RxDesc *rxd;
|
||||
|
||||
/* ring has already been cleaned up */
|
||||
if (!rq->rx_ring[0].base)
|
||||
return;
|
||||
|
||||
for (ring_idx = 0; ring_idx < 2; ring_idx++) {
|
||||
for (i = 0; i < rq->rx_ring[ring_idx].size; i++) {
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
|
@ -3639,6 +3639,9 @@ int qlt_abort_cmd(struct qla_tgt_cmd *cmd)
|
||||
|
||||
spin_lock_irqsave(&cmd->cmd_lock, flags);
|
||||
if (cmd->aborted) {
|
||||
if (cmd->sg_mapped)
|
||||
qlt_unmap_sg(vha, cmd);
|
||||
|
||||
spin_unlock_irqrestore(&cmd->cmd_lock, flags);
|
||||
/*
|
||||
* It's normal to see 2 calls in this path:
|
||||
|
@ -1438,9 +1438,11 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
|
||||
|
||||
sec_len = *(pos++); len-= 1;
|
||||
|
||||
if (sec_len>0 && sec_len<=len) {
|
||||
if (sec_len > 0 &&
|
||||
sec_len <= len &&
|
||||
sec_len <= 32) {
|
||||
ssid[ssid_index].SsidLength = sec_len;
|
||||
memcpy(ssid[ssid_index].Ssid, pos, ssid[ssid_index].SsidLength);
|
||||
memcpy(ssid[ssid_index].Ssid, pos, sec_len);
|
||||
/* DBG_871X("%s COMBO_SCAN with specific ssid:%s, %d\n", __func__ */
|
||||
/* , ssid[ssid_index].Ssid, ssid[ssid_index].SsidLength); */
|
||||
ssid_index++;
|
||||
|
17
fs/exec.c
17
fs/exec.c
@ -1799,6 +1799,9 @@ static int do_execveat_common(int fd, struct filename *filename,
|
||||
goto out_unmark;
|
||||
|
||||
bprm->argc = count(argv, MAX_ARG_STRINGS);
|
||||
if (bprm->argc == 0)
|
||||
pr_warn_once("process '%s' launched '%s' with NULL argv: empty string added\n",
|
||||
current->comm, bprm->filename);
|
||||
if ((retval = bprm->argc) < 0)
|
||||
goto out;
|
||||
|
||||
@ -1823,6 +1826,20 @@ static int do_execveat_common(int fd, struct filename *filename,
|
||||
if (retval < 0)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* When argv is empty, add an empty string ("") as argv[0] to
|
||||
* ensure confused userspace programs that start processing
|
||||
* from argv[1] won't end up walking envp. See also
|
||||
* bprm_stack_limits().
|
||||
*/
|
||||
if (bprm->argc == 0) {
|
||||
const char *argv[] = { "", NULL };
|
||||
retval = copy_strings_kernel(1, argv, bprm);
|
||||
if (retval < 0)
|
||||
goto out;
|
||||
bprm->argc = 1;
|
||||
}
|
||||
|
||||
retval = exec_binprm(bprm);
|
||||
if (retval < 0)
|
||||
goto out;
|
||||
|
@ -6351,16 +6351,12 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp,
|
||||
if (sop->so_is_open_owner || !same_owner_str(sop, owner))
|
||||
continue;
|
||||
|
||||
/* see if there are still any locks associated with it */
|
||||
lo = lockowner(sop);
|
||||
list_for_each_entry(stp, &sop->so_stateids, st_perstateowner) {
|
||||
if (check_for_locks(stp->st_stid.sc_file, lo)) {
|
||||
status = nfserr_locks_held;
|
||||
spin_unlock(&clp->cl_lock);
|
||||
return status;
|
||||
}
|
||||
if (atomic_read(&sop->so_count) != 1) {
|
||||
spin_unlock(&clp->cl_lock);
|
||||
return nfserr_locks_held;
|
||||
}
|
||||
|
||||
lo = lockowner(sop);
|
||||
nfs4_get_stateowner(sop);
|
||||
break;
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ static inline void sk_rcv_saddr_set(struct sock *sk, __be32 addr)
|
||||
}
|
||||
|
||||
int __inet_hash_connect(struct inet_timewait_death_row *death_row,
|
||||
struct sock *sk, u32 port_offset,
|
||||
struct sock *sk, u64 port_offset,
|
||||
int (*check_established)(struct inet_timewait_death_row *,
|
||||
struct sock *, __u16,
|
||||
struct inet_timewait_sock **));
|
||||
|
@ -74,8 +74,13 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)
|
||||
int ret = NF_ACCEPT;
|
||||
|
||||
if (ct) {
|
||||
if (!nf_ct_is_confirmed(ct))
|
||||
if (!nf_ct_is_confirmed(ct)) {
|
||||
ret = __nf_conntrack_confirm(skb);
|
||||
|
||||
if (ret == NF_ACCEPT)
|
||||
ct = (struct nf_conn *)skb_nfct(skb);
|
||||
}
|
||||
|
||||
if (likely(ret == NF_ACCEPT))
|
||||
nf_ct_deliver_cached_events(ct);
|
||||
}
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
|
||||
u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
|
||||
u64 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
|
||||
u64 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
|
||||
__be16 dport);
|
||||
u32 secure_tcp_seq(__be32 saddr, __be32 daddr,
|
||||
__be16 sport, __be16 dport);
|
||||
|
@ -10652,6 +10652,9 @@ SYSCALL_DEFINE5(perf_event_open,
|
||||
* Do not allow to attach to a group in a different task
|
||||
* or CPU context. If we're moving SW events, we'll fix
|
||||
* this up later, so allow that.
|
||||
*
|
||||
* Racy, not holding group_leader->ctx->mutex, see comment with
|
||||
* perf_event_ctx_lock().
|
||||
*/
|
||||
if (!move_group && group_leader->ctx != ctx)
|
||||
goto err_context;
|
||||
@ -10701,11 +10704,22 @@ SYSCALL_DEFINE5(perf_event_open,
|
||||
} else {
|
||||
perf_event_ctx_unlock(group_leader, gctx);
|
||||
move_group = 0;
|
||||
goto not_move_group;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mutex_lock(&ctx->mutex);
|
||||
|
||||
/*
|
||||
* Now that we hold ctx->lock, (re)validate group_leader->ctx == ctx,
|
||||
* see the group_leader && !move_group test earlier.
|
||||
*/
|
||||
if (group_leader && group_leader->ctx != ctx) {
|
||||
err = -EINVAL;
|
||||
goto err_locked;
|
||||
}
|
||||
}
|
||||
not_move_group:
|
||||
|
||||
if (ctx->task == TASK_TOMBSTONE) {
|
||||
err = -ESRCH;
|
||||
|
@ -1478,6 +1478,7 @@ int assoc_array_gc(struct assoc_array *array,
|
||||
struct assoc_array_ptr *cursor, *ptr;
|
||||
struct assoc_array_ptr *new_root, *new_parent, **new_ptr_pp;
|
||||
unsigned long nr_leaves_on_tree;
|
||||
bool retained;
|
||||
int keylen, slot, nr_free, next_slot, i;
|
||||
|
||||
pr_devel("-->%s()\n", __func__);
|
||||
@ -1554,6 +1555,7 @@ continue_node:
|
||||
goto descend;
|
||||
}
|
||||
|
||||
retry_compress:
|
||||
pr_devel("-- compress node %p --\n", new_n);
|
||||
|
||||
/* Count up the number of empty slots in this node and work out the
|
||||
@ -1571,6 +1573,7 @@ continue_node:
|
||||
pr_devel("free=%d, leaves=%lu\n", nr_free, new_n->nr_leaves_on_branch);
|
||||
|
||||
/* See what we can fold in */
|
||||
retained = false;
|
||||
next_slot = 0;
|
||||
for (slot = 0; slot < ASSOC_ARRAY_FAN_OUT; slot++) {
|
||||
struct assoc_array_shortcut *s;
|
||||
@ -1620,9 +1623,14 @@ continue_node:
|
||||
pr_devel("[%d] retain node %lu/%d [nx %d]\n",
|
||||
slot, child->nr_leaves_on_branch, nr_free + 1,
|
||||
next_slot);
|
||||
retained = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (retained && new_n->nr_leaves_on_branch <= ASSOC_ARRAY_FAN_OUT) {
|
||||
pr_devel("internal nodes remain despite enough space, retrying\n");
|
||||
goto retry_compress;
|
||||
}
|
||||
pr_devel("after: %lu\n", new_n->nr_leaves_on_branch);
|
||||
|
||||
nr_leaves_on_tree = new_n->nr_leaves_on_branch;
|
||||
|
@ -600,10 +600,14 @@ found:
|
||||
*/
|
||||
for (i = 0; i < nslots; i++)
|
||||
io_tlb_orig_addr[index+i] = orig_addr + (i << IO_TLB_SHIFT);
|
||||
if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC) &&
|
||||
(dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL))
|
||||
swiotlb_bounce(orig_addr, tlb_addr, size, DMA_TO_DEVICE);
|
||||
|
||||
/*
|
||||
* When dir == DMA_FROM_DEVICE we could omit the copy from the orig
|
||||
* to the tlb buffer, if we knew for sure the device will
|
||||
* overwirte the entire current content. But we don't. Thus
|
||||
* unconditional bounce may prevent leaking swiotlb content (i.e.
|
||||
* kernel memory) to user-space.
|
||||
*/
|
||||
swiotlb_bounce(orig_addr, tlb_addr, size, DMA_TO_DEVICE);
|
||||
return tlb_addr;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(swiotlb_tbl_map_single);
|
||||
|
@ -47,6 +47,13 @@ static int br_pass_frame_up(struct sk_buff *skb)
|
||||
u64_stats_update_end(&brstats->syncp);
|
||||
|
||||
vg = br_vlan_group_rcu(br);
|
||||
|
||||
/* Reset the offload_fwd_mark because there could be a stacked
|
||||
* bridge above, and it should not think this bridge it doing
|
||||
* that bridge's work forwarding out its ports.
|
||||
*/
|
||||
br_switchdev_frame_unmark(skb);
|
||||
|
||||
/* Bridge is just like any other port. Make sure the
|
||||
* packet is allowed except in promisc modue when someone
|
||||
* may be running packet capture.
|
||||
|
@ -1443,7 +1443,7 @@ BPF_CALL_5(bpf_skb_store_bytes, struct sk_buff *, skb, u32, offset,
|
||||
|
||||
if (unlikely(flags & ~(BPF_F_RECOMPUTE_CSUM | BPF_F_INVALIDATE_HASH)))
|
||||
return -EINVAL;
|
||||
if (unlikely(offset > 0xffff))
|
||||
if (unlikely(offset > INT_MAX))
|
||||
return -EFAULT;
|
||||
if (unlikely(bpf_try_make_writable(skb, offset + len)))
|
||||
return -EFAULT;
|
||||
@ -1478,7 +1478,7 @@ BPF_CALL_4(bpf_skb_load_bytes, const struct sk_buff *, skb, u32, offset,
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
if (unlikely(offset > 0xffff))
|
||||
if (unlikely(offset > INT_MAX))
|
||||
goto err_clear;
|
||||
|
||||
ptr = skb_header_pointer(skb, offset, len, to);
|
||||
|
@ -96,7 +96,7 @@ u32 secure_tcpv6_seq(const __be32 *saddr, const __be32 *daddr,
|
||||
}
|
||||
EXPORT_SYMBOL(secure_tcpv6_seq);
|
||||
|
||||
u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
|
||||
u64 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
|
||||
__be16 dport)
|
||||
{
|
||||
const struct {
|
||||
@ -145,7 +145,7 @@ u32 secure_tcp_seq(__be32 saddr, __be32 daddr,
|
||||
return seq_scale(hash);
|
||||
}
|
||||
|
||||
u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport)
|
||||
u64 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport)
|
||||
{
|
||||
net_secret_init();
|
||||
return siphash_4u32((__force u32)saddr, (__force u32)daddr,
|
||||
|
@ -389,7 +389,7 @@ not_unique:
|
||||
return -EADDRNOTAVAIL;
|
||||
}
|
||||
|
||||
static u32 inet_sk_port_offset(const struct sock *sk)
|
||||
static u64 inet_sk_port_offset(const struct sock *sk)
|
||||
{
|
||||
const struct inet_sock *inet = inet_sk(sk);
|
||||
|
||||
@ -587,8 +587,19 @@ void inet_unhash(struct sock *sk)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(inet_unhash);
|
||||
|
||||
/* RFC 6056 3.3.4. Algorithm 4: Double-Hash Port Selection Algorithm
|
||||
* Note that we use 32bit integers (vs RFC 'short integers')
|
||||
* because 2^16 is not a multiple of num_ephemeral and this
|
||||
* property might be used by clever attacker.
|
||||
* RFC claims using TABLE_LENGTH=10 buckets gives an improvement,
|
||||
* we use 256 instead to really give more isolation and
|
||||
* privacy, this only consumes 1 KB of kernel memory.
|
||||
*/
|
||||
#define INET_TABLE_PERTURB_SHIFT 8
|
||||
static u32 table_perturb[1 << INET_TABLE_PERTURB_SHIFT];
|
||||
|
||||
int __inet_hash_connect(struct inet_timewait_death_row *death_row,
|
||||
struct sock *sk, u32 port_offset,
|
||||
struct sock *sk, u64 port_offset,
|
||||
int (*check_established)(struct inet_timewait_death_row *,
|
||||
struct sock *, __u16, struct inet_timewait_sock **))
|
||||
{
|
||||
@ -600,7 +611,7 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
|
||||
struct inet_bind_bucket *tb;
|
||||
u32 remaining, offset;
|
||||
int ret, i, low, high;
|
||||
static u32 hint;
|
||||
u32 index;
|
||||
|
||||
if (port) {
|
||||
head = &hinfo->bhash[inet_bhashfn(net, port,
|
||||
@ -625,7 +636,12 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
|
||||
if (likely(remaining > 1))
|
||||
remaining &= ~1U;
|
||||
|
||||
offset = (hint + port_offset) % remaining;
|
||||
net_get_random_once(table_perturb, sizeof(table_perturb));
|
||||
index = hash_32(port_offset, INET_TABLE_PERTURB_SHIFT);
|
||||
|
||||
offset = READ_ONCE(table_perturb[index]) + port_offset;
|
||||
offset %= remaining;
|
||||
|
||||
/* In first pass we try ports of @low parity.
|
||||
* inet_csk_get_port() does the opposite choice.
|
||||
*/
|
||||
@ -678,7 +694,7 @@ next_port:
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
ok:
|
||||
hint += i + 2;
|
||||
WRITE_ONCE(table_perturb[index], READ_ONCE(table_perturb[index]) + i + 2);
|
||||
|
||||
/* Head lock still held and bh's disabled */
|
||||
inet_bind_hash(sk, tb, port);
|
||||
@ -701,7 +717,7 @@ ok:
|
||||
int inet_hash_connect(struct inet_timewait_death_row *death_row,
|
||||
struct sock *sk)
|
||||
{
|
||||
u32 port_offset = 0;
|
||||
u64 port_offset = 0;
|
||||
|
||||
if (!inet_sk(sk)->inet_num)
|
||||
port_offset = inet_sk_port_offset(sk);
|
||||
|
@ -248,7 +248,7 @@ not_unique:
|
||||
return -EADDRNOTAVAIL;
|
||||
}
|
||||
|
||||
static u32 inet6_sk_port_offset(const struct sock *sk)
|
||||
static u64 inet6_sk_port_offset(const struct sock *sk)
|
||||
{
|
||||
const struct inet_sock *inet = inet_sk(sk);
|
||||
|
||||
@ -260,7 +260,7 @@ static u32 inet6_sk_port_offset(const struct sock *sk)
|
||||
int inet6_hash_connect(struct inet_timewait_death_row *death_row,
|
||||
struct sock *sk)
|
||||
{
|
||||
u32 port_offset = 0;
|
||||
u64 port_offset = 0;
|
||||
|
||||
if (!inet_sk(sk)->inet_num)
|
||||
port_offset = inet6_sk_port_offset(sk);
|
||||
|
@ -2834,8 +2834,10 @@ static int pfkey_process(struct sock *sk, struct sk_buff *skb, const struct sadb
|
||||
void *ext_hdrs[SADB_EXT_MAX];
|
||||
int err;
|
||||
|
||||
pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL,
|
||||
BROADCAST_PROMISC_ONLY, NULL, sock_net(sk));
|
||||
err = pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL,
|
||||
BROADCAST_PROMISC_ONLY, NULL, sock_net(sk));
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
memset(ext_hdrs, 0, sizeof(ext_hdrs));
|
||||
err = parse_exthdrs(skb, hdr, ext_hdrs);
|
||||
@ -2906,7 +2908,7 @@ static int count_ah_combs(const struct xfrm_tmpl *t)
|
||||
break;
|
||||
if (!aalg->pfkey_supported)
|
||||
continue;
|
||||
if (aalg_tmpl_set(t, aalg))
|
||||
if (aalg_tmpl_set(t, aalg) && aalg->available)
|
||||
sz += sizeof(struct sadb_comb);
|
||||
}
|
||||
return sz + sizeof(struct sadb_prop);
|
||||
@ -2924,7 +2926,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)
|
||||
if (!ealg->pfkey_supported)
|
||||
continue;
|
||||
|
||||
if (!(ealg_tmpl_set(t, ealg)))
|
||||
if (!(ealg_tmpl_set(t, ealg) && ealg->available))
|
||||
continue;
|
||||
|
||||
for (k = 1; ; k++) {
|
||||
@ -2935,7 +2937,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)
|
||||
if (!aalg->pfkey_supported)
|
||||
continue;
|
||||
|
||||
if (aalg_tmpl_set(t, aalg))
|
||||
if (aalg_tmpl_set(t, aalg) && aalg->available)
|
||||
sz += sizeof(struct sadb_comb);
|
||||
}
|
||||
}
|
||||
|
@ -1204,8 +1204,7 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx,
|
||||
goto dont_reorder;
|
||||
|
||||
/* not part of a BA session */
|
||||
if (ack_policy != IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK &&
|
||||
ack_policy != IEEE80211_QOS_CTL_ACK_POLICY_NORMAL)
|
||||
if (ack_policy == IEEE80211_QOS_CTL_ACK_POLICY_NOACK)
|
||||
goto dont_reorder;
|
||||
|
||||
/* new, potentially un-ordered, ampdu frame - process it */
|
||||
|
@ -130,7 +130,7 @@ static int nci_queue_tx_data_frags(struct nci_dev *ndev,
|
||||
|
||||
skb_frag = nci_skb_alloc(ndev,
|
||||
(NCI_DATA_HDR_SIZE + frag_len),
|
||||
GFP_KERNEL);
|
||||
GFP_ATOMIC);
|
||||
if (skb_frag == NULL) {
|
||||
rc = -ENOMEM;
|
||||
goto free_exit;
|
||||
|
@ -165,7 +165,7 @@ static int nci_hci_send_data(struct nci_dev *ndev, u8 pipe,
|
||||
|
||||
i = 0;
|
||||
skb = nci_skb_alloc(ndev, conn_info->max_pkt_payload_len +
|
||||
NCI_DATA_HDR_SIZE, GFP_KERNEL);
|
||||
NCI_DATA_HDR_SIZE, GFP_ATOMIC);
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -198,7 +198,7 @@ static int nci_hci_send_data(struct nci_dev *ndev, u8 pipe,
|
||||
if (i < data_len) {
|
||||
skb = nci_skb_alloc(ndev,
|
||||
conn_info->max_pkt_payload_len +
|
||||
NCI_DATA_HDR_SIZE, GFP_KERNEL);
|
||||
NCI_DATA_HDR_SIZE, GFP_ATOMIC);
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -1092,7 +1092,8 @@ wavefront_send_sample (snd_wavefront_t *dev,
|
||||
|
||||
if (dataptr < data_end) {
|
||||
|
||||
__get_user (sample_short, dataptr);
|
||||
if (get_user(sample_short, dataptr))
|
||||
return -EFAULT;
|
||||
dataptr += skip;
|
||||
|
||||
if (data_is_unsigned) { /* GUS ? */
|
||||
|
@ -1631,7 +1631,7 @@ static int __bench_numa(const char *name)
|
||||
"GB/sec,", "total-speed", "GB/sec total speed");
|
||||
|
||||
if (g->p.show_details >= 2) {
|
||||
char tname[14 + 2 * 10 + 1];
|
||||
char tname[14 + 2 * 11 + 1];
|
||||
struct thread_data *td;
|
||||
for (p = 0; p < g->p.nr_proc; p++) {
|
||||
for (t = 0; t < g->p.nr_threads; t++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user