summaryrefslogtreecommitdiff
path: root/fs/ext4
AgeCommit message (Collapse)Author
2016-07-22Merge remote-tracking branch 'msm-4.4/tmp-2bf7955' into msm-4.4Trilok Soni
* msm-4.4/tmp-2bf7955: Linux 4.4.8 Revert "usb: hub: do not clear BOS field during reset device" usbvision: fix crash on detecting device with invalid configuration staging: android: ion: Set the length of the DMA sg entries in buffer Revert "PCI, x86: Implement pcibios_alloc_irq() and pcibios_free_irq()" Revert "PCI: Add helpers to manage pci_dev->irq and pci_dev->irq_managed" Revert "x86/PCI: Don't alloc pcibios-irq when MSI is enabled" HID: usbhid: fix inconsistent reset/resume/reset-resume behavior HID: wacom: fix Bamboo ONE oops ALSA: usb-audio: Skip volume controls triggers hangup on Dell USB Dock ALSA: usb-audio: Add a quirk for Plantronics BT300 ALSA: usb-audio: Add a sample rate quirk for Phoenix Audio TMX320 ALSA: hda/realtek - Enable the ALC292 dock fixup on the Thinkpad T460s ALSA: hda - fix front mic problem for a HP desktop ALSA: hda - Fix headset support and noise on HP EliteBook 755 G2 ALSA: hda - Fixup speaker pass-through control for nid 0x14 on ALC225 mmc: sdhci-pci: Add support and PCI IDs for more Broxton host controllers perf: Cure event->pending_disable race perf: Do not double free arm64: replace read_lock to rcu lock in call_step_hook Btrfs: fix file/data loss caused by fsync after rename and new inode iommu: Don't overwrite domain pointer when there is no default_domain ext4: ignore quota mount options if the quota feature is enabled ext4: add lockdep annotations for i_data_sem btrfs: fix crash/invalid memory access on fsync when using overlayfs nfs: use file_dentry() fs: add file_dentry() sd: Fix excessive capacity printing on devices with blocks bigger than 512 bytes iio: gyro: bmg160: fix endianness when reading axes iio: gyro: bmg160: fix buffer read values iio: accel: bmc150: fix endianness when reading axes iio: st_magn: always define ST_MAGN_TRIGGER_SET_STATE usb: renesas_usbhs: fix to avoid using a disabled ep in usbhsg_queue_done() usb: renesas_usbhs: disable TX IRQ before starting TX DMAC transfer usb: renesas_usbhs: avoid NULL pointer derefernce in usbhsf_pkt_handler() mac80211: fix txq queue related crashes mac80211: fix unnecessary frame drops in mesh fwding mac80211: fix ibss scan parameters mac80211: avoid excessive stack usage in sta_info mac80211: properly deal with station hashtable insert errors virtio: virtio 1.0 cs04 spec compliance for reset rbd: use GFP_NOIO consistently for request allocations pcmcia: db1xxx_ss: fix last irq_to_gpio user v4l: vsp1: Set the SRU CTRL0 register when starting the stream coda: fix error path in case of missing pdata on non-DT platform au0828: Fix dev_state handling au0828: fix au0828_v4l2_close() dev_state race condition pinctrl: freescale: imx: fix bogus check of of_iomap() return value pinctrl: nomadik: fix pull debug print inversion pinctrl: sunxi: Fix A33 external interrupts not working pinctrl: sh-pfc: only use dummy states for non-DT platforms pinctrl: pistachio: fix mfio84-89 function description and pinmux. MIPS: Fix MSA ld unaligned failure cases KVM: x86: reduce default value of halt_poll_ns parameter KVM: x86: Inject pending interrupt even if pending nmi exist cdc-acm: fix NULL pointer reference USB: uas: Add a new NO_REPORT_LUNS quirk USB: uas: Limit qdepth at the scsi-host level mpls: find_outdev: check for err ptr in addition to NULL check ipv6: Count in extension headers in skb->network_header ip6_tunnel: set rtnl_link_ops before calling register_netdevice ipv6: l2tp: fix a potential issue in l2tp_ip6_recv ipv4: l2tp: fix a potential issue in l2tp_ip_recv tuntap: restore default qdisc tun, bpf: fix suspicious RCU usage in tun_{attach, detach}_filter rtnl: fix msg size calculation in if_nlmsg_size() bridge: Allow set bridge ageing time when switchdev disabled ipv6: udp: fix UDP_MIB_IGNOREDMULTI updates qmi_wwan: add "D-Link DWM-221 B1" device id xfrm: Fix crash observed during device unregistration and decryption ppp: take reference on channels netns ipv4: initialize flowi4_flags before calling fib_lookup() ipv4: fix broadcast packets reception bonding: fix bond_get_stats() net: bcmgenet: fix dma api length mismatch qlge: Fix receive packets drop. tcp/dccp: remove obsolete WARN_ON() in icmp handlers ppp: ensure file->private_data can't be overridden ath9k: fix buffer overrun for ar9287 farsync: fix off-by-one bug in fst_add_one mlx4: add missing braces in verify_qp_parameters net: Fix use after free in the recvmmsg exit path ipv4: Don't do expensive useless work during inetdev destroy. bridge: allow zero ageing time rocker: set FDB cleanup timer according to lowest ageing time mlxsw: spectrum: Check requested ageing time is valid macvtap: always pass ethernet header in linear qlcnic: Fix mailbox completion handling during spurious interrupt qlcnic: Remove unnecessary usage of atomic_t sh_eth: advance 'rxdesc' later in sh_eth_ring_format() sh_eth: fix NULL pointer dereference in sh_eth_ring_format() bpf: avoid copying junk bytes in bpf_get_current_comm() packet: validate variable length ll headers ax25: add link layer header validation function net: validate variable length ll headers ppp: release rtnl mutex when interface creation fails tcp: fix tcpi_segs_in after connection establishment udp6: fix UDP/IPv6 encap resubmit path usbnet: cleanup after bind() in probe() cdc_ncm: toggle altsetting to force reset before setup vxlan: fix missing options_len update on RX with collect metadata ipv6: re-enable fragment header matching in ipv6_find_hdr qmi_wwan: add Sierra Wireless EM74xx device ID tipc: Revert "tipc: use existing sk_write_queue for outgoing packet chain" mld, igmp: Fix reserved tailroom calculation sctp: lack the check for ports in sctp_v6_cmp_addr net: fix bridge multicast packet checksum validation net: qca_spi: clear IFF_TX_SKB_SHARING net: qca_spi: Don't clear IFF_BROADCAST net: vrf: Remove direct access to skb->data net: jme: fix suspend/resume on JMC260 ipv4: only create late gso-skb if skb is already set up with CHECKSUM_PARTIAL tunnel: Clear IPCB(skb)->opt before dst_link_failure called tcp: convert cached rtt from usec to jiffies when feeding initial rto xen/events: Mask a moving irq drm/amdgpu/gmc: use proper register for vram type on Fiji drm/amdgpu/gmc: move vram type fetching into sw_init drm/radeon: add a dpm quirk for all R7 370 parts drm/radeon: add another R7 370 quirk drm/radeon: add a dpm quirk for sapphire Dual-X R7 370 2G D5 drm/udl: Use unlocked gem unreferencing drm/dp: move hw_mutex up the call stack arm64: opcodes.h: Add arm big-endian config options before including arm header compiler-gcc: disable -ftracer for __noclone functions libnvdimm, pfn: fix uuid validation libnvdimm: fix smart data retrieval powerpc/mm: Fixup preempt underflow with huge pages mm: fix invalid node in alloc_migrate_target() ALSA: hda - Apply fix for white noise on Asus N550JV, too ALSA: hda - Fix white noise on Asus N750JV headphone ALSA: hda - Asus N750JV external subwoofer fixup ALSA: timer: Use mod_timer() for rearming the system timer parisc: Unbreak handling exceptions from kernel modules parisc: Fix kernel crash with reversed copy_from_user() parisc: Avoid function pointers for kernel exception routines PKCS#7: pkcs7_validate_trust(): initialize the _trusted output argument hwmon: (max1111) Return -ENODEV from max1111_read_channel if not instantiated Linux 4.4.7 perf/x86/intel: Fix PEBS data source interpretation on Nehalem/Westmere perf/x86/intel: Use PAGE_SIZE for PEBS buffer size on Core2 perf/x86/intel: Fix PEBS warning by only restoring active PMU in pmi perf/x86/pebs: Add workaround for broken OVFL status on HSW+ sched/cputime: Fix steal time accounting vs. CPU hotplug scsi_common: do not clobber fixed sense information PM / sleep: Clear pm_suspend_global_flags upon hibernate intel_idle: prevent SKL-H boot failure when C8+C9+C10 enabled mtd: onenand: fix deadlock in onenand_block_markbad mm/page_alloc: prevent merging between isolated and other pageblocks ocfs2/dlm: fix BUG in dlm_move_lockres_to_recovery_list ocfs2/dlm: fix race between convert and recovery Input: ati_remote2 - fix crashes on detecting device with invalid descriptor Input: ims-pcu - sanity check against missing interfaces Input: synaptics - handle spurious release of trackstick buttons, again writeback, cgroup: fix use of the wrong bdi_writeback which mismatches the inode writeback, cgroup: fix premature wb_put() in locked_inode_to_wb_and_lock_list() ACPI / PM: Runtime resume devices when waking from hibernate ARM: dts: at91: sama5d4 Xplained: don't disable hsmci regulator ARM: dts: at91: sama5d3 Xplained: don't disable hsmci regulator nfsd: fix deadlock secinfo+readdir compound nfsd4: fix bad bounds checking iser-target: Rework connection termination iser-target: Separate flows for np listeners and connections cma events iser-target: Add new state ISER_CONN_BOUND to isert_conn iser-target: Fix identification of login rx descriptor type target: Fix target_release_cmd_kref shutdown comp leak clk: bcm2835: Fix setting of PLL divider clock rates clk: rockchip: add hclk_cpubus to the list of rk3188 critical clocks clk: rockchip: rk3368: fix hdmi_cec gate-register clk: rockchip: rk3368: fix parents of video encoder/decoder clk: rockchip: rk3368: fix cpuclk core dividers clk: rockchip: rk3368: fix cpuclk mux bit of big cpu-cluster mmc: sdhci: Fix override of timeout clk wrt max_busy_timeout mmc: sdhci: fix data timeout (part 2) mmc: sdhci: fix data timeout (part 1) mmc: mmc_spi: Add Card Detect comments and fix CD GPIO case mmc: block: fix ABI regression of mmc_blk_ioctl ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list MAINTAINERS: Update mailing list and web page for hwmon subsystem kbuild/mkspec: fix grub2 installkernel issue scripts/kconfig: allow building with make 3.80 again scripts/coccinelle: modernize & bitops: Do not default to __clear_bit() for __clear_bit_unlock() tracing: Fix trace_printk() to print when not using bprintk() tracing: Fix crash from reading trace_pipe with sendfile tracing: Have preempt(irqs)off trace preempt disabled functions IB/ipoib: fix for rare multicast join race condition drm/amdgpu: include the right version of gmc header files for iceland drm/amdgpu: disable runtime pm on PX laptops without dGPU power control drm/radeon: Don't drop DP 2.7 Ghz link setup on some cards. drm/radeon: disable runtime pm on PX laptops without dGPU power control iwlwifi: mvm: Fix paging memory leak ipr: Fix regression when loading firmware ipr: Fix out-of-bounds null overwrite rapidio/rionet: fix deadlock on SMP fs/coredump: prevent fsuid=0 dumps into user-controlled directories fuse: Add reference counting for fuse_io_priv fuse: do not use iocb after it may have been freed md: multipath: don't hardcopy bio in .make_request path md/raid5: preserve STRIPE_PREREAD_ACTIVE in break_stripe_batch_list raid10: include bio_end_io_list in nr_queued to prevent freeze_array hang RAID5: revert e9e4c377e2f563 to fix a livelock RAID5: check_reshape() shouldn't call mddev_suspend md/raid5: Compare apples to apples (or sectors to sectors) raid1: include bio_end_io_list in nr_queued to prevent freeze_array hang xfs: fix two memory leaks in xfs_attr_list.c error paths quota: Fix possible GPF due to uninitialised pointers ARC: bitops: Remove non relevant comments ARC: [BE] readl()/writel() to work in Big Endian CPU configuration xtensa: clear all DBREAKC registers on start xtensa: fix preemption in {clear,copy}_user_highpage xtensa: ISS: don't hang if stdin EOF is reached splice: handle zero nr_pages in splice_to_pipe() vfs: show_vfsstat: do not ignore errors from show_devname method of: alloc anywhere from memblock if range not specified net: mvneta: enable change MAC address when interface is up cgroup: ignore css_sets associated with dead cgroups during migration Bluetooth: Fix potential buffer overflow with Add Advertising Bluetooth: Add new AR3012 ID 0489:e095 watchdog: rc32434_wdt: fix ioctl error handling watchdog: don't run proc_watchdog_update if new value is same as old ia64: define ioremap_uc() mm: memcontrol: reclaim and OOM kill when shrinking memory.max below usage mm: memcontrol: reclaim when shrinking memory.high below usage bcache: fix cache_set_flush() NULL pointer dereference on OOM bcache: fix race of writeback thread starting before complete initialization bcache: cleaned up error handling around register_cache() IB/srpt: Simplify srpt_handle_tsk_mgmt() brd: Fix discard request processing jbd2: fix FS corruption possibility in jbd2_journal_destroy() on umount path tools/hv: Use include/uapi with __EXPORTED_HEADERS__ ALSA: hda - Fix unconditional GPIO toggle via automute ALSA: hda - fix the mic mute button and led problem for a Lenovo AIO ALSA: hda - Don't handle ELD notify from invalid port ALSA: intel8x0: Add clock quirk entry for AD1981B on IBM ThinkPad X41. ALSA: pcm: Avoid "BUG:" string for warnings again ALSA: hda - Apply reboot D3 fix for CX20724 codec, too mtip32xx: Cleanup queued requests after surprise removal mtip32xx: Implement timeout handler mtip32xx: Handle FTL rebuild failure state during device initialization mtip32xx: Handle safe removal during IO mtip32xx: Fix for rmmod crash when drive is in FTL rebuild mtip32xx: Print exact time when an internal command is interrupted mtip32xx: Remove unwanted code from taskfile error handler mtip32xx: Fix broken service thread handling mtip32xx: Avoid issuing standby immediate cmd during FTL rebuild media: v4l2-compat-ioctl32: fix missing length copy in put_v4l2_buffer32 coda: fix first encoded frame payload bttv: Width must be a multiple of 16 when capturing planar formats adv7511: TX_EDID_PRESENT is still 1 after a disconnect saa7134: Fix bytesperline not being set correctly for planar formats 8250: use callbacks to access UART_DLL/UART_DLM net: irda: Fix use-after-free in irtty_open() tty: Fix GPF in flush_to_ldisc(), part 2 staging: comedi: ni_mio_common: fix the ni_write[blw]() functions staging: android: ion_test: fix check of platform_device_register_simple() error code staging: comedi: ni_tiocmd: change mistaken use of start_src for start_arg HID: fix hid_ignore_special_drivers module parameter HID: multitouch: force retrieving of Win8 signature blob HID: i2c-hid: fix OOB write in i2c_hid_set_or_send_report() HID: logitech: fix Dual Action gamepad support tpm: fix the cleanup of struct tpm_chip tpm_eventlog.c: fix binary_bios_measurements tpm_crb: tpm2_shutdown() must be called before tpm_chip_unregister() tpm: fix the rollback in tpm_chip_register() mei: bus: check if the device is enabled before data transfer X.509: Fix leap year handling again crypto: marvell/cesa - forward devm_ioremap_resource() error code crypto: ux500 - fix checks of error code returned by devm_ioremap_resource() crypto: atmel - fix checks of error code returned by devm_ioremap_resource() crypto: keywrap - memzero the correct memory crypto: ccp - memset request context to zero during import crypto: ccp - Don't assume export/import areas are aligned crypto: ccp - Limit the amount of information exported crypto: ccp - Add hash state import and export support Bluetooth: btusb: Add a new AR3012 ID 13d3:3472 Bluetooth: btusb: Add a new AR3012 ID 04ca:3014 Bluetooth: btusb: Add new AR3012 ID 13d3:3395 ALSA: usb-audio: Fix double-free in error paths after snd_usb_add_audio_stream() call ALSA: usb-audio: Minor code cleanup in create_fixed_stream_quirk() ALSA: usb-audio: add Microsoft HD-5001 to quirks ALSA: usb-audio: Add sanity checks for endpoint accesses ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk() Input: powermate - fix oops with malicious USB descriptors pwc: Add USB id for Philips Spc880nc webcam USB: option: add "D-Link DWM-221 B1" device id USB: serial: ftdi_sio: Add support for ICP DAS I-756xU devices USB: serial: cp210x: Adding GE Healthcare Device ID USB: cypress_m8: add endpoint sanity check USB: digi_acceleport: do sanity checking for the number of ports USB: mct_u232: add sanity checking in probe USB: usb_driver_claim_interface: add sanity checking USB: iowarrior: fix oops with malicious USB descriptors USB: cdc-acm: more sanity checking USB: uas: Reduce can_queue to MAX_CMNDS usb: hub: fix a typo in hub_port_init() leading to wrong logic usb: retry reset if a device times out dm: fix rq_end_stats() NULL pointer in dm_requeue_original_request() dm cache: make sure every metadata function checks fail_io dm thin metadata: don't issue prefetches if a transaction abort has failed dm: fix excessive dm-mq context switching dm snapshot: disallow the COW and origin devices from being identical libnvdimm: Fix security issue with DSM IOCTL. aic7xxx: Fix queue depth handling be2iscsi: set the boot_kset pointer to NULL in case of failure scsi: storvsc: fix SRB_STATUS_ABORTED handling sd: Fix discard granularity when LBPRZ=1 aacraid: Set correct msix count for EEH recovery aacraid: Fix memory leak in aac_fib_map_free aacraid: Fix RRQ overload sg: fix dxferp in from_to case x86/mm: TLB_REMOTE_SEND_IPI should count pages x86/iopl: Fix iopl capability check on Xen PV x86/iopl/64: Properly context-switch IOPL on Xen PV x86/apic: Fix suspicious RCU usage in smp_trace_call_function_interrupt() x86/irq: Cure live lock in fixup_irqs() PCI: ACPI: IA64: fix IO port generic range check PCI: Disable IO/MEM decoding for devices with non-compliant BARs pinctrl-bcm2835: Fix cut-and-paste error in "pull" parsing s390/pci: enforce fmb page boundary rule s390/cpumf: add missing lpp magic initialization s390: fix floating pointer register corruption (again) EDAC, amd64_edac: Shift wrapping issue in f1x_get_norm_dct_addr() EDAC/sb_edac: Fix computation of channel address sched/preempt, sh: kmap_coherent relies on disabled preemption sched/cputime: Fix steal_account_process_tick() to always return jiffies Thermal: Ignore invalid trip points perf tools: Fix python extension build perf tools: Fix checking asprintf return value perf tools: Dont stop PMU parsing on alias parse error perf/core: Fix perf_sched_count derailment KVM: VMX: fix nested vpid for old KVM guests KVM: VMX: avoid guest hang on invalid invvpid instruction KVM: VMX: avoid guest hang on invalid invept instruction KVM: fix spin_lock_init order on x86 KVM: i8254: change PIT discard tick policy KVM: x86: fix missed hardware breakpoints x86/PCI: Mark Broadwell-EP Home Agent & PCU as having non-compliant BARs perf/x86/intel: Add definition for PT PMI bit x86/entry/compat: Keep TS_COMPAT set during signal delivery x86/microcode: Untangle from BLK_DEV_INITRD x86/microcode/intel: Make early loader look for builtin microcode too mmc: sh_mmcif: Correct TX DMA channel allocation mmc: sh_mmcif: rework dma channel handling ASoC: samsung: pass DMA channels as pointers regulator: core: Fix nested locking of supplies regulator: core: avoid unused variable warning s390/cpumf: Fix lpp detection cpufreq: dt: No need to allocate resources anymore cpufreq: dt: No need to fetch voltage-tolerance cpufreq: dt: Use dev_pm_opp_set_rate() to switch frequency cpufreq: dt: Reuse dev_pm_opp_get_max_transition_latency() cpufreq: dt: Unsupported OPPs are already disabled cpufreq: dt: Pass regulator name to the OPP core cpufreq: dt: OPP layers handles clock-latency for V1 bindings as well cpufreq: dt: Rename 'need_update' to 'opp_v1' cpufreq: dt: Convert few pr_debug/err() calls to dev_dbg/err() cpufreq-dt: fix handling regulator_get_voltage() result cpufreq-dt: Supply power coefficient when registering cooling devices PM / OPP: Rename structures for clarity PM / OPP: Fix incorrect comments PM / OPP: Initialize regulator pointer to an error value PM / OPP: Initialize u_volt_min/max to a valid value PM / OPP: Fix NULL pointer dereference crash when disabling OPPs PM / OPP: Add dev_pm_opp_set_rate() PM / OPP: Manage device clk PM / OPP: Parse clock-latency and voltage-tolerance for v1 bindings PM / OPP: Introduce dev_pm_opp_get_max_transition_latency() PM / OPP: Introduce dev_pm_opp_get_max_volt_latency() PM / OPP: Disable OPPs that aren't supported by the regulator PM / OPP: get/put regulators from OPP core cpufreq: cpufreq-dt: avoid uninitialized variable warnings: PM / OPP: Use snprintf() instead of sprintf() PM / OPP: Set cpu_dev->id in cpumask first PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties PM / OPP: Parse 'opp-<prop>-<name>' bindings PM / OPP: Parse 'opp-supported-hw' binding PM / OPP: Add missing doc comments PM / OPP: Rename OPP nodes as opp@<opp-hz> PM / OPP: Remove 'operating-points-names' binding PM / OPP: Add {opp-microvolt|opp-microamp}-<name> binding PM / OPP: Add "opp-supported-hw" binding PM / OPP: Add debugfs support arm64: vdso: Mark vDSO code as read-only Conflicts: drivers/staging/android/ion/ion.c mm/page_alloc.c CRs-Fixed: 1010239 Change-Id: Id59539cad642885e1e41340cebae4159ba1f7eaf Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-07-12Merge remote-tracking branch 'origin/tmp-917a9a9133a6' into lskRunmin Wang
* tmp-917a9: ARM/vdso: Mark the vDSO code read-only after init x86/vdso: Mark the vDSO code read-only after init lkdtm: Verify that '__ro_after_init' works correctly arch: Introduce post-init read-only memory x86/mm: Always enable CONFIG_DEBUG_RODATA and remove the Kconfig option mm/init: Add 'rodata=off' boot cmdline parameter to disable read-only kernel mappings asm-generic: Consolidate mark_rodata_ro() Linux 4.4.6 ld-version: Fix awk regex compile failure target: Drop incorrect ABORT_TASK put for completed commands block: don't optimize for non-cloned bio in bio_get_last_bvec() MIPS: smp.c: Fix uninitialised temp_foreign_map MIPS: Fix build error when SMP is used without GIC ovl: fix getcwd() failure after unsuccessful rmdir ovl: copy new uid/gid into overlayfs runtime inode userfaultfd: don't block on the last VM updates at exit time powerpc/powernv: Fix OPAL_CONSOLE_FLUSH prototype and usages powerpc/powernv: Add a kmsg_dumper that flushes console output on panic powerpc: Fix dedotify for binutils >= 2.26 Revert "drm/radeon/pm: adjust display configuration after powerstate" drm/radeon: Fix error handling in radeon_flip_work_func. drm/amdgpu: Fix error handling in amdgpu_flip_work_func. Revert "drm/radeon: call hpd_irq_event on resume" x86/mm: Fix slow_virt_to_phys() for X86_PAE again gpu: ipu-v3: Do not bail out on missing optional port nodes mac80211: Fix Public Action frame RX in AP mode mac80211: check PN correctly for GCMP-encrypted fragmented MPDUs mac80211: minstrel_ht: fix a logic error in RTS/CTS handling mac80211: minstrel_ht: set default tx aggregation timeout to 0 mac80211: fix use of uninitialised values in RX aggregation mac80211: minstrel: Change expected throughput unit back to Kbps iwlwifi: mvm: inc pending frames counter also when txing non-sta can: gs_usb: fixed disconnect bug by removing erroneous use of kfree() cfg80211/wext: fix message ordering wext: fix message delay/ordering ovl: fix working on distributed fs as lower layer ovl: ignore lower entries when checking purity of non-directory entries ASoC: wm8958: Fix enum ctl accesses in a wrong type ASoC: wm8994: Fix enum ctl accesses in a wrong type ASoC: samsung: Use IRQ safe spin lock calls ASoC: dapm: Fix ctl value accesses in a wrong type ncpfs: fix a braino in OOM handling in ncp_fill_cache() jffs2: reduce the breakage on recovery from halfway failed rename() dmaengine: at_xdmac: fix residue computation tracing: Fix check for cpu online when event is disabled s390/dasd: fix diag 0x250 inline assembly s390/mm: four page table levels vs. fork KVM: MMU: fix reserved bit check for ept=0/CR0.WP=0/CR4.SMEP=1/EFER.NX=0 KVM: MMU: fix ept=0/pte.u=1/pte.w=0/CR0.WP=0/CR4.SMEP=1/EFER.NX=0 combo KVM: PPC: Book3S HV: Sanitize special-purpose register values on guest exit KVM: s390: correct fprs on SIGP (STOP AND) STORE STATUS KVM: VMX: disable PEBS before a guest entry kvm: cap halt polling at exactly halt_poll_ns PCI: Allow a NULL "parent" pointer in pci_bus_assign_domain_nr() ARM: OMAP2+: hwmod: Introduce ti,no-idle dt property ARM: dts: dra7: do not gate cpsw clock due to errata i877 ARM: mvebu: fix overlap of Crypto SRAM with PCIe memory window arm64: account for sparsemem section alignment when choosing vmemmap offset Linux 4.4.5 drm/amdgpu: fix topaz/tonga gmc assignment in 4.4 stable modules: fix longstanding /proc/kallsyms vs module insertion race. drm/i915: refine qemu south bridge detection drm/i915: more virtual south bridge detection block: get the 1st and last bvec via helpers block: check virt boundary in bio_will_gap() drm/amdgpu: Use drm_calloc_large for VM page_tables array thermal: cpu_cooling: fix out of bounds access in time_in_idle i2c: brcmstb: allocate correct amount of memory for regmap ubi: Fix out of bounds write in volume update code cxl: Fix PSL timebase synchronization detection MIPS: traps: Fix SIGFPE information leak from `do_ov' and `do_trap_or_bp' MIPS: scache: Fix scache init with invalid line size. USB: serial: option: add support for Quectel UC20 USB: serial: option: add support for Telit LE922 PID 0x1045 USB: qcserial: add Sierra Wireless EM74xx device ID USB: qcserial: add Dell Wireless 5809e Gobi 4G HSPA+ (rev3) USB: cp210x: Add ID for Parrot NMEA GPS Flight Recorder usb: chipidea: otg: change workqueue ci_otg as freezable ALSA: timer: Fix broken compat timer user status ioctl ALSA: hdspm: Fix zero-division ALSA: hdsp: Fix wrong boolean ctl value accesses ALSA: hdspm: Fix wrong boolean ctl value accesses ALSA: seq: oss: Don't drain at closing a client ALSA: pcm: Fix ioctls for X32 ABI ALSA: timer: Fix ioctls for X32 ABI ALSA: rawmidi: Fix ioctls X32 ABI ALSA: hda - Fix mic issues on Acer Aspire E1-472 ALSA: ctl: Fix ioctls for X32 ABI ALSA: usb-audio: Add a quirk for Plantronics DA45 adv7604: fix tx 5v detect regression dmaengine: pxa_dma: fix cyclic transfers Fix directory hardlinks from deleted directories jffs2: Fix page lock / f->sem deadlock Revert "jffs2: Fix lock acquisition order bug in jffs2_write_begin" Btrfs: fix loading of orphan roots leading to BUG_ON pata-rb532-cf: get rid of the irq_to_gpio() call tracing: Do not have 'comm' filter override event 'comm' field ata: ahci: don't mark HotPlugCapable Ports as external/removable PM / sleep / x86: Fix crash on graph trace through x86 suspend arm64: vmemmap: use virtual projection of linear region Adding Intel Lewisburg device IDs for SATA writeback: flush inode cgroup wb switches instead of pinning super_block block: bio: introduce helpers to get the 1st and last bvec libata: Align ata_device's id on a cacheline libata: fix HDIO_GET_32BIT ioctl drm/amdgpu: return from atombios_dp_get_dpcd only when error drm/amdgpu/gfx8: specify which engine to wait before vm flush drm/amdgpu: apply gfx_v8 fixes to gfx_v7 as well drm/amdgpu/pm: update current crtc info after setting the powerstate drm/radeon/pm: update current crtc info after setting the powerstate drm/ast: Fix incorrect register check for DRAM width target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors iommu/vt-d: Use BUS_NOTIFY_REMOVED_DEVICE in hotplug path iommu/amd: Fix boot warning when device 00:00.0 is not iommu covered iommu/amd: Apply workaround for ATS write permission check arm/arm64: KVM: Fix ioctl error handling KVM: x86: fix root cause for missed hardware breakpoints vfio: fix ioctl error handling Fix cifs_uniqueid_to_ino_t() function for s390x CIFS: Fix SMB2+ interim response processing for read requests cifs: fix out-of-bounds access in lease parsing fbcon: set a default value to blink interval kvm: x86: Update tsc multiplier on change. mips/kvm: fix ioctl error handling parisc: Fix ptrace syscall number and return value modification PCI: keystone: Fix MSI code that retrieves struct pcie_port pointer block: Initialize max_dev_sectors to 0 drm/amdgpu: mask out WC from BO on unsupported arches btrfs: async-thread: Fix a use-after-free error for trace btrfs: Fix no_space in write and rm loop Btrfs: fix deadlock running delayed iputs at transaction commit time drivers: sh: Restore legacy clock domain on SuperH platforms use ->d_seq to get coherency between ->d_inode and ->d_flags Linux 4.4.4 iwlwifi: mvm: don't allow sched scans without matches to be started iwlwifi: update and fix 7265 series PCI IDs iwlwifi: pcie: properly configure the debug buffer size for 8000 iwlwifi: dvm: fix WoWLAN security: let security modules use PTRACE_MODE_* with bitmasks IB/cma: Fix RDMA port validation for iWarp x86/irq: Plug vector cleanup race x86/irq: Call irq_force_move_complete with irq descriptor x86/irq: Remove outgoing CPU from vector cleanup mask x86/irq: Remove the cpumask allocation from send_cleanup_vector() x86/irq: Clear move_in_progress before sending cleanup IPI x86/irq: Remove offline cpus from vector cleanup x86/irq: Get rid of code duplication x86/irq: Copy vectormask instead of an AND operation x86/irq: Check vector allocation early x86/irq: Reorganize the search in assign_irq_vector x86/irq: Reorganize the return path in assign_irq_vector x86/irq: Do not use apic_chip_data.old_domain as temporary buffer x86/irq: Validate that irq descriptor is still active x86/irq: Fix a race in x86_vector_free_irqs() x86/irq: Call chip->irq_set_affinity in proper context x86/entry/compat: Add missing CLAC to entry_INT80_32 x86/mpx: Fix off-by-one comparison with nr_registers hpfs: don't truncate the file when delete fails do_last(): ELOOP failure exit should be done after leaving RCU mode should_follow_link(): validate ->d_seq after having decided to follow xen/pcifront: Fix mysterious crashes when NUMA locality information was extracted. xen/pciback: Save the number of MSI-X entries to be copied later. xen/pciback: Check PF instead of VF for PCI_COMMAND_MEMORY xen/scsiback: correct frontend counting xen/arm: correctly handle DMA mapping of compound pages ARM: at91/dt: fix typo in sama5d2 pinmux descriptions ARM: OMAP2+: Fix onenand initialization to avoid filesystem corruption do_last(): don't let a bogus return value from ->open() et.al. to confuse us kernel/resource.c: fix muxed resource handling in __request_region() sunrpc/cache: fix off-by-one in qword_get() tracing: Fix showing function event in available_events powerpc/eeh: Fix partial hotplug criterion KVM: x86: MMU: fix ubsan index-out-of-range warning KVM: x86: fix conversion of addresses to linear in 32-bit protected mode KVM: x86: fix missed hardware breakpoints KVM: arm/arm64: vgic: Ensure bitmaps are long enough KVM: async_pf: do not warn on page allocation failures of/irq: Fix msi-map calculation for nonzero rid-base NFSv4: Fix a dentry leak on alias use nfs: fix nfs_size_to_loff_t block: fix use-after-free in dio_bio_complete bio: return EINTR if copying to user space got interrupted i2c: i801: Adding Intel Lewisburg support for iTCO phy: core: fix wrong err handle for phy_power_on writeback: keep superblock pinned during cgroup writeback association switches cgroup: make sure a parent css isn't offlined before its children cpuset: make mm migration asynchronous PCI/AER: Flush workqueue on device remove to avoid use-after-free ARCv2: SMP: Emulate IPI to self using software triggered interrupt ARCv2: STAR 9000950267: Handle return from intr to Delay Slot #2 libata: fix sff host state machine locking while polling qla2xxx: Fix stale pointer access. spi: atmel: fix gpio chip-select in case of non-DT platform target: Fix race with SCF_SEND_DELAYED_TAS handling target: Fix remote-port TMR ABORT + se_cmd fabric stop target: Fix TAS handling for multi-session se_node_acls target: Fix LUN_RESET active TMR descriptor handling target: Fix LUN_RESET active I/O handling for ACK_KREF ALSA: hda - Fixing background noise on Dell Inspiron 3162 ALSA: hda - Apply clock gate workaround to Skylake, too Revert "workqueue: make sure delayed work run in local cpu" workqueue: handle NUMA_NO_NODE for unbound pool_workqueue lookup mac80211: Requeue work after scan complete for all VIF types. rfkill: fix rfkill_fop_read wait_event usage tick/nohz: Set the correct expiry when switching to nohz/lowres mode perf stat: Do not clean event's private stats cdc-acm:exclude Samsung phone 04e8:685d Revert "Staging: panel: usleep_range is preferred over udelay" Staging: speakup: Fix getting port information sd: Optimal I/O size is in bytes, not sectors libceph: don't spam dmesg with stray reply warnings libceph: use the right footer size when skipping a message libceph: don't bail early from try_read() when skipping a message libceph: fix ceph_msg_revoke() seccomp: always propagate NO_NEW_PRIVS on tsync cpufreq: Fix NULL reference crash while accessing policy->governor_data cpufreq: pxa2xx: fix pxa_cpufreq_change_voltage prototype hwmon: (ads1015) Handle negative conversion values correctly hwmon: (gpio-fan) Remove un-necessary speed_index lookup for thermal hook hwmon: (dell-smm) Blacklist Dell Studio XPS 8000 Thermal: do thermal zone update after a cooling device registered Thermal: handle thermal zone device properly during system sleep Thermal: initialize thermal zone device correctly IB/mlx5: Expose correct maximum number of CQE capacity IB/qib: Support creating qps with GFP_NOIO flag IB/qib: fix mcast detach when qp not attached IB/cm: Fix a recently introduced deadlock dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer dmaengine: at_xdmac: fix resume for cyclic transfers dmaengine: dw: fix cyclic transfer callbacks dmaengine: dw: fix cyclic transfer setup nfit: fix multi-interface dimm handling, acpi6.1 compatibility ACPI / PCI / hotplug: unlock in error path in acpiphp_enable_slot() ACPI: Revert "ACPI / video: Add Dell Inspiron 5737 to the blacklist" ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Satellite R830 ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Portege R700 lib: sw842: select crc32 uapi: update install list after nvme.h rename ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list ideapad-laptop: Add Lenovo ideapad Y700-17ISK to no_hw_rfkill dmi list toshiba_acpi: Fix blank screen at boot if transflective backlight is supported make sure that freeing shmem fast symlinks is RCU-delayed drm/radeon/pm: adjust display configuration after powerstate drm/radeon: Don't hang in radeon_flip_work_func on disabled crtc. (v2) drm: Fix treatment of drm_vblank_offdelay in drm_vblank_on() (v2) drm: Fix drm_vblank_pre/post_modeset regression from Linux 4.4 drm: Prevent vblank counter bumps > 1 with active vblank clients. (v2) drm: No-Op redundant calls to drm_vblank_off() (v2) drm/radeon: use post-decrement in error handling drm/qxl: use kmalloc_array to alloc reloc_info in qxl_process_single_command drm/i915: fix error path in intel_setup_gmbus() drm/i915/dsi: don't pass arbitrary data to sideband drm/i915/dsi: defend gpio table against out of bounds access drm/i915/skl: Don't skip mst encoders in skl_ddi_pll_select() drm/i915: Don't reject primary plane windowing with color keying enabled on SKL+ drm/i915/dp: fall back to 18 bpp when sink capability is unknown drm/i915: Make sure DC writes are coherent on flush. drm/i915: Init power domains early in driver load drm/i915: intel_hpd_init(): Fix suspend/resume reprobing drm/i915: Restore inhibiting the load of the default context drm: fix missing reference counting decrease drm/radeon: hold reference to fences in radeon_sa_bo_new drm/radeon: mask out WC from BO on unsupported arches drm: add helper to check for wc memory support drm/radeon: fix DP audio support for APU with DCE4.1 display engine drm/radeon: Add a common function for DFS handling drm/radeon: cleaned up VCO output settings for DP audio drm/radeon: properly byte swap vce firmware setup drm/radeon: clean up fujitsu quirks drm/radeon: Fix "slow" audio over DP on DCE8+ drm/radeon: call hpd_irq_event on resume drm/radeon: Fix off-by-one errors in radeon_vm_bo_set_addr drm/dp/mst: deallocate payload on port destruction drm/dp/mst: Reverse order of MST enable and clearing VC payload table. drm/dp/mst: move GUID storage from mgr, port to only mst branch drm/dp/mst: Calculate MST PBN with 31.32 fixed point drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil drm/dp/mst: fix in RAD element access drm/dp/mst: fix in MSTB RAD initialization drm/dp/mst: always send reply for UP request drm/dp/mst: process broadcast messages correctly drm/nouveau: platform: Fix deferred probe drm/nouveau/disp/dp: ensure sink is powered up before attempting link training drm/nouveau/display: Enable vblank irqs after display engine is on again. drm/nouveau/kms: take mode_config mutex in connector hotplug path drm/amdgpu/pm: adjust display configuration after powerstate drm/amdgpu: Don't hang in amdgpu_flip_work_func on disabled crtc. drm/amdgpu: use post-decrement in error handling drm/amdgpu: fix issue with overlapping userptrs drm/amdgpu: hold reference to fences in amdgpu_sa_bo_new (v2) drm/amdgpu: remove unnecessary forward declaration drm/amdgpu: fix s4 resume drm/amdgpu: remove exp hardware support from iceland drm/amdgpu: don't load MEC2 on topaz drm/amdgpu: drop topaz support from gmc8 module drm/amdgpu: pull topaz gmc bits into gmc_v7 drm/amdgpu: The VI specific EXE bit should only apply to GMC v8.0 above drm/amdgpu: iceland use CI based MC IP drm/amdgpu: move gmc7 support out of CIK dependency drm/amdgpu: no need to load MC firmware on fiji drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2 drm/amdgpu: fix tonga smu resume drm/amdgpu: fix lost sync_to if scheduler is enabled. drm/amdgpu: call hpd_irq_event on resume drm/amdgpu: Fix off-by-one errors in amdgpu_vm_bo_map drm/vmwgfx: respect 'nomodeset' drm/vmwgfx: Fix a width / pitch mismatch on framebuffer updates drm/vmwgfx: Fix an incorrect lock check virtio_pci: fix use after free on release virtio_balloon: fix race between migration and ballooning virtio_balloon: fix race by fill and leak regulator: mt6311: MT6311_REGULATOR needs to select REGMAP_I2C regulator: axp20x: Fix GPIO LDO enable value for AXP22x clk: exynos: use irqsave version of spin_lock to avoid deadlock with irqs cxl: use correct operator when writing pcie config space values sparc64: fix incorrect sign extension in sys_sparc64_personality EDAC, mc_sysfs: Fix freeing bus' name EDAC: Robustify workqueues destruction MIPS: Fix buffer overflow in syscall_get_arguments() MIPS: Fix some missing CONFIG_CPU_MIPSR6 #ifdefs MIPS: hpet: Choose a safe value for the ETIME check MIPS: Loongson-3: Fix SMP_ASK_C0COUNT IPI handler Revert "MIPS: Fix PAGE_MASK definition" cputime: Prevent 32bit overflow in time[val|spec]_to_cputime() time: Avoid signed overflow in timekeeping_get_ns() Bluetooth: 6lowpan: Fix handling of uncompressed IPv6 packets Bluetooth: 6lowpan: Fix kernel NULL pointer dereferences Bluetooth: Fix incorrect removing of IRKs Bluetooth: Add support of Toshiba Broadcom based devices Bluetooth: Use continuous scanning when creating LE connections Drivers: hv: vmbus: Fix a Host signaling bug tools: hv: vss: fix the write()'s argument: error -> vss_msg mmc: sdhci: Allow override of get_cd() called from sdhci_request() mmc: sdhci: Allow override of mmc host operations mmc: sdhci-pci: Fix card detect race for Intel BXT/APL mmc: pxamci: fix again read-only gpio detection polarity mmc: sdhci-acpi: Fix card detect race for Intel BXT/APL mmc: mmci: fix an ages old detection error mmc: core: Enable tuning according to the actual timing mmc: sdhci: Fix sdhci_runtime_pm_bus_on/off() mmc: mmc: Fix incorrect use of driver strength switching HS200 and HS400 mmc: sdio: Fix invalid vdd in voltage switch power cycle mmc: sdhci: Fix DMA descriptor with zero data length mmc: sdhci-pci: Do not default to 33 Ohm driver strength for Intel SPT mmc: usdhi6rol0: handle NULL data in timeout clockevents/tcb_clksrc: Prevent disabling an already disabled clock posix-clock: Fix return code on the poll method's error path irqchip/gic-v3-its: Fix double ICC_EOIR write for LPI in EOImode==1 irqchip/atmel-aic: Fix wrong bit operation for IRQ priority irqchip/mxs: Add missing set_handle_irq() irqchip/omap-intc: Add support for spurious irq handling coresight: checking for NULL string in coresight_name_match() dm: fix dm_rq_target_io leak on faults with .request_fn DM w/ blk-mq paths dm snapshot: fix hung bios when copy error occurs dm space map metadata: remove unused variable in brb_pop() tda1004x: only update the frontend properties if locked vb2: fix a regression in poll() behavior for output,streams gspca: ov534/topro: prevent a division by 0 si2157: return -EINVAL if firmware blob is too big media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode rc: sunxi-cir: Initialize the spinlock properly namei: ->d_inode of a pinned dentry is stable only for positives mei: validate request value in client notify request ioctl mei: fix fasync return value on error rtlwifi: rtl8723be: Fix module parameter initialization rtlwifi: rtl8188ee: Fix module parameter initialization rtlwifi: rtl8192se: Fix module parameter initialization rtlwifi: rtl8723ae: Fix initialization of module parameters rtlwifi: rtl8192de: Fix incorrect module parameter descriptions rtlwifi: rtl8192ce: Fix handling of module parameters rtlwifi: rtl8192cu: Add missing parameter setup rtlwifi: rtl_pci: Fix kernel panic locks: fix unlock when fcntl_setlk races with a close um: link with -lpthread uml: fix hostfs mknod() uml: flush stdout before forking s390/fpu: signals vs. floating point control register s390/compat: correct restore of high gprs on signal return s390/dasd: fix performance drop s390/dasd: fix refcount for PAV reassignment s390/dasd: prevent incorrect length error under z/VM after PAV changes s390: fix normalization bug in exception table sorting btrfs: initialize the seq counter in struct btrfs_device Btrfs: Initialize btrfs_root->highest_objectid when loading tree root and subvolume roots Btrfs: fix transaction handle leak on failure to create hard link Btrfs: fix number of transaction units required to create symlink Btrfs: send, don't BUG_ON() when an empty symlink is found btrfs: statfs: report zero available if metadata are exhausted Btrfs: igrab inode in writepage Btrfs: add missing brelse when superblock checksum fails KVM: s390: fix memory overwrites when vx is disabled s390/kvm: remove dependency on struct save_area definition clocksource/drivers/vt8500: Increase the minimum delta genirq: Validate action before dereferencing it in handle_irq_event_percpu() mm: numa: quickly fail allocations for NUMA balancing on full nodes mm: thp: fix SMP race condition between THP page fault and MADV_DONTNEED ocfs2: unlock inode if deleting inode from orphan fails drm/i915: shut up gen8+ SDE irq dmesg noise iw_cxgb3: Fix incorrectly returning error on success spi: omap2-mcspi: Prevent duplicate gpio_request drivers: android: correct the size of struct binder_uintptr_t for BC_DEAD_BINDER_DONE USB: option: add "4G LTE usb-modem U901" USB: option: add support for SIM7100E USB: cp210x: add IDs for GE B650V3 and B850V3 boards usb: dwc3: Fix assignment of EP transfer resources can: ems_usb: Fix possible tx overflow dm thin: fix race condition when destroying thin pool workqueue bcache: Change refill_dirty() to always scan entire disk if necessary bcache: prevent crash on changing writeback_running bcache: allows use of register in udev to avoid "device_busy" error. bcache: unregister reboot notifier if bcache fails to unregister device bcache: fix a leak in bch_cached_dev_run() bcache: clear BCACHE_DEV_UNLINK_DONE flag when attaching a backing device bcache: Add a cond_resched() call to gc bcache: fix a livelock when we cause a huge number of cache misses lib/ucs2_string: Correct ucs2 -> utf8 conversion efi: Add pstore variables to the deletion whitelist efi: Make efivarfs entries immutable by default efi: Make our variable validation list include the guid efi: Do variable name validation tests in utf8 efi: Use ucs2_as_utf8 in efivarfs instead of open coding a bad version lib/ucs2_string: Add ucs2 -> utf8 helper functions ARM: 8457/1: psci-smp is built only for SMP drm/gma500: Use correct unref in the gem bo create function devm_memremap: Fix error value when memremap failed KVM: s390: fix guest fprs memory leak arm64: errata: Add -mpc-relative-literal-loads to build flags ARM: debug-ll: fix BCM63xx entry for multiplatform ext4: fix bh->b_state corruption sctp: Fix port hash table size computation unix_diag: fix incorrect sign extension in unix_lookup_by_ino tipc: unlock in error path rtnl: RTM_GETNETCONF: fix wrong return value IFF_NO_QUEUE: Fix for drivers not calling ether_setup() tcp/dccp: fix another race at listener dismantle route: check and remove route cache when we get route net_sched fix: reclassification needs to consider ether protocol changes pppoe: fix reference counting in PPPoE proxy l2tp: Fix error creating L2TP tunnels net/mlx4_en: Avoid changing dev->features directly in run-time net/mlx4_en: Choose time-stamping shift value according to HW frequency net/mlx4_en: Count HW buffer overrun only once qmi_wwan: add "4G LTE usb-modem U901" tcp: md5: release request socket instead of listener tipc: fix premature addition of node to lookup table af_unix: Guard against other == sk in unix_dgram_sendmsg af_unix: Don't set err in unix_stream_read_generic unless there was an error ipv4: fix memory leaks in ip_cmsg_send() callers bonding: Fix ARP monitor validation bpf: fix branch offset adjustment on backjumps after patching ctx expansion flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen net: Copy inner L3 and L4 headers as unaligned on GRE TEB sctp: translate network order to host order when users get a hmacid enic: increment devcmd2 result ring in case of timeout tg3: Fix for tg3 transmit queue 0 timed out when too many gso_segs net:Add sysctl_max_skb_frags tcp: do not drop syn_recv on all icmp reports unix: correctly track in-flight fds in sending process user_struct ipv6: fix a lockdep splat ipv6: addrconf: Fix recursive spin lock call ipv6/udp: use sticky pktinfo egress ifindex on connect() ipv6: enforce flowi6_oif usage in ip6_dst_lookup_tail() tcp: beware of alignments in tcp_get_info() switchdev: Require RTNL mutex to be held when sending FDB notifications inet: frag: Always orphan skbs inside ip_defrag() tipc: fix connection abort during subscription cancel net: dsa: fix mv88e6xxx switches sctp: allow setting SCTP_SACK_IMMEDIATELY by the application pptp: fix illegal memory access caused by multiple bind()s af_unix: fix struct pid memory leak tcp: fix NULL deref in tcp_v4_send_ack() lwt: fix rx checksum setting for lwt devices tunneling over ipv6 tunnels: Allow IPv6 UDP checksums to be correctly controlled. net: dp83640: Fix tx timestamp overflow handling. gro: Make GRO aware of lightweight tunnels. af_iucv: Validate socket address length in iucv_sock_bind() Conflicts: arch/arm64/Makefile arch/arm64/include/asm/cacheflush.h drivers/mmc/host/sdhci.c drivers/usb/dwc3/ep0.c drivers/usb/dwc3/gadget.c kernel/module.c sound/core/pcm_compat.c CRs-Fixed: 1010239 Signed-off-by: Runmin Wang <runminw@codeaurora.org> Change-Id: I41a28636fc9ad91f9d979b191784609476294cdf
2016-04-20ext4: ignore quota mount options if the quota feature is enabledTheodore Ts'o
commit c325a67c72903e1cc30e990a15ce745bda0dbfde upstream. Previously, ext4 would fail the mount if the file system had the quota feature enabled and quota mount options (used for the older quota setups) were present. This broke xfstests, since xfs silently ignores the usrquote and grpquota mount options if they are specified. This commit changes things so that we are consistent with xfs; having the mount options specified is harmless, so no sense break users by forbidding them. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-20ext4: add lockdep annotations for i_data_semTheodore Ts'o
commit daf647d2dd58cec59570d7698a45b98e580f2076 upstream. With the internal Quota feature, mke2fs creates empty quota inodes and quota usage tracking is enabled as soon as the file system is mounted. Since quotacheck is no longer preallocating all of the blocks in the quota inode that are likely needed to be written to, we are now seeing a lockdep false positive caused by needing to allocate a quota block from inside ext4_map_blocks(), while holding i_data_sem for a data inode. This results in this complaint: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem); lock(&s->s_dquot.dqio_mutex); lock(&ei->i_data_sem); lock(&s->s_dquot.dqio_mutex); Google-Bug-Id: 27907753 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-23Merge remote-tracking branch 'lsk-44/linux-linaro-lsk-v4.4' into 44rc2David Keitel
* lsk-44/linux-linaro-lsk-v4.4: Linux 4.4.3 modules: fix modparam async_probe request module: wrapper for symbol name. itimers: Handle relative timers with CONFIG_TIME_LOW_RES proper posix-timers: Handle relative timers with CONFIG_TIME_LOW_RES proper timerfd: Handle relative timers with CONFIG_TIME_LOW_RES proper prctl: take mmap sem for writing to protect against others xfs: log mount failures don't wait for buffers to be released Revert "xfs: clear PF_NOFREEZE for xfsaild kthread" xfs: inode recovery readahead can race with inode buffer creation libxfs: pack the agfl header structure so XFS_AGFL_SIZE is correct ovl: setattr: check permissions before copy-up ovl: root: copy attr ovl: check dentry positiveness in ovl_cleanup_whiteouts() ovl: use a minimal buffer in ovl_copy_xattr ovl: allow zero size xattr futex: Drop refcount if requeue_pi() acquired the rtmutex devm_memremap_release(): fix memremap'd addr handling ipc/shm: handle removed segments gracefully in shm_mmap() intel_scu_ipcutil: underflow in scu_reg_access() mm,thp: khugepaged: call pte flush at the time of collapse dump_stack: avoid potential deadlocks radix-tree: fix oops after radix_tree_iter_retry drivers/hwspinlock: fix race between radix tree insertion and lookup radix-tree: fix race in gang lookup MAINTAINERS: return arch/sh to maintained state, with new maintainers memcg: only free spare array when readers are done numa: fix /proc/<pid>/numa_maps for hugetlbfs on s390 fs/hugetlbfs/inode.c: fix bugs in hugetlb_vmtruncate_list() scripts/bloat-o-meter: fix python3 syntax error dma-debug: switch check from _text to _stext m32r: fix m32104ut_defconfig build fail xhci: Fix list corruption in urb dequeue at host removal Revert "xhci: don't finish a TD if we get a short-transfer event mid TD" iommu/vt-d: Clear PPR bit to ensure we get more page request interrupts iommu/vt-d: Fix 64-bit accesses to 32-bit DMAR_GSTS_REG iommu/vt-d: Fix mm refcounting to hold mm_count not mm_users iommu/amd: Correct the wrong setting of alias DTE in do_attach iommu/vt-d: Don't skip PCI devices when disabling IOTLB Input: vmmouse - fix absolute device registration string_helpers: fix precision loss for some inputs Input: i8042 - add Fujitsu Lifebook U745 to the nomux list Input: elantech - mark protocols v2 and v3 as semi-mt mm: fix regression in remap_file_pages() emulation mm: replace vma_lock_anon_vma with anon_vma_lock_read/write mm: fix mlock accouting libnvdimm: fix namespace object confusion in is_uuid_busy() mm: soft-offline: check return value in second __get_any_page() call perf kvm record/report: 'unprocessable sample' error while recording/reporting guest data KVM: PPC: Fix ONE_REG AltiVec support KVM: PPC: Fix emulation of H_SET_DABR/X on POWER8 KVM: arm/arm64: Fix reference to uninitialised VGIC arm64: dma-mapping: fix handling of devices registered before arch_initcall ARM: OMAP2+: Fix ppa_zero_params and ppa_por_params for rodata ARM: OMAP2+: Fix save_secure_ram_context for rodata ARM: OMAP2+: Fix l2dis_3630 for rodata ARM: OMAP2+: Fix l2_inv_api_params for rodata ARM: OMAP2+: Fix wait_dll_lock_timed for rodata ARM: dts: at91: sama5d4ek: add phy address and IRQ for macb0 ARM: dts: at91: sama5d4 xplained: fix phy0 IRQ type ARM: dts: at91: sama5d4: fix instance id of DBGU ARM: dts: at91: sama5d4 xplained: properly mux phy interrupt ARM: dts: omap5-board-common: enable rtc and charging of backup battery ARM: dts: Fix omap5 PMIC control lines for RTC writes ARM: dts: Fix wl12xx missing clocks that cause hangs ARM: nomadik: fix up SD/MMC DT settings ARM: 8517/1: ICST: avoid arithmetic overflow in icst_hz() ARM: 8519/1: ICST: try other dividends than 1 arm64: mm: avoid calling apply_to_page_range on empty range ARM: mvebu: remove duplicated regulator definition in Armada 388 GP powerpc/ioda: Set "read" permission when "write" is set powerpc/powernv: Fix stale PE primary bus powerpc/eeh: Fix stale cached primary bus powerpc/eeh: Fix PE location code SUNRPC: Fixup socket wait for memory udf: Check output buffer length when converting name to CS0 udf: Prevent buffer overrun with multi-byte characters udf: limit the maximum number of indirect extents in a row pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn nfs: Fix race in __update_open_stateid() pNFS/flexfiles: Fix an Oopsable typo in ff_mirror_match_fh() NFS: Fix attribute cache revalidation cifs: fix erroneous return value cifs_dbg() outputs an uninitialized buffer in cifs_readdir() cifs: fix race between call_async() and reconnect() cifs: Ratelimit kernel log messages iio: inkern: fix a NULL dereference on error iio: pressure: mpl115: fix temperature offset sign iio: light: acpi-als: Report data as processed iio: dac: mcp4725: set iio name property in sysfs iio: add IIO_TRIGGER dependency to STK8BA50 iio: add HAS_IOMEM dependency to VF610_ADC iio-light: Use a signed return type for ltr501_match_samp_freq() iio:adc:ti_am335x_adc Fix buffered mode by identifying as software buffer. iio: adis_buffer: Fix out-of-bounds memory access scsi: fix soft lockup in scsi_remove_target() on module removal SCSI: Add Marvell Console to VPD blacklist scsi_dh_rdac: always retry MODE SELECT on command lock violation drivers/scsi/sg.c: mark VMA as VM_IO to prevent migration SCSI: fix crashes in sd and sr runtime PM iscsi-target: Fix potential dead-lock during node acl delete scsi: add Synology to 1024 sector blacklist klist: fix starting point removed bug in klist iterators tracepoints: Do not trace when cpu is offline tracing: Fix freak link error caused by branch tracer perf tools: tracepoint_error() can receive e=NULL, robustify it tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines ptrace: use fsuid, fsgid, effective creds for fs access checks Btrfs: fix direct IO requests not reporting IO error to user space Btrfs: fix hang on extent buffer lock caused by the inode_paths ioctl Btrfs: fix page reading in extent_same ioctl leading to csum errors Btrfs: fix invalid page accesses in extent_same (dedup) ioctl btrfs: properly set the termination value of ctx->pos in readdir Revert "btrfs: clear PF_NOFREEZE in cleaner_kthread()" Btrfs: fix fitrim discarding device area reserved for boot loader's use btrfs: handle invalid num_stripes in sys_array ext4: don't read blocks from disk after extents being swapped ext4: fix potential integer overflow ext4: fix scheduling in atomic on group checksum failure serial: omap: Prevent DoS using unprivileged ioctl(TIOCSRS485) serial: 8250_pci: Add Intel Broadwell ports tty: Add support for PCIe WCH382 2S multi-IO card pty: make sure super_block is still valid in final /dev/tty close pty: fix possible use after free of tty->driver_data staging/speakup: Use tty_ldisc_ref() for paste kworker phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload phy: twl4030-usb: Relase usb phy on unload ALSA: seq: Fix double port list deletion ALSA: seq: Fix leak of pool buffer at concurrent writes ALSA: pcm: Fix rwsem deadlock for non-atomic PCM stream ALSA: hda - Cancel probe work instead of flush at remove x86/mm: Fix vmalloc_fault() to handle large pages properly x86/uaccess/64: Handle the caching of 4-byte nocache copies properly in __copy_user_nocache() x86/uaccess/64: Make the __copy_user_nocache() assembly code more readable x86/mm/pat: Avoid truncation when converting cpa->numpages to address x86/mm: Fix types used in pgprot cacheability flags translations Linux 4.4.2 HID: multitouch: fix input mode switching on some Elan panels mm, vmstat: fix wrong WQ sleep when memory reclaim doesn't make any progress zsmalloc: fix migrate_zspage-zs_free race condition zram: don't call idr_remove() from zram_remove() zram: try vmalloc() after kmalloc() zram/zcomp: use GFP_NOIO to allocate streams rtlwifi: rtl8821ae: Fix 5G failure when EEPROM is incorrectly encoded rtlwifi: rtl8821ae: Fix errors in parameter initialization crypto: marvell/cesa - fix test in mv_cesa_dev_dma_init() crypto: atmel-sha - remove calls of clk_prepare() from atomic contexts crypto: atmel-sha - fix atmel_sha_remove() crypto: algif_skcipher - Do not set MAY_BACKLOG on the async path crypto: algif_skcipher - Do not dereference ctx without socket lock crypto: algif_skcipher - Do not assume that req is unchanged crypto: user - lock crypto_alg_list on alg dump EVM: Use crypto_memneq() for digest comparisons crypto: algif_hash - wait for crypto_ahash_init() to complete crypto: shash - Fix has_key setting crypto: chacha20-ssse3 - Align stack pointer to 64 bytes crypto: caam - make write transactions bufferable on PPC platforms crypto: algif_skcipher - sendmsg SG marking is off by one crypto: algif_skcipher - Load TX SG list after waiting crypto: crc32c - Fix crc32c soft dependency crypto: algif_skcipher - Fix race condition in skcipher_check_key crypto: algif_hash - Fix race condition in hash_check_key crypto: af_alg - Forbid bind(2) when nokey child sockets are present crypto: algif_skcipher - Remove custom release parent function crypto: algif_hash - Remove custom release parent function crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path ahci: Intel DNV device IDs SATA libata: disable forced PORTS_IMPL for >= AHCI 1.3 crypto: algif_skcipher - Add key check exception for cipher_null crypto: skcipher - Add crypto_skcipher_has_setkey crypto: algif_hash - Require setkey before accept(2) crypto: hash - Add crypto_ahash_has_setkey crypto: algif_skcipher - Add nokey compatibility path crypto: af_alg - Add nokey compatibility path crypto: af_alg - Fix socket double-free when accept fails crypto: af_alg - Disallow bind/setkey/... after accept(2) crypto: algif_skcipher - Require setkey before accept(2) sched: Fix crash in sched_init_numa() ext4 crypto: add missing locking for keyring_key access iommu/io-pgtable-arm: Ensure we free the final level on teardown tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) tty: Retry failed reopen if tty teardown in-progress tty: Wait interruptibly for tty lock on reopen n_tty: Fix unsafe reference to "other" ldisc usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Broxton-M platforms usb: xhci: handle both SSIC ports in PME stuck quirk usb: phy: msm: fix error handling in probe. usb: cdc-acm: send zero packet for intel 7260 modem usb: cdc-acm: handle unlinked urb in acm read callback USB: option: fix Cinterion AHxx enumeration USB: serial: option: Adding support for Telit LE922 USB: cp210x: add ID for IAI USB to RS485 adaptor USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable usb: hub: do not clear BOS field during reset device USB: visor: fix null-deref at probe USB: serial: visor: fix crash on detecting device without write_urbs ASoC: rt5645: fix the shift bit of IN1 boost saa7134-alsa: Only frees registered sound cards ALSA: dummy: Implement timer backend switching more safely ALSA: hda - Fix bad dereference of jack object ALSA: hda - Fix speaker output from VAIO AiO machines Revert "ALSA: hda - Fix noise on Gigabyte Z170X mobo" ALSA: hda - Fix static checker warning in patch_hdmi.c ALSA: hda - Add fixup for Mac Mini 7,1 model ALSA: timer: Fix race between stop and interrupt ALSA: timer: Fix wrong instance passed to slave callbacks ALSA: timer: Fix race at concurrent reads ALSA: timer: Fix link corruption due to double start or stop ALSA: timer: Fix leftover link at closing ALSA: timer: Code cleanup ALSA: seq: Fix lockdep warnings due to double mutex locks ALSA: seq: Fix race at closing in virmidi driver ALSA: seq: Fix yet another races among ALSA timer accesses ASoC: dpcm: fix the BE state on hw_free ALSA: pcm: Fix potential deadlock in OSS emulation ALSA: hda/realtek - Support Dell headset mode for ALC225 ALSA: hda/realtek - Support headset mode for ALC225 ALSA: hda/realtek - New codec support of ALC225 ALSA: rawmidi: Fix race at copying & updating the position ALSA: rawmidi: Remove kernel WARNING for NULL user-space buffer check ALSA: rawmidi: Make snd_rawmidi_transmit() race-free ALSA: seq: Degrade the error message for too many opens ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup() ALSA: dummy: Disable switching timer backend via sysfs ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures ALSA: hda - disable dynamic clock gating on Broxton before reset ALSA: Add missing dependency on CONFIG_SND_TIMER ALSA: bebob: Use a signed return type for get_formation_index ALSA: usb-audio: avoid freeing umidi object twice ALSA: usb-audio: Add native DSD support for PS Audio NuWave DAC ALSA: usb-audio: Fix OPPO HA-1 vendor ID ALSA: usb-audio: Add quirk for Microsoft LifeCam HD-6000 ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay hrtimer: Handle remaining time proper for TIME_LOW_RES md/raid: only permit hot-add of compatible integrity profiles media: i2c: Don't export ir-kbd-i2c module alias parisc: Fix __ARCH_SI_PREAMBLE_SIZE parisc: Protect huge page pte changes with spinlocks printk: do cond_resched() between lines while outputting to consoles tracing/stacktrace: Show entire trace if passed in function not found tracing: Fix stacktrace skip depth in trace_buffer_unlock_commit_regs() PCI: Fix minimum allocation address overwrite PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD mtd: nand: assign reasonable default name for NAND drivers wlcore/wl12xx: spi: fix NULL pointer dereference (Oops) wlcore/wl12xx: spi: fix oops on firmware load ocfs2/dlm: clear refmap bit of recovery lock while doing local recovery cleanup ocfs2/dlm: ignore cleaning the migration mle that is inuse ALSA: hda - Implement loopback control switch for Realtek and other codecs block: fix bio splitting on max sectors base/platform: Fix platform drivers with no probe callback HID: usbhid: fix recursive deadlock ocfs2: NFS hangs in __ocfs2_cluster_lock due to race with ocfs2_unblock_lock block: split bios to max possible length NFSv4.1/pnfs: Fixup an lo->plh_block_lgets imbalance in layoutreturn crypto: sun4i-ss - add missing statesize Linux 4.4.1 arm64: kernel: fix architected PMU registers unconditional access arm64: kernel: enforce pmuserenr_el0 initialization and restore arm64: mm: ensure that the zero page is visible to the page table walker arm64: Clear out any singlestep state on a ptrace detach operation powerpc/module: Handle R_PPC64_ENTRY relocations scripts/recordmcount.pl: support data in text section on powerpc powerpc: Make {cmp}xchg* and their atomic_ versions fully ordered powerpc: Make value-returning atomics fully ordered powerpc/tm: Check for already reclaimed tasks batman-adv: Drop immediate orig_node free function batman-adv: Drop immediate batadv_hard_iface free function batman-adv: Drop immediate neigh_ifinfo free function batman-adv: Drop immediate batadv_neigh_node free function batman-adv: Drop immediate batadv_orig_ifinfo free function batman-adv: Avoid recursive call_rcu for batadv_nc_node batman-adv: Avoid recursive call_rcu for batadv_bla_claim team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid net/mlx5_core: Fix trimming down IRQ number bridge: fix lockdep addr_list_lock false positive splat ipv6: update skb->csum when CE mark is propagated net: bpf: reject invalid shifts phonet: properly unshare skbs in phonet_rcv() dwc_eth_qos: Fix dma address for multi-fragment skbs bonding: Prevent IPv6 link local address on enslaved devices net: preserve IP control block during GSO segmentation udp: disallow UFO for sockets with SO_NO_CHECK option net: pktgen: fix null ptr deref in skb allocation sched,cls_flower: set key address type when present tcp_yeah: don't set ssthresh below 2 ipv6: tcp: add rcu locking in tcp_v6_send_synack() net: sctp: prevent writes to cookie_hmac_alg from accessing invalid memory vxlan: fix test which detect duplicate vxlan iface unix: properly account for FDs passed over unix sockets xhci: refuse loading if nousb is used usb: core: lpm: fix usb3_hardware_lpm sysfs node USB: cp210x: add ID for ELV Marble Sound Board 1 rtlwifi: fix memory leak for USB device ASoC: compress: Fix compress device direction check ASoC: wm5110: Fix PGA clear when disabling DRE ALSA: timer: Handle disconnection more safely ALSA: hda - Flush the pending probe work at remove ALSA: hda - Fix missing module loading with model=generic option ALSA: hda - Fix bass pin fixup for ASUS N550JX ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0 ALSA: hrtimer: Fix stall by hrtimer_cancel() ALSA: pcm: Fix snd_pcm_hw_params struct copy in compat mode ALSA: seq: Fix snd_seq_call_port_info_ioctl in compat mode ALSA: hda - Add fixup for Dell Latitidue E6540 ALSA: timer: Fix double unlink of active_list ALSA: timer: Fix race among timer ioctls ALSA: hda - fix the headset mic detection problem for a Dell laptop ALSA: timer: Harden slave timer list handling ALSA: usb-audio: Fix mixer ctl regression of Native Instrument devices ALSA: hda - Fix white noise on Dell Latitude E5550 ALSA: seq: Fix race at timer setup and close ALSA: usb-audio: Avoid calling usb_autopm_put_interface() at disconnect ALSA: seq: Fix missing NULL check at remove_events ioctl ALSA: hda - Fixup inverted internal mic for Lenovo E50-80 ALSA: usb: Add native DSD support for Oppo HA-1 x86/mm: Improve switch_mm() barrier comments x86/mm: Add barriers and document switch_mm()-vs-flush synchronization x86/boot: Double BOOT_HEAP_SIZE to 64KB x86/reboot/quirks: Add iMac10,1 to pci_reboot_dmi_table[] kvm: x86: Fix vmwrite to SECONDARY_VM_EXEC_CONTROL KVM: x86: correctly print #AC in traces KVM: x86: expose MSR_TSC_AUX to userspace x86/xen: don't reset vcpu_info on a cancelled suspend KEYS: Fix keyring ref leak in join_session_keyring() Conflicts: arch/arm64/kernel/perf_event.c drivers/scsi/sd.c sound/core/compress_offload.c Change-Id: I9f77fe42aaae249c24cd6e170202110ab1426878 Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-03-03ext4: fix bh->b_state corruptionJan Kara
commit ed8ad83808f009ade97ebbf6519bc3a97fefbc0c upstream. ext4 can update bh->b_state non-atomically in _ext4_get_block() and ext4_da_get_block_prep(). Usually this is fine since bh is just a temporary storage for mapping information on stack but in some cases it can be fully living bh attached to a page. In such case non-atomic update of bh->b_state can race with an atomic update which then gets lost. Usually when we are mapping bh and thus updating bh->b_state non-atomically, nobody else touches the bh and so things work out fine but there is one case to especially worry about: ext4_finish_bio() uses BH_Uptodate_Lock on the first bh in the page to synchronize handling of PageWriteback state. So when blocksize < pagesize, we can be atomically modifying bh->b_state of a buffer that actually isn't under IO and thus can race e.g. with delalloc trying to map that buffer. The result is that we can mistakenly set / clear BH_Uptodate_Lock bit resulting in the corruption of PageWriteback state or missed unlock of BH_Uptodate_Lock. Fix the problem by always updating bh->b_state bits atomically. Reported-by: Nikolay Borisov <kernel@kyup.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Nikolay Borisov <kernel@kyup.com> [NB: Backported to 4.4.2] Acked-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25ext4: don't read blocks from disk after extents being swappedEryu Guan
commit bcff24887d00bce102e0857d7b0a8c44a40f53d1 upstream. I notice ext4/307 fails occasionally on ppc64 host, reporting md5 checksum mismatch after moving data from original file to donor file. The reason is that move_extent_per_page() calls __block_write_begin() and block_commit_write() to write saved data from original inode blocks to donor inode blocks, but __block_write_begin() not only maps buffer heads but also reads block content from disk if the size is not block size aligned. At this time the physical block number in mapped buffer head is pointing to the donor file not the original file, and that results in reading wrong data to page, which get written to disk in following block_commit_write call. This also can be reproduced by the following script on 1k block size ext4 on x86_64 host: mnt=/mnt/ext4 donorfile=$mnt/donor testfile=$mnt/testfile e4compact=~/xfstests/src/e4compact rm -f $donorfile $testfile # reserve space for donor file, written by 0xaa and sync to disk to # avoid EBUSY on EXT4_IOC_MOVE_EXT xfs_io -fc "pwrite -S 0xaa 0 1m" -c "fsync" $donorfile # create test file written by 0xbb xfs_io -fc "pwrite -S 0xbb 0 1023" -c "fsync" $testfile # compute initial md5sum md5sum $testfile | tee md5sum.txt # drop cache, force e4compact to read data from disk echo 3 > /proc/sys/vm/drop_caches # test defrag echo "$testfile" | $e4compact -i -v -f $donorfile # check md5sum md5sum -c md5sum.txt Fix it by creating & mapping buffer heads only but not reading blocks from disk, because all the data in page is guaranteed to be up-to-date in mext_page_mkuptodate(). Signed-off-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25ext4: fix potential integer overflowInsu Yun
commit 46901760b46064964b41015d00c140c83aa05bcf upstream. Since sizeof(ext_new_group_data) > sizeof(ext_new_flex_group_data), integer overflow could be happened. Therefore, need to fix integer overflow sanitization. Signed-off-by: Insu Yun <wuninsu@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25ext4: fix scheduling in atomic on group checksum failureJan Kara
commit 05145bd799e498ce4e3b5145894174ee881f02b0 upstream. When block group checksum is wrong, we call ext4_error() while holding group spinlock from ext4_init_block_bitmap() or ext4_init_inode_bitmap() which results in scheduling while in atomic. Fix the issue by calling ext4_error() later after dropping the spinlock. Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-17ext4 crypto: add missing locking for keyring_key accessTheodore Ts'o
commit db7730e3091a52c2fcd8fcc952b964d88998e675 upstream. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-16ext4: Add support for FIDTRIM, a best-effort ioctl for deep discard trimJP Abgrall
* What This provides an interface for issuing an FITRIM which uses the secure discard instead of just a discard. Only the eMMC command is "secure", and not how the FS uses it: due to the fact that the FS might reassign a region somewhere else, the original deleted data will not be affected by the "trim" which only handles un-used regions. So we'll just call it "deep discard", and note that this is a "best effort" cleanup. * Why Once in a while, We want to be able to cleanup most of the unused blocks after erasing a bunch of files. We don't want to constantly secure-discard via a mount option. From an eMMC spec perspective, it tells the device to really get rid of all the data for the specified blocks and not just put them back into the pool of free ones (unlike the normal TRIM). The eMMC spec says the secure trim handling must make sure the data (and metadata) is not available anymore. A simple TRIM doesn't clear the data, it just puts blocks in the free pool. JEDEC Standard No. 84-A441 7.6.9 Secure Erase 7.6.10 Secure Trim From an FS perspective, it is acceptable to leave some data behind. - directory entries related to deleted files - databases entries related to deleted files - small-file data stored in inode extents - blocks held by the FS waiting to be re-used (mitigated by sync). - blocks reassigned by the FS prior to FIDTRIM. Change-Id: I676a1404a80130d93930c84898360f2e6fb2f81e Signed-off-by: Geremy Condra <gcondra@google.com> Signed-off-by: JP Abgrall <jpa@google.com>
2015-12-07Merge tag 'ext4_for_linus_stable' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 fixes from Ted Ts'o: "Ext4 bug fixes for v4.4, including fixes for post-2038 time encodings, some endian conversion problems with ext4 encryption, potential memory leaks after truncate in data=journal mode, and an ocfs2 regression caused by a jbd2 performance improvement" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: jbd2: fix null committed data return in undo_access ext4: add "static" to ext4_seq_##name##_fops struct ext4: fix an endianness bug in ext4_encrypted_follow_link() ext4: fix an endianness bug in ext4_encrypted_zeroout() jbd2: Fix unreclaimed pages after truncate in data=journal mode ext4: Fix handling of extended tv_sec
2015-11-26ext4: add "static" to ext4_seq_##name##_fops structXu Cang
to fix sparse warning, add static to ext4_seq_##name##_fops struct. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-11-26ext4: fix an endianness bug in ext4_encrypted_follow_link()Al Viro
applying le32_to_cpu() to 16bit value is a bad idea... Cc: stable@vger.kernel.org # v4.1+ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-11-26ext4: fix an endianness bug in ext4_encrypted_zeroout()Al Viro
ex->ee_block is not host-endian (note that accesses of other fields of *ex right next to that line go through the helpers that do proper conversion from little-endian to host-endian; it might make sense to add similar for ->ee_block to avoid reintroducing that kind of bugs...) Cc: stable@vger.kernel.org # v4.1+ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-11-24ext4: Fix handling of extended tv_secDavid Turner
In ext4, the bottom two bits of {a,c,m}time_extra are used to extend the {a,c,m}time fields, deferring the year 2038 problem to the year 2446. When decoding these extended fields, for times whose bottom 32 bits would represent a negative number, sign extension causes the 64-bit extended timestamp to be negative as well, which is not what's intended. This patch corrects that issue, so that the only negative {a,c,m}times are those between 1901 and 1970 (as per 32-bit signed timestamps). Some older kernels might have written pre-1970 dates with 1,1 in the extra bits. This patch treats those incorrectly-encoded dates as pre-1970, instead of post-2311, until kernel 4.20 is released. Hopefully by then e2fsck will have fixed up the bad data. Also add a comment explaining the encoding of ext4's extra {a,c,m}time bits. Signed-off-by: David Turner <novalis@novalis.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reported-by: Mark Harris <mh8928@yahoo.com> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=23732 Cc: stable@vger.kernel.org
2015-11-16ext2, ext4: warn when mounting with dax enabledDan Williams
Similar to XFS warn when mounting DAX while it is still considered under development. Also, aspects of the DAX implementation, for example synchronization against multiple faults and faults causing block allocation, depend on the correct implementation in the filesystem. The maturity of a given DAX implementation is filesystem specific. Cc: <stable@vger.kernel.org> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Matthew Wilcox <willy@linux.intel.com> Cc: linux-ext4@vger.kernel.org Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Reported-by: Dave Chinner <david@fromorbit.com> Acked-by: Jan Kara <jack@suse.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2015-11-13Merge branch 'for-linus-3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs xattr cleanups from Al Viro. * 'for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: f2fs: xattr simplifications squashfs: xattr simplifications 9p: xattr simplifications xattr handlers: Pass handler to operations instead of flags jffs2: Add missing capability check for listing trusted xattrs hfsplus: Remove unused xattr handler list operations ubifs: Remove unused security xattr handler vfs: Fix the posix_acl_xattr_list return value vfs: Check attribute names in posix acl xattr handers
2015-11-13xattr handlers: Pass handler to operations instead of flagsAndreas Gruenbacher
The xattr_handler operations are currently all passed a file system specific flags value which the operations can use to disambiguate between different handlers; some file systems use that to distinguish the xattr namespace, for example. In some oprations, it would be useful to also have access to the handler prefix. To allow that, pass a pointer to the handler to operations instead of the flags value alone. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-11-11Merge branch 'for-linus-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs update from Al Viro: - misc stable fixes - trivial kernel-doc and comment fixups - remove never-used block_page_mkwrite() wrapper function, and rename the function that is _actually_ used to not have double underscores. * 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: 9p: cache.h: Add #define of include guard vfs: remove stale comment in inode_operations vfs: remove unused wrapper block_page_mkwrite() binfmt_elf: Correct `arch_check_elf's description fs: fix writeback.c kernel-doc warnings fs: fix inode.c kernel-doc warning fs/pipe.c: return error code rather than 0 in pipe_write() fs/pipe.c: preserve alloc_file() error code binfmt_elf: Don't clobber passed executable's file header FS-Cache: Handle a write to the page immediately beyond the EOF marker cachefiles: perform test on s_blocksize when opening cache file. FS-Cache: Don't override netfs's primary_index if registering failed FS-Cache: Increase reference of parent after registering, netfs success debugfs: fix refcount imbalance in start_creating
2015-11-11vfs: remove unused wrapper block_page_mkwrite()Ross Zwisler
The function currently called "__block_page_mkwrite()" used to be called "block_page_mkwrite()" until a wrapper for this function was added by: commit 24da4fab5a61 ("vfs: Create __block_page_mkwrite() helper passing error values back") This wrapper, the current "block_page_mkwrite()", is currently unused. __block_page_mkwrite() is used directly by ext4, nilfs2 and xfs. Remove the unused wrapper, rename __block_page_mkwrite() back to block_page_mkwrite() and update the comment above block_page_mkwrite(). Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Reviewed-by: Jan Kara <jack@suse.com> Cc: Jan Kara <jack@suse.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-11-09remove abs64()Andrew Morton
Switch everything to the new and more capable implementation of abs(). Mainly to give the new abs() a bit of a workout. Cc: Michal Nazarewicz <mina86@mina86.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-11-07Merge branch 'akpm' (patches from Andrew)Linus Torvalds
Merge second patch-bomb from Andrew Morton: - most of the rest of MM - procfs - lib/ updates - printk updates - bitops infrastructure tweaks - checkpatch updates - nilfs2 update - signals - various other misc bits: coredump, seqfile, kexec, pidns, zlib, ipc, dma-debug, dma-mapping, ... * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (102 commits) ipc,msg: drop dst nil validation in copy_msg include/linux/zutil.h: fix usage example of zlib_adler32() panic: release stale console lock to always get the logbuf printed out dma-debug: check nents in dma_sync_sg* dma-mapping: tidy up dma_parms default handling pidns: fix set/getpriority and ioprio_set/get in PRIO_USER mode kexec: use file name as the output message prefix fs, seqfile: always allow oom killer seq_file: reuse string_escape_str() fs/seq_file: use seq_* helpers in seq_hex_dump() coredump: change zap_threads() and zap_process() to use for_each_thread() coredump: ensure all coredumping tasks have SIGNAL_GROUP_COREDUMP signal: remove jffs2_garbage_collect_thread()->allow_signal(SIGCONT) signal: introduce kernel_signal_stop() to fix jffs2_garbage_collect_thread() signal: turn dequeue_signal_lock() into kernel_dequeue_signal() signals: kill block_all_signals() and unblock_all_signals() nilfs2: fix gcc uninitialized-variable warnings in powerpc build nilfs2: fix gcc unused-but-set-variable warnings MAINTAINERS: nilfs2: add header file for tracing nilfs2: add tracepoints for analyzing reading and writing metadata files ...
2015-11-07Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial updates from Jiri Kosina: "Trivial stuff from trivial tree that can be trivially summed up as: - treewide drop of spurious unlikely() before IS_ERR() from Viresh Kumar - cosmetic fixes (that don't really affect basic functionality of the driver) for pktcdvd and bcache, from Julia Lawall and Petr Mladek - various comment / printk fixes and updates all over the place" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: bcache: Really show state of work pending bit hwmon: applesmc: fix comment typos Kconfig: remove comment about scsi_wait_scan module class_find_device: fix reference to argument "match" debugfs: document that debugfs_remove*() accepts NULL and error values net: Drop unlikely before IS_ERR(_OR_NULL) mm: Drop unlikely before IS_ERR(_OR_NULL) fs: Drop unlikely before IS_ERR(_OR_NULL) drivers: net: Drop unlikely before IS_ERR(_OR_NULL) drivers: misc: Drop unlikely before IS_ERR(_OR_NULL) UBI: Update comments to reflect UBI_METAONLY flag pktcdvd: drop null test before destroy functions
2015-11-06mm, fs: introduce mapping_gfp_constraint()Michal Hocko
There are many places which use mapping_gfp_mask to restrict a more generic gfp mask which would be used for allocations which are not directly related to the page cache but they are performed in the same context. Let's introduce a helper function which makes the restriction explicit and easier to track. This patch doesn't introduce any functional changes. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Michal Hocko <mhocko@suse.com> Suggested-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-11-06mm, page_alloc: distinguish between being unable to sleep, unwilling to ↵Mel Gorman
sleep and avoiding waking kswapd __GFP_WAIT has been used to identify atomic context in callers that hold spinlocks or are in interrupts. They are expected to be high priority and have access one of two watermarks lower than "min" which can be referred to as the "atomic reserve". __GFP_HIGH users get access to the first lower watermark and can be called the "high priority reserve". Over time, callers had a requirement to not block when fallback options were available. Some have abused __GFP_WAIT leading to a situation where an optimisitic allocation with a fallback option can access atomic reserves. This patch uses __GFP_ATOMIC to identify callers that are truely atomic, cannot sleep and have no alternative. High priority users continue to use __GFP_HIGH. __GFP_DIRECT_RECLAIM identifies callers that can sleep and are willing to enter direct reclaim. __GFP_KSWAPD_RECLAIM to identify callers that want to wake kswapd for background reclaim. __GFP_WAIT is redefined as a caller that is willing to enter direct reclaim and wake kswapd for background reclaim. This patch then converts a number of sites o __GFP_ATOMIC is used by callers that are high priority and have memory pools for those requests. GFP_ATOMIC uses this flag. o Callers that have a limited mempool to guarantee forward progress clear __GFP_DIRECT_RECLAIM but keep __GFP_KSWAPD_RECLAIM. bio allocations fall into this category where kswapd will still be woken but atomic reserves are not used as there is a one-entry mempool to guarantee progress. o Callers that are checking if they are non-blocking should use the helper gfpflags_allow_blocking() where possible. This is because checking for __GFP_WAIT as was done historically now can trigger false positives. Some exceptions like dm-crypt.c exist where the code intent is clearer if __GFP_DIRECT_RECLAIM is used instead of the helper due to flag manipulations. o Callers that built their own GFP flags instead of starting with GFP_KERNEL and friends now also need to specify __GFP_KSWAPD_RECLAIM. The first key hazard to watch out for is callers that removed __GFP_WAIT and was depending on access to atomic reserves for inconspicuous reasons. In some cases it may be appropriate for them to use __GFP_HIGH. The second key hazard is callers that assembled their own combination of GFP flags instead of starting with something like GFP_KERNEL. They may now wish to specify __GFP_KSWAPD_RECLAIM. It's almost certainly harmless if it's missed in most cases as other activity will wake kswapd. Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Acked-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Christoph Lameter <cl@linux.com> Cc: David Rientjes <rientjes@google.com> Cc: Vitaly Wool <vitalywool@gmail.com> Cc: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-11-06Merge tag 'ext4_for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 updates from Ted Ts'o: "Add support for the CSUM_SEED feature which will allow future userspace utilities to change the file system's UUID without rewriting all of the file system metadata. A number of miscellaneous fixes, the most significant of which are in the ext4 encryption support. Anyone wishing to use the encryption feature should backport all of the ext4 crypto patches up to 4.4 to get fixes to a memory leak and file system corruption bug. There are also cleanups in ext4's feature test macros and in ext4's sysfs support code" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (26 commits) fs/ext4: remove unnecessary new_valid_dev check ext4: fix abs() usage in ext4_mb_check_group_pa ext4: do not allow journal_opts for fs w/o journal ext4: explicit mount options parsing cleanup ext4, jbd2: ensure entering into panic after recording an error in superblock [PATCH] fix calculation of meta_bg descriptor backups ext4: fix potential use after free in __ext4_journal_stop jbd2: fix checkpoint list cleanup ext4: fix xfstest generic/269 double revoked buffer bug with bigalloc ext4: make the bitmap read routines return real error codes jbd2: clean up feature test macros with predicate functions ext4: clean up feature test macros with predicate functions ext4: call out CRC and corruption errors with specific error codes ext4: store checksum seed in superblock ext4: reserve code points for the project quota feature ext4: promote ext4 over ext2 in the default probe order jbd2: gate checksum calculations on crc driver presence, not sb flags ext4: use private version of page_zero_new_buffers() for data=journal mode ext4 crypto: fix bugs in ext4_encrypted_zeroout() ext4 crypto: replace some BUG_ON()'s with error checks ...
2015-11-05Merge branch 'next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull security subsystem update from James Morris: "This is mostly maintenance updates across the subsystem, with a notable update for TPM 2.0, and addition of Jarkko Sakkinen as a maintainer of that" * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (40 commits) apparmor: clarify CRYPTO dependency selinux: Use a kmem_cache for allocation struct file_security_struct selinux: ioctl_has_perm should be static selinux: use sprintf return value selinux: use kstrdup() in security_get_bools() selinux: use kmemdup in security_sid_to_context_core() selinux: remove pointless cast in selinux_inode_setsecurity() selinux: introduce security_context_str_to_sid selinux: do not check open perm on ftruncate call selinux: change CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE default KEYS: Merge the type-specific data with the payload data KEYS: Provide a script to extract a module signature KEYS: Provide a script to extract the sys cert list from a vmlinux file keys: Be more consistent in selection of union members used certs: add .gitignore to stop git nagging about x509_certificate_list KEYS: use kvfree() in add_key Smack: limited capability for changing process label TPM: remove unnecessary little endian conversion vTPM: support little endian guests char: Drop owner assignment from i2c_driver ...
2015-10-29fs/ext4: remove unnecessary new_valid_dev checkYaowei Bai
As new_valid_dev always returns 1, so !new_valid_dev check is not needed, remove it. Signed-off-by: Yaowei Bai <bywxiaobai@163.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-10-21KEYS: Merge the type-specific data with the payload dataDavid Howells
Merge the type-specific data with the payload data into one four-word chunk as it seems pointless to keep them separate. Use user_key_payload() for accessing the payloads of overloaded user-defined keys. Signed-off-by: David Howells <dhowells@redhat.com> cc: linux-cifs@vger.kernel.org cc: ecryptfs@vger.kernel.org cc: linux-ext4@vger.kernel.org cc: linux-f2fs-devel@lists.sourceforge.net cc: linux-nfs@vger.kernel.org cc: ceph-devel@vger.kernel.org cc: linux-ima-devel@lists.sourceforge.net
2015-10-19ext4: fix abs() usage in ext4_mb_check_group_paJohn Stultz
The ext4_fsblk_t type is a long long, which should not be used with abs(), as is done in ext4_mb_check_group_pa(). This patch modifies ext4_mb_check_group_pa() to use abs64() instead. Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-10-18ext4: do not allow journal_opts for fs w/o journalDmitry Monakhov
It is appeared that we can pass journal related mount options and such options be shown in /proc/mounts Example: #mkfs.ext4 -F /dev/vdb #tune2fs -O ^has_journal /dev/vdb #mount /dev/vdb /mnt/ -ocommit=20,journal_async_commit #cat /proc/mounts | grep /mnt /dev/vdb /mnt ext4 rw,relatime,journal_checksum,journal_async_commit,commit=20,data=ordered 0 0 But options:"journal_checksum,journal_async_commit,commit=20,data=ordered" has nothing with reality because there is no journal at all. This patch disallow following options for journalless configurations: - journal_checksum - journal_async_commit - commit=%ld - data={writeback,ordered,journal} Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
2015-10-18ext4: explicit mount options parsing cleanupDmitry Monakhov
Currently MOPT_EXPLICIT treated as EXPLICIT_DELALLOC which may be changed in future. Let's fix it now. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-10-18ext4, jbd2: ensure entering into panic after recording an error in superblockDaeho Jeong
If a EXT4 filesystem utilizes JBD2 journaling and an error occurs, the journaling will be aborted first and the error number will be recorded into JBD2 superblock and, finally, the system will enter into the panic state in "errors=panic" option. But, in the rare case, this sequence is little twisted like the below figure and it will happen that the system enters into panic state, which means the system reset in mobile environment, before completion of recording an error in the journal superblock. In this case, e2fsck cannot recognize that the filesystem failure occurred in the previous run and the corruption wouldn't be fixed. Task A Task B ext4_handle_error() -> jbd2_journal_abort() -> __journal_abort_soft() -> __jbd2_journal_abort_hard() | -> journal->j_flags |= JBD2_ABORT; | | __ext4_abort() | -> jbd2_journal_abort() | | -> __journal_abort_soft() | | -> if (journal->j_flags & JBD2_ABORT) | | return; | -> panic() | -> jbd2_journal_update_sb_errno() Tested-by: Hobin Woo <hobin.woo@samsung.com> Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@vger.kernel.org
2015-10-18[PATCH] fix calculation of meta_bg descriptor backupsAndy Leiserson
"group" is the group where the backup will be placed, and is initialized to zero in the declaration. This meant that backups for meta_bg descriptors were erroneously written to the backup block group descriptors in groups 1 and (desc_per_block-1). Reproduction information: mke2fs -Fq -t ext4 -b 1024 -O ^resize_inode /tmp/foo.img 16G truncate -s 24G /tmp/foo.img losetup /dev/loop0 /tmp/foo.img mount /dev/loop0 /mnt resize2fs /dev/loop0 umount /dev/loop0 dd if=/dev/zero of=/dev/loop0 bs=1024 count=2 e2fsck -fy /dev/loop0 losetup -d /dev/loop0 Signed-off-by: Andy Leiserson <andy@leiserson.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@vger.kernel.org
2015-10-17ext4: fix potential use after free in __ext4_journal_stopLukas Czerner
There is a use-after-free possibility in __ext4_journal_stop() in the case that we free the handle in the first jbd2_journal_stop() because we're referencing handle->h_err afterwards. This was introduced in 9705acd63b125dee8b15c705216d7186daea4625 and it is wrong. Fix it by storing the handle->h_err value beforehand and avoid referencing potentially freed handle. Fixes: 9705acd63b125dee8b15c705216d7186daea4625 Signed-off-by: Lukas Czerner <lczerner@redhat.com> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Cc: stable@vger.kernel.org
2015-10-17ext4: fix xfstest generic/269 double revoked buffer bug with bigallocDaeho Jeong
When you repeatly execute xfstest generic/269 with bigalloc_1k option enabled using the below command: "./kvm-xfstests -c bigalloc_1k -m nodelalloc -C 1000 generic/269" you can easily see the below bug message. "JBD2 unexpected failure: jbd2_journal_revoke: !buffer_revoked(bh);" This means that an already revoked buffer is erroneously revoked again and it is caused by doing revoke for the buffer at the wrong position in ext4_free_blocks(). We need to re-position the buffer revoke procedure for an unspecified buffer after checking the cluster boundary for bigalloc option. If not, some part of the cluster can be doubly revoked. Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
2015-10-17ext4: make the bitmap read routines return real error codesDarrick J. Wong
Make the bitmap reaading routines return real error codes (EIO, EFSCORRUPTED, EFSBADCRC) which can then be reflected back to userspace for more precise diagnosis work. In particular, this means that mballoc no longer claims that we're out of memory if the block bitmaps become corrupt. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-10-17ext4: clean up feature test macros with predicate functionsDarrick J. Wong
Create separate predicate functions to test/set/clear feature flags, thereby replacing the wordy old macros. Furthermore, clean out the places where we open-coded feature tests. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2015-10-17ext4: call out CRC and corruption errors with specific error codesDarrick J. Wong
Instead of overloading EIO for CRC errors and corrupt structures, return the same error codes that XFS returns for the same issues. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-10-17ext4: store checksum seed in superblockDarrick J. Wong
Allow the filesystem to store the metadata checksum seed in the superblock and add an incompat feature to say that we're using it. This enables tune2fs to change the UUID on a mounted metadata_csum FS without having to (racy!) rewrite all disk metadata. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-10-17ext4: reserve code points for the project quota featureTheodore Ts'o
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-10-16Merge branch 'akpm' (patches from Andrew)Linus Torvalds
Merge misc fixes from Andrew Morton: "6 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: sh: add copy_user_page() alias for __copy_user() lib/Kconfig: ZLIB_DEFLATE must select BITREVERSE mm, dax: fix DAX deadlocks memcg: convert threshold to bytes builddeb: remove debian/files before build mm, fs: obey gfp_mapping for add_to_page_cache()
2015-10-16mm, fs: obey gfp_mapping for add_to_page_cache()Michal Hocko
Commit 6afdb859b710 ("mm: do not ignore mapping_gfp_mask in page cache allocation paths") has caught some users of hardcoded GFP_KERNEL used in the page cache allocation paths. This, however, wasn't complete and there were others which went unnoticed. Dave Chinner has reported the following deadlock for xfs on loop device: : With the recent merge of the loop device changes, I'm now seeing : XFS deadlock on my single CPU, 1GB RAM VM running xfs/073. : : The deadlocked is as follows: : : kloopd1: loop_queue_read_work : xfs_file_iter_read : lock XFS inode XFS_IOLOCK_SHARED (on image file) : page cache read (GFP_KERNEL) : radix tree alloc : memory reclaim : reclaim XFS inodes : log force to unpin inodes : <wait for log IO completion> : : xfs-cil/loop1: <does log force IO work> : xlog_cil_push : xlog_write : <loop issuing log writes> : xlog_state_get_iclog_space() : <blocks due to all log buffers under write io> : <waits for IO completion> : : kloopd1: loop_queue_write_work : xfs_file_write_iter : lock XFS inode XFS_IOLOCK_EXCL (on image file) : <wait for inode to be unlocked> : : i.e. the kloopd, with it's split read and write work queues, has : introduced a dependency through memory reclaim. i.e. that writes : need to be able to progress for reads make progress. : : The problem, fundamentally, is that mpage_readpages() does a : GFP_KERNEL allocation, rather than paying attention to the inode's : mapping gfp mask, which is set to GFP_NOFS. : : The didn't used to happen, because the loop device used to issue : reads through the splice path and that does: : : error = add_to_page_cache_lru(page, mapping, index, : GFP_KERNEL & mapping_gfp_mask(mapping)); This has changed by commit aa4d86163e4 ("block: loop: switch to VFS ITER_BVEC"). This patch changes mpage_readpage{s} to follow gfp mask set for the mapping. There are, however, other places which are doing basically the same. lustre:ll_dir_filler is doing GFP_KERNEL from the function which apparently uses GFP_NOFS for other allocations so let's make this consistent. cifs:readpages_get_pages is called from cifs_readpages and __cifs_readpages_from_fscache called from the same path obeys mapping gfp. ramfs_nommu_expand_for_mapping is hardcoding GFP_KERNEL as well regardless it uses mapping_gfp_mask for the page allocation. ext4_mpage_readpages is the called from the page cache allocation path same as read_pages and read_cache_pages As I've noticed in my previous post I cannot say I would be happy about sprinkling mapping_gfp_mask all over the place and it sounds like we should drop gfp_mask argument altogether and use it internally in __add_to_page_cache_locked that would require all the filesystems to use mapping gfp consistently which I am not sure is the case here. From a quick glance it seems that some file system use it all the time while others are selective. Signed-off-by: Michal Hocko <mhocko@suse.com> Reported-by: Dave Chinner <david@fromorbit.com> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Ming Lei <ming.lei@canonical.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-10-15ext4: use private version of page_zero_new_buffers() for data=journal modeTheodore Ts'o
If there is a error while copying data from userspace into the page cache during a write(2) system call, in data=journal mode, in ext4_journalled_write_end() were using page_zero_new_buffers() from fs/buffer.c. Unfortunately, this sets the buffer dirty flag, which is no good if journalling is enabled. This is a long-standing bug that goes back for years and years in ext3, but a combination of (a) data=journal not being very common, (b) in many case it only results in a warning message. and (c) only very rarely causes the kernel hang, means that we only really noticed this as a problem when commit 998ef75ddb caused this failure to happen frequently enough to cause generic/208 to fail when run in data=journal mode. The fix is to have our own version of this function that doesn't call mark_dirty_buffer(), since we will end up calling ext4_handle_dirty_metadata() on the buffer head(s) in questions very shortly afterwards in ext4_journalled_write_end(). Thanks to Dave Hansen and Linus Torvalds for helping to identify the root cause of the problem. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.com>
2015-10-03ext4 crypto: fix bugs in ext4_encrypted_zeroout()Theodore Ts'o
Fix multiple bugs in ext4_encrypted_zeroout(), including one that could cause us to write an encrypted zero page to the wrong location on disk, potentially causing data and file system corruption. Fortunately, this tends to only show up in stress tests, but even with these fixes, we are seeing some test failures with generic/127 --- but these are now caused by data failures instead of metadata corruption. Since ext4_encrypted_zeroout() is only used for some optimizations to keep the extent tree from being too fragmented, and ext4_encrypted_zeroout() itself isn't all that optimized from a time or IOPS perspective, disable the extent tree optimization for encrypted inodes for now. This prevents the data corruption issues reported by generic/127 until we can figure out what's going wrong. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@vger.kernel.org
2015-10-03ext4 crypto: replace some BUG_ON()'s with error checksTheodore Ts'o
Buggy (or hostile) userspace should not be able to cause the kernel to crash. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@vger.kernel.org
2015-10-03ext4 crypto: ext4_page_crypto() doesn't need a encryption contextTheodore Ts'o
Since ext4_page_crypto() doesn't need an encryption context (at least not any more), this allows us to simplify a number function signature and also allows us to avoid needing to allocate a context in ext4_block_write_begin(). It also means we no longer need a separate ext4_decrypt_one() function. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-10-03ext4: optimize ext4_writepage() for attempted 4k delalloc writesTheodore Ts'o
In cases where the file system block size is the same as the page size, and ext4_writepage() is asked to write out a page which is either has the unwritten bit set in the extent tree, or which does not yet have a block assigned due to delayed allocation, we can bail out early and, unlocking the page earlier and avoiding a round trip through ext4_bio_write_page() with the attendant calls to set_page_writeback() and redirty_page_for_writeback(). Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-10-02ext4 crypto: fix memory leak in ext4_bio_write_page()Theodore Ts'o
There are times when ext4_bio_write_page() is called even though we don't actually need to do any I/O. This happens when ext4_writepage() gets called by the jbd2 commit path when an inode needs to force its pages written out in order to provide data=ordered guarantees --- and a page is backed by an unwritten (e.g., uninitialized) block on disk, or if delayed allocation means the page's backing store hasn't been allocated yet. In that case, we need to skip the call to ext4_encrypt_page(), since in addition to wasting CPU, it leads to a bounce page and an ext4 crypto context getting leaked. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@vger.kernel.org