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

Commit

Permalink
Merge tag 'v3.18.127' into XOS-8.1
Browse files Browse the repository at this point in the history
This is the 3.18.127 stable release

* tag 'v3.18.127': (24 commits)
  Linux 3.18.127
  HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges
  new helper: uaccess_kernel()
  ACPI / platform: Add SMB0001 HID to forbidden_id_list
  USB: misc: appledisplay: add 20" Apple Cinema Display
  misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
  usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB
  USB: quirks: Add no-lpm quirk for Raydium touchscreens
  usb: cdc-acm: add entry for Hiro (Conexant) modem
  uio: Fix an Oops on load
  media: v4l: event: Add subscription to list before calling "add" operation
  Revert "Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV"
  SUNRPC: drop pointless static qualifier in xdr_get_next_encode_buffer()
  Revert "Revert "drm/i915: Fix mutex->owner inspection race under DEBUG_MUTEXES""
  zram: close udev startup race condition as default groups
  lib/raid6: Fix arm64 test build
  s390/vdso: add missing FORCE to build targets
  clk: samsung: exynos5420: Enable PERIS clocks for suspend
  fs/exofs: fix potential memory leak in mount option parsing
  um: Give start_idle_thread() a return code
  ...

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
  • Loading branch information
msfjarvis committed Nov 27, 2018
2 parents 8165cf9 + 376f405 commit 591073c
Show file tree
Hide file tree
Showing 23 changed files with 104 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 18
SUBLEVEL = 126
SUBLEVEL = 127
EXTRAVERSION =
NAME = Diseased Newt

Expand Down
6 changes: 3 additions & 3 deletions arch/s390/kernel/vdso32/Makefile
Expand Up @@ -29,7 +29,7 @@ GCOV_PROFILE := n
$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so

# link rule for the .so file, .lds has to be first
$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32)
$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) FORCE
$(call if_changed,vdso32ld)

# strip rule for the .so file
Expand All @@ -38,12 +38,12 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
$(call if_changed,objcopy)

# assembly rules for the .S files
$(obj-vdso32): %.o: %.S
$(obj-vdso32): %.o: %.S FORCE
$(call if_changed_dep,vdso32as)

# actual build commands
quiet_cmd_vdso32ld = VDSO32L $@
cmd_vdso32ld = $(CC) $(c_flags) -Wl,-T $^ -o $@
cmd_vdso32ld = $(CC) $(c_flags) -Wl,-T $(filter %.lds %.o,$^) -o $@
quiet_cmd_vdso32as = VDSO32A $@
cmd_vdso32as = $(CC) $(a_flags) -c -o $@ $<

Expand Down
6 changes: 3 additions & 3 deletions arch/s390/kernel/vdso64/Makefile
Expand Up @@ -29,7 +29,7 @@ GCOV_PROFILE := n
$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so

# link rule for the .so file, .lds has to be first
$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64)
$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) FORCE
$(call if_changed,vdso64ld)

# strip rule for the .so file
Expand All @@ -38,12 +38,12 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
$(call if_changed,objcopy)

# assembly rules for the .S files
$(obj-vdso64): %.o: %.S
$(obj-vdso64): %.o: %.S FORCE
$(call if_changed_dep,vdso64as)

# actual build commands
quiet_cmd_vdso64ld = VDSO64L $@
cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@
cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $(filter %.lds %.o,$^) -o $@
quiet_cmd_vdso64as = VDSO64A $@
cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<

Expand Down
5 changes: 5 additions & 0 deletions arch/um/os-Linux/skas/process.c
Expand Up @@ -694,6 +694,11 @@ int start_idle_thread(void *stack, jmp_buf *switch_buf)
fatal_sigsegv();
}
longjmp(*switch_buf, 1);

/* unreachable */
printk(UM_KERN_ERR "impossible long jump!");
fatal_sigsegv();
return 0;
}

void initial_thread_cb_skas(void (*proc)(void *), void *arg)
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpi_platform.c
Expand Up @@ -29,6 +29,7 @@ static const struct acpi_device_id forbidden_id_list[] = {
{"PNP0200", 0}, /* AT DMA Controller */
{"ACPI0009", 0}, /* IOxAPIC */
{"ACPI000A", 0}, /* IOAPIC */
{"SMB0001", 0}, /* ACPI SMBUS virtual device */
{"", 0},
};

Expand Down
15 changes: 6 additions & 9 deletions drivers/block/zram/zram_drv.c
Expand Up @@ -1207,6 +1207,11 @@ static struct attribute_group zram_disk_attr_group = {
.attrs = zram_disk_attrs,
};

static const struct attribute_group *zram_disk_attr_groups[] = {
&zram_disk_attr_group,
NULL,
};

static int create_device(struct zram *zram, int device_id)
{
struct request_queue *queue;
Expand Down Expand Up @@ -1271,22 +1276,14 @@ static int create_device(struct zram *zram, int device_id)
zram->disk->queue->limits.discard_zeroes_data = 0;
queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zram->disk->queue);

disk_to_dev(zram->disk)->groups = zram_disk_attr_groups;
add_disk(zram->disk);

ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj,
&zram_disk_attr_group);
if (ret < 0) {
pr_warn("Error creating sysfs group");
goto out_free_disk;
}
strlcpy(zram->compressor, default_compressor, sizeof(zram->compressor));
zram->meta = NULL;
zram->max_comp_streams = 1;
return 0;

out_free_disk:
del_gendisk(zram->disk);
put_disk(zram->disk);
out_free_queue:
blk_cleanup_queue(queue);
out:
Expand Down
1 change: 0 additions & 1 deletion drivers/bluetooth/Kconfig
Expand Up @@ -85,7 +85,6 @@ config BT_HCIUART_LL
config BT_HCIUART_3WIRE
bool "Three-wire UART (H5) protocol support"
depends on BT_HCIUART
depends on BT_HCIUART_SERDEV
help
The HCI Three-wire UART Transport Layer makes it possible to
user the Bluetooth HCI over a serial port interface. The HCI
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/samsung/clk-exynos5420.c
Expand Up @@ -273,6 +273,7 @@ static const struct samsung_clk_reg_dump exynos5420_set_clksrc[] = {
{ .offset = SRC_MASK_ISP, .value = 0x11111000, },
{ .offset = GATE_BUS_DISP1, .value = 0xffffffff, },
{ .offset = GATE_IP_PERIC, .value = 0xffffffff, },
{ .offset = GATE_IP_PERIS, .value = 0xffffffff, },
};

static int exynos5420_clk_suspend(void)
Expand Down
13 changes: 13 additions & 0 deletions drivers/hid/uhid.c
Expand Up @@ -12,6 +12,7 @@

#include <linux/atomic.h>
#include <linux/compat.h>
#include <linux/cred.h>
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/hid.h>
Expand All @@ -24,6 +25,7 @@
#include <linux/spinlock.h>
#include <linux/uhid.h>
#include <linux/wait.h>
#include <linux/uaccess.h>

#define UHID_NAME "uhid"
#define UHID_BUFSIZE 32
Expand Down Expand Up @@ -734,6 +736,17 @@ static ssize_t uhid_char_write(struct file *file, const char __user *buffer,

switch (uhid->input_buf.type) {
case UHID_CREATE:
/*
* 'struct uhid_create_req' contains a __user pointer which is
* copied from, so it's unsafe to allow this with elevated
* privileges (e.g. from a setuid binary) or via kernel_write().
*/
if (file->f_cred != current_cred() || uaccess_kernel()) {
pr_err_once("UHID_CREATE from different security context by process %d (%s), this is not allowed.\n",
task_tgid_vnr(current), current->comm);
ret = -EACCES;
goto unlock;
}
ret = uhid_dev_create(uhid, &uhid->input_buf);
break;
case UHID_CREATE2:
Expand Down
43 changes: 24 additions & 19 deletions drivers/media/v4l2-core/v4l2-event.c
Expand Up @@ -194,6 +194,22 @@ int v4l2_event_pending(struct v4l2_fh *fh)
}
EXPORT_SYMBOL_GPL(v4l2_event_pending);

static void __v4l2_event_unsubscribe(struct v4l2_subscribed_event *sev)
{
struct v4l2_fh *fh = sev->fh;
unsigned int i;

lockdep_assert_held(&fh->subscribe_lock);
assert_spin_locked(&fh->vdev->fh_lock);

/* Remove any pending events for this subscription */
for (i = 0; i < sev->in_use; i++) {
list_del(&sev->events[sev_pos(sev, i)].list);
fh->navailable--;
}
list_del(&sev->list);
}

int v4l2_event_subscribe(struct v4l2_fh *fh,
const struct v4l2_event_subscription *sub, unsigned elems,
const struct v4l2_subscribed_event_ops *ops)
Expand Down Expand Up @@ -225,27 +241,23 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,

spin_lock_irqsave(&fh->vdev->fh_lock, flags);
found_ev = v4l2_event_subscribed(fh, sub->type, sub->id);
if (!found_ev)
list_add(&sev->list, &fh->subscribed);
spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);

