Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…git/stable/linux-stable into XOS-8.1

This is the 3.18.100 stable release

* tag 'v3.18.100' of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (26 commits)
  Linux 3.18.100
  fixup: sctp: verify size of a new chunk in _sctp_make_chunk()
  serial: 8250_pci: Add Brainboxes UC-260 4 port serial device
  usb: usbmon: Read text within supplied buffer size
  USB: usbmon: remove assignment from IS_ERR argument
  usb: quirks: add control message delay for 1b1c:1b20
  staging: android: ashmem: Fix lockdep issue during llseek
  uas: fix comparison for error code
  tty/serial: atmel: add new version check for usart
  serial: sh-sci: prevent lockup on full TTY buffers
  x86: Treat R_X86_64_PLT32 as R_X86_64_PC32
  x86/module: Detect and skip invalid relocations
  scripts: recordmcount: break hardlinks
  ubi: Fix race condition between ubi volume creation and udev
  netfilter: ipv6: fix use-after-free Write in nf_nat_ipv6_manip_pkt
  netfilter: bridge: ebt_among: add missing match size checks
  netfilter: ebtables: CONFIG_COMPAT: don't trust userland offsets
  netfilter: IDLETIMER: be syzkaller friendly
  netfilter: nat: cope with negative port range
  netfilter: x_tables: fix missing timer initialization in xt_LED
  ...
  • Loading branch information
Harsh Shandilya committed Mar 18, 2018
2 parents e4b746d + 5fcd937 commit 020ff42
Show file tree
Hide file tree
Showing 30 changed files with 261 additions and 96 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 18
SUBLEVEL = 99
SUBLEVEL = 100
EXTRAVERSION =
NAME = Diseased Newt

Expand Down
8 changes: 4 additions & 4 deletions arch/mips/kernel/smp-bmips.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ static void bmips_prepare_cpus(unsigned int max_cpus)
return;
}

if (request_irq(IPI0_IRQ, bmips_ipi_interrupt, IRQF_PERCPU,
"smp_ipi0", NULL))
if (request_irq(IPI0_IRQ, bmips_ipi_interrupt,
IRQF_PERCPU | IRQF_NO_SUSPEND, "smp_ipi0", NULL))
panic("Can't request IPI0 interrupt");
if (request_irq(IPI1_IRQ, bmips_ipi_interrupt, IRQF_PERCPU,
"smp_ipi1", NULL))
if (request_irq(IPI1_IRQ, bmips_ipi_interrupt,
IRQF_PERCPU | IRQF_NO_SUSPEND, "smp_ipi1", NULL))
panic("Can't request IPI1 interrupt");
}

Expand Down
22 changes: 21 additions & 1 deletion arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ static DEFINE_MUTEX(mce_chrdev_read_mutex);
rcu_read_lock_sched_held() || \
lockdep_is_held(&mce_chrdev_read_mutex))

/* sysfs synchronization */
static DEFINE_MUTEX(mce_sysfs_mutex);

#define CREATE_TRACE_POINTS
#include <trace/events/mce.h>

Expand Down Expand Up @@ -2183,6 +2186,7 @@ static ssize_t set_ignore_ce(struct device *s,
if (kstrtou64(buf, 0, &new) < 0)
return -EINVAL;

mutex_lock(&mce_sysfs_mutex);
if (mca_cfg.ignore_ce ^ !!new) {
if (new) {
/* disable ce features */
Expand All @@ -2195,6 +2199,8 @@ static ssize_t set_ignore_ce(struct device *s,
on_each_cpu(mce_enable_ce, (void *)1, 1);
}
}
mutex_unlock(&mce_sysfs_mutex);

return size;
}

Expand All @@ -2207,6 +2213,7 @@ static ssize_t set_cmci_disabled(struct device *s,
if (kstrtou64(buf, 0, &new) < 0)
return -EINVAL;

mutex_lock(&mce_sysfs_mutex);
if (mca_cfg.cmci_disabled ^ !!new) {
if (new) {
/* disable cmci */
Expand All @@ -2218,15 +2225,28 @@ static ssize_t set_cmci_disabled(struct device *s,
on_each_cpu(mce_enable_ce, NULL, 1);
}
}
mutex_unlock(&mce_sysfs_mutex);

return size;
}

static ssize_t store_int_with_restart(struct device *s,
struct device_attribute *attr,
const char *buf, size_t size)
{
ssize_t ret = device_store_int(s, attr, buf, size);
unsigned long old_check_interval = check_interval;
ssize_t ret = device_store_ulong(s, attr, buf, size);

if (check_interval == old_check_interval)
return ret;

if (check_interval < 1)
check_interval = 1;

mutex_lock(&mce_sysfs_mutex);
mce_restart();
mutex_unlock(&mce_sysfs_mutex);

return ret;
}

Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/machine_kexec_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ int arch_kexec_apply_relocations_add(const Elf64_Ehdr *ehdr,
goto overflow;
break;
case R_X86_64_PC32:
case R_X86_64_PLT32:
value -= (u64)address;
*(u32 *)location = value;
break;
Expand Down
14 changes: 14 additions & 0 deletions arch/x86/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,28 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
case R_X86_64_NONE:
break;
case R_X86_64_64:
if (*(u64 *)loc != 0)
goto invalid_relocation;
*(u64 *)loc = val;
break;
case R_X86_64_32:
if (*(u32 *)loc != 0)
goto invalid_relocation;
*(u32 *)loc = val;
if (val != *(u32 *)loc)
goto overflow;
break;
case R_X86_64_32S:
if (*(s32 *)loc != 0)
goto invalid_relocation;
*(s32 *)loc = val;
if ((s64)val != *(s32 *)loc)
goto overflow;
break;
case R_X86_64_PC32:
case R_X86_64_PLT32:
if (*(u32 *)loc != 0)
goto invalid_relocation;
val -= (u64)loc;
*(u32 *)loc = val;
#if 0
Expand All @@ -205,6 +214,11 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
}
return 0;

invalid_relocation:
pr_err("x86/modules: Skipping invalid relocation target, existing value is nonzero for type %d, loc %p, val %Lx\n",
(int)ELF64_R_TYPE(rel[i].r_info), loc, val);
return -ENOEXEC;

overflow:
pr_err("overflow in relocation type %d val %Lx\n",
(int)ELF64_R_TYPE(rel[i].r_info), val);
Expand Down
3 changes: 3 additions & 0 deletions arch/x86/tools/relocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,12 @@ static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,
break;

case R_X86_64_PC32:
case R_X86_64_PLT32:
/*
* PC relative relocations don't need to be adjusted unless
* referencing a percpu symbol.
*
* NB: R_X86_64_PLT32 can be treated as R_X86_64_PC32.
*/
if (is_percpu_sym(sym, symname))
add_reloc(&relocs32neg, offset);
Expand Down
4 changes: 3 additions & 1 deletion drivers/input/keyboard/matrix_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,10 @@ static void matrix_keypad_stop(struct input_dev *dev)
{
struct matrix_keypad *keypad = input_get_drvdata(dev);

spin_lock_irq(&keypad->lock);
keypad->stopped = true;
mb();
spin_unlock_irq(&keypad->lock);

flush_work(&keypad->work.work);
/*
* matrix_keypad_scan() will leave IRQs enabled;
Expand Down
15 changes: 10 additions & 5 deletions drivers/mtd/ubi/vmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
vol->last_eb_bytes = vol->usable_leb_size;
}

/* Make volume "available" before it becomes accessible via sysfs */
spin_lock(&ubi->volumes_lock);
ubi->volumes[vol_id] = vol;
ubi->vol_count += 1;
spin_unlock(&ubi->volumes_lock);

/* Register character device for the volume */
cdev_init(&vol->cdev, &ubi_vol_cdev_operations);
vol->cdev.owner = THIS_MODULE;
Expand Down Expand Up @@ -304,11 +310,6 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
if (err)
goto out_sysfs;

spin_lock(&ubi->volumes_lock);
ubi->volumes[vol_id] = vol;
ubi->vol_count += 1;
spin_unlock(&ubi->volumes_lock);

ubi_volume_notify(ubi, vol, UBI_VOLUME_ADDED);
self_check_volumes(ubi);
return err;
Expand All @@ -328,6 +329,10 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
out_cdev:
cdev_del(&vol->cdev);
out_mapping:
spin_lock(&ubi->volumes_lock);
ubi->volumes[vol_id] = NULL;
ubi->vol_count -= 1;
spin_unlock(&ubi->volumes_lock);
if (do_free)
kfree(vol->eba_tbl);
out_acc:
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ qla24xx_abort_sp_done(void *data, void *ptr, int res)
srb_t *sp = (srb_t *)ptr;
struct srb_iocb *abt = &sp->u.iocb_cmd;

del_timer(&sp->u.iocb_cmd.timer);
complete(&abt->u.abt.comp);
}

Expand Down
15 changes: 7 additions & 8 deletions drivers/staging/android/ashmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,24 +334,23 @@ static loff_t ashmem_llseek(struct file *file, loff_t offset, int origin)
mutex_lock(&ashmem_mutex);

if (asma->size == 0) {
ret = -EINVAL;
goto out;
mutex_unlock(&ashmem_mutex);
return -EINVAL;
}

if (!asma->file) {
ret = -EBADF;
goto out;
mutex_unlock(&ashmem_mutex);
return -EBADF;
}

mutex_unlock(&ashmem_mutex);

ret = vfs_llseek(asma->file, offset, origin);
if (ret < 0)
goto out;
return ret;

/** Copy f_pos from backing file, since f_ops->llseek() sets it */
file->f_pos = asma->file->f_pos;

out:
mutex_unlock(&ashmem_mutex);
return ret;
}

Expand Down
11 changes: 11 additions & 0 deletions drivers/tty/serial/8250/8250_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -4981,6 +4981,17 @@ static struct pci_device_id serial_pci_tbl[] = {
{ PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */
pbn_b2_4_115200 },
/*
* BrainBoxes UC-260
*/
{ PCI_VENDOR_ID_INTASHIELD, 0x0D21,
PCI_ANY_ID, PCI_ANY_ID,
PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00,
pbn_b2_4_115200 },
{ PCI_VENDOR_ID_INTASHIELD, 0x0E34,
PCI_ANY_ID, PCI_ANY_ID,
PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00,
pbn_b2_4_115200 },
/*
* Perle PCI-RAS cards
*/
Expand Down
1 change: 1 addition & 0 deletions drivers/tty/serial/atmel_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,7 @@ static void atmel_get_ip_name(struct uart_port *port)
switch (version) {
case 0x302:
case 0x10213:
case 0x10302:
dev_dbg(port->dev, "This version is usart\n");
atmel_port->is_usart = true;
break;
Expand Down
2 changes: 2 additions & 0 deletions drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,8 @@ static void sci_receive_chars(struct uart_port *port)
/* Tell the rest of the system the news. New characters! */
tty_flip_buffer_push(tport);
} else {
/* TTY buffers full; read from RX reg to prevent lockup */
serial_port_in(port, SCxRDR);
serial_port_in(port, SCxSR); /* dummy read */
serial_port_out(port, SCxSR, SCxSR_RDxF_CLEAR(port));
}
Expand Down
4 changes: 4 additions & 0 deletions drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request,

ret = usb_internal_control_msg(dev, pipe, dr, data, size, timeout);

/* Linger a bit, prior to the next control message. */
if (dev->quirks & USB_QUIRK_DELAY_CTRL_MSG)
msleep(200);

kfree(dr);

return ret;
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/core/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ static const struct usb_device_id usb_quirk_list[] = {
USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },

/* Corsair Strafe RGB */
{ USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT },
{ USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT |
USB_QUIRK_DELAY_CTRL_MSG },

/* Corsair K70 LUX */
{ USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT },
Expand Down
Loading

0 comments on commit 020ff42

Please sign in to comment.