From: Greg Kroah-Hartman Date: Tue, 27 Nov 2018 17:54:02 +0000 (+0100) Subject: Merge 4.14.84 into android-4.14 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0e1d81608a8a514ebb779dada806dbf228baba01;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Merge 4.14.84 into android-4.14 Changes in 4.14.84 cifs: don't dereference smb_file_target before null check cifs: fix return value for cifs_listxattr arm64: kprobe: make page to RO mode when allocate it ixgbe: fix MAC anti-spoofing filter after VFLR reiserfs: propagate errors from fill_with_dentries() properly hfs: prevent btree data loss on root split hfsplus: prevent btree data loss on root split um: Give start_idle_thread() a return code drm/edid: Add 6 bpc quirk for BOE panel. platform/x86: intel_telemetry: report debugfs failure clk: fixed-rate: fix of_node_get-put imbalance perf symbols: Set PLT entry/header sizes properly on Sparc fs/exofs: fix potential memory leak in mount option parsing clk: samsung: exynos5420: Enable PERIS clocks for suspend apparmor: Fix uninitialized value in aa_split_fqname x86/earlyprintk: Add a force option for pciserial device platform/x86: acerhdf: Add BIOS entry for Gateway LT31 v1.3307 arm64: percpu: Initialize ret in the default case s390/vdso: add missing FORCE to build targets netfilter: ipset: list:set: Decrease refcount synchronously on deletion and replace netfilter: ipset: actually allow allowable CIDR 0 in hash:net,port,net s390/mm: Fix ERROR: "__node_distance" undefined! netfilter: ipset: Correct rcu_dereference() call in ip_set_put_comment() netfilter: xt_IDLETIMER: add sysfs filename checking routine s390/qeth: fix HiperSockets sniffer hwmon: (ibmpowernv) Remove bogus __init annotations Revert "drm/exynos/decon5433: implement frame counter" clk: fixed-factor: fix of_node_get-put imbalance lib/raid6: Fix arm64 test build s390/perf: Change CPUM_CF return code in event init function sched/core: Take the hotplug lock in sched_init_smp() perf tools: Fix undefined symbol scnprintf in libperf-jvmti.so i40e: restore NETIF_F_GSO_IPXIP[46] to netdev features qed: Fix memory/entry leak in qed_init_sp_request() qed: Fix blocking/unlimited SPQ entries leak qed: Fix potential memory corruption net: stmmac: Fix RX packet size > 8191 zram: close udev startup race condition as default groups SUNRPC: drop pointless static qualifier in xdr_get_next_encode_buffer() ACPI / watchdog: Prefer iTCO_wdt always when WDAT table uses RTC SRAM perf machine: Add machine__is() to identify machine arch perf tools: Fix kernel_start for PTI on x86 perf machine: Add nr_cpus_avail() perf machine: Workaround missing maps for x86 PTI entry trampolines perf test code-reading: Fix perf_env setup for PTI entry trampolines x86/mm: Move LDT remap out of KASLR region on 5-level paging x86/ldt: Unmap PTEs for the slot before freeing LDT pages media: v4l: event: Add subscription to list before calling "add" operation MIPS: OCTEON: cavium_octeon_defconfig: re-enable OCTEON USB driver uio: Fix an Oops on load usb: cdc-acm: add entry for Hiro (Conexant) modem USB: quirks: Add no-lpm quirk for Raydium touchscreens usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data USB: misc: appledisplay: add 20" Apple Cinema Display drivers/misc/sgi-gru: fix Spectre v1 vulnerability ACPI / platform: Add SMB0001 HID to forbidden_id_list HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges libceph: fall back to sendmsg for slab pages Linux 4.14.84 Signed-off-by: Greg Kroah-Hartman --- 0e1d81608a8a514ebb779dada806dbf228baba01 diff --cc drivers/block/zram/zram_drv.c index fc1c7845f141,27b202c64c84..a387dfb004a6 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@@ -1702,20 -1573,11 +1707,15 @@@ static int zram_add(void if (ZRAM_LOGICAL_BLOCK_SIZE == PAGE_SIZE) blk_queue_max_write_zeroes_sectors(zram->disk->queue, UINT_MAX); + zram->disk->queue->backing_dev_info->capabilities |= + BDI_CAP_STABLE_WRITES; ++ + 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_err("Error creating sysfs group for device %d\n", - device_id); - goto out_free_disk; - } strlcpy(zram->compressor, default_compressor, sizeof(zram->compressor)); + zram_debugfs_register(zram); pr_info("Added device: %s\n", zram->disk->disk_name); return device_id; @@@ -1749,17 -1608,6 +1746,8 @@@ static int zram_remove(struct zram *zra zram->claim = true; mutex_unlock(&bdev->bd_mutex); + zram_debugfs_unregister(zram); - /* - * Remove sysfs first, so no one will perform a disksize - * store while we destroy the devices. This also helps during - * hot_remove -- zram_reset_device() is the last holder of - * ->init_lock, no later/concurrent disksize_store() or any - * other sysfs handlers are possible. - */ - sysfs_remove_group(&disk_to_dev(zram->disk)->kobj, - &zram_disk_attr_group); + /* Make sure all the pending I/O are finished */ fsync_bdev(bdev); zram_reset_device(zram); diff --cc net/netfilter/xt_IDLETIMER.c index a4843c1fdaa4,3fef8c2e545d..ff490161d107 --- a/net/netfilter/xt_IDLETIMER.c +++ b/net/netfilter/xt_IDLETIMER.c @@@ -226,57 -112,26 +226,73 @@@ static void idletimer_tg_expired(unsign struct idletimer_tg *timer = (struct idletimer_tg *) data; pr_debug("timer %s expired\n", timer->attr.attr.name); - + spin_lock_bh(×tamp_lock); + timer->active = false; + timer->work_pending = true; schedule_work(&timer->work); + spin_unlock_bh(×tamp_lock); +} + +static int idletimer_resume(struct notifier_block *notifier, + unsigned long pm_event, void *unused) +{ + struct timespec ts; + unsigned long time_diff, now = jiffies; + struct idletimer_tg *timer = container_of(notifier, + struct idletimer_tg, pm_nb); + if (!timer) + return NOTIFY_DONE; + switch (pm_event) { + case PM_SUSPEND_PREPARE: + get_monotonic_boottime(&timer->last_suspend_time); + break; + case PM_POST_SUSPEND: + spin_lock_bh(×tamp_lock); + if (!timer->active) { + spin_unlock_bh(×tamp_lock); + break; + } + /* since jiffies are not updated when suspended now represents + * the time it would have suspended */ + if (time_after(timer->timer.expires, now)) { + get_monotonic_boottime(&ts); + ts = timespec_sub(ts, timer->last_suspend_time); + time_diff = timespec_to_jiffies(&ts); + if (timer->timer.expires > (time_diff + now)) { + mod_timer_pending(&timer->timer, + (timer->timer.expires - time_diff)); + } else { + del_timer(&timer->timer); + timer->timer.expires = 0; + timer->active = false; + timer->work_pending = true; + schedule_work(&timer->work); + } + } + spin_unlock_bh(×tamp_lock); + break; + default: + break; + } + return NOTIFY_DONE; } + static int idletimer_check_sysfs_name(const char *name, unsigned int size) + { + int ret; + + ret = xt_check_proc_name(name, size); + if (ret < 0) + return ret; + + if (!strcmp(name, "power") || + !strcmp(name, "subsystem") || + !strcmp(name, "uevent")) + return -EINVAL; + + return 0; + } + static int idletimer_tg_create(struct idletimer_tg_info *info) { int ret;