if (found_ev) {
/* Already listening */
kfree(sev);
goto out_unlock;
}

if (sev->ops && sev->ops->add) {
} else if (sev->ops && sev->ops->add) {
ret = sev->ops->add(sev, elems);
if (ret) {
spin_lock_irqsave(&fh->vdev->fh_lock, flags);
__v4l2_event_unsubscribe(sev);
spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
kfree(sev);
goto out_unlock;
}
}

spin_lock_irqsave(&fh->vdev->fh_lock, flags);
list_add(&sev->list, &fh->subscribed);
spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);

out_unlock:
mutex_unlock(&fh->subscribe_lock);

return ret;
Expand Down Expand Up @@ -280,7 +292,6 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,
{
struct v4l2_subscribed_event *sev;
unsigned long flags;
int i;

if (sub->type == V4L2_EVENT_ALL) {
v4l2_event_unsubscribe_all(fh);
Expand All @@ -292,14 +303,8 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,
spin_lock_irqsave(&fh->vdev->fh_lock, flags);

sev = v4l2_event_subscribed(fh, sub->type, sub->id);
if (sev != NULL) {
/* Remove any pending events for this subscription */
for (i = 0; i < sev->in_use; i++) {
list_del(&sev->events[sev_pos(sev, i)].list);
fh->navailable--;
}
list_del(&sev->list);
}
if (sev != NULL)
__v4l2_event_unsubscribe(sev);

spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);

Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/atmel-ssc.c
Expand Up @@ -129,7 +129,7 @@ static const struct of_device_id atmel_ssc_dt_ids[] = {
MODULE_DEVICE_TABLE(of, atmel_ssc_dt_ids);
#endif

static inline const struct atmel_ssc_platform_data * __init
static inline const struct atmel_ssc_platform_data *
atmel_ssc_get_driver_data(struct platform_device *pdev)
{
if (pdev->dev.of_node) {
Expand Down
7 changes: 5 additions & 2 deletions drivers/uio/uio.c
Expand Up @@ -841,14 +841,17 @@ int __uio_register_device(struct module *owner,
if (ret)
goto err_uio_dev_add_attributes;

info->uio_dev = idev;

if (info->irq && (info->irq != UIO_IRQ_CUSTOM)) {
ret = devm_request_irq(idev->dev, info->irq, uio_interrupt,
info->irq_flags, info->name, idev);
if (ret)
if (ret) {
info->uio_dev = NULL;
goto err_request_irq;
}
}

info->uio_dev = idev;
return 0;

err_request_irq:
Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/class/cdc-acm.c
Expand Up @@ -1729,6 +1729,9 @@ static const struct usb_device_id acm_ids[] = {
{ USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
{ USB_DEVICE(0x0572, 0x1349), /* Hiro (Conexant) USB MODEM H50228 */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
{ USB_DEVICE(0x20df, 0x0001), /* Simtec Electronics Entropy Key */
.driver_info = QUIRK_CONTROL_LINE_STATE, },
{ USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */
Expand Down
8 changes: 8 additions & 0 deletions drivers/usb/core/quirks.c
Expand Up @@ -229,6 +229,9 @@ static const struct usb_device_id usb_quirk_list[] = {
{ USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT |
USB_QUIRK_DELAY_CTRL_MSG },

/* Corsair K70 LUX RGB */
{ USB_DEVICE(0x1b1c, 0x1b33), .driver_info = USB_QUIRK_DELAY_INIT },

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

Expand All @@ -249,6 +252,11 @@ static const struct usb_device_id usb_quirk_list[] = {
{ USB_DEVICE(0x2040, 0x7200), .driver_info =
USB_QUIRK_CONFIG_INTF_STRINGS },

/* Raydium Touchscreen */
{ USB_DEVICE(0x2386, 0x3114), .driver_info = USB_QUIRK_NO_LPM },

{ USB_DEVICE(0x2386, 0x3119), .driver_info = USB_QUIRK_NO_LPM },

/* DJI CineSSD */
{ USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },

Expand Down
1 change: 1 addition & 0 deletions drivers/usb/misc/appledisplay.c
Expand Up @@ -63,6 +63,7 @@ static const struct usb_device_id appledisplay_table[] = {
{ APPLEDISPLAY_DEVICE(0x9219) },
{ APPLEDISPLAY_DEVICE(0x921c) },
{ APPLEDISPLAY_DEVICE(0x921d) },
{ APPLEDISPLAY_DEVICE(0x9222) },
{ APPLEDISPLAY_DEVICE(0x9236) },

/* Terminating entry */
Expand Down
5 changes: 4 additions & 1 deletion fs/exofs/super.c
Expand Up @@ -100,6 +100,7 @@ static int parse_options(char *options, struct exofs_mountopt *opts)
token = match_token(p, tokens, args);
switch (token) {
case Opt_name:
kfree(opts->dev_name);
opts->dev_name = match_strdup(&args[0]);
if (unlikely(!opts->dev_name)) {
EXOFS_ERR("Error allocating dev_name");
Expand Down Expand Up @@ -868,8 +869,10 @@ static struct dentry *exofs_mount(struct file_system_type *type,
int ret;

ret = parse_options(data, &opts);
if (ret)
if (ret) {
kfree(opts.dev_name);
return ERR_PTR(ret);
}

if (!opts.dev_name)
opts.dev_name = dev_name;
Expand Down
4 changes: 4 additions & 0 deletions fs/hfs/brec.c
Expand Up @@ -424,6 +424,10 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd)
if (new_node) {
__be32 cnid;

if (!new_node->parent) {
hfs_btree_inc_height(tree);
new_node->parent = tree->root;
}
fd->bnode = hfs_bnode_find(tree, new_node->parent);
/* create index key and entry */
hfs_bnode_read_key(new_node, fd->search_key, 14);
Expand Down
4 changes: 4 additions & 0 deletions fs/hfsplus/brec.c
Expand Up @@ -427,6 +427,10 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd)
if (new_node) {
__be32 cnid;

if (!new_node->parent) {
hfs_btree_inc_height(tree);
new_node->parent = tree->root;
}
fd->bnode = hfs_bnode_find(tree, new_node->parent);
/* create index key and entry */
hfs_bnode_read_key(new_node, fd->search_key, 14);
Expand Down
7 changes: 7 additions & 0 deletions fs/reiserfs/xattr.c
Expand Up @@ -184,6 +184,7 @@ struct reiserfs_dentry_buf {
struct dir_context ctx;
struct dentry *xadir;
int count;
int err;
struct dentry *dentries[8];
};

Expand All @@ -205,6 +206,7 @@ fill_with_dentries(void *buf, const char *name, int namelen, loff_t offset,

dentry = lookup_one_len(name, dbuf->xadir, namelen);
if (IS_ERR(dentry)) {
dbuf->err = PTR_ERR(dentry);
return PTR_ERR(dentry);
} else if (!dentry->d_inode) {
/* A directory entry exists, but no file? */
Expand All @@ -213,6 +215,7 @@ fill_with_dentries(void *buf, const char *name, int namelen, loff_t offset,
"not found for file %s.\n",
dentry->d_name.name, dbuf->xadir->d_name.name);
dput(dentry);
dbuf->err = -EIO;
return -EIO;
}

Expand Down Expand Up @@ -260,6 +263,10 @@ static int reiserfs_for_each_xattr(struct inode *inode,
err = reiserfs_readdir_inode(dir->d_inode, &buf.ctx);
if (err)
break;
if (buf.err) {
err = buf.err;
break;
}
if (!buf.count)
break;
for (i = 0; !err && i < buf.count && buf.dentries[i]; i++) {
Expand Down
3 changes: 3 additions & 0 deletions include/linux/uaccess.h
Expand Up @@ -2,6 +2,9 @@
#define __LINUX_UACCESS_H__

#include <linux/preempt.h>

#define uaccess_kernel() segment_eq(get_fs(), KERNEL_DS)

#include <asm/uaccess.h>

/*
Expand Down

0 comments on commit 591073c

Please sign in to comment.