Merge 4.9.178 into android-4.9
Linux 4.9.178
KVM: x86: Skip EFER vs. guest CPUID checks for host-initiated writes
ALSA: hda/realtek - Fix for Lenovo B50-70 inverted internal microphone bug
* ext4: fix data corruption caused by overlapping unaligned and aligned IO
fs/ext4/file.c
* ext4: zero out the unused memory region in the extent tree block
fs/ext4/extents.c
* fs/writeback.c: use rcu_barrier() to wait for inflight wb switches going into workqueue when umount
fs/fs-writeback.c
* writeback: synchronize sync(2) against cgroup writeback membership switches
fs/fs-writeback.c
include/linux/backing-dev-defs.h
mm/backing-dev.c
* fib_rules: fix error in backport of e9919a24d302 ("fib_rules: return 0...")
net/core/fib_rules.c
crypto: arm/aes-neonbs - don't access already-freed walk.iv
crypto: salsa20 - don't access already-freed walk.iv
* crypto: gcm - fix incompatibility between "gcm" and "gcm_base"
crypto/gcm.c
* crypto: gcm - Fix error return code in crypto_gcm_create_common()
crypto/gcm.c
ipmi:ssif: compare block number correctly for multi-part return messages
bcache: never set KEY_PTRS of journal key to 0 in journal_reclaim()
bcache: fix a race between cache register and cacheset unregister
Btrfs: do not start a transaction at iterate_extent_inodes()
* ext4: fix ext4_show_options for file systems w/o journal
fs/ext4/super.c
* ext4: actually request zeroing of inode table after grow
fs/ext4/ioctl.c
* jbd2: check superblock mapped prior to committing
fs/jbd2/journal.c
tty/vt: fix write/write race in ioctl(KDSKBSENT) handler
mfd: max77620: Fix swapped FPS_PERIOD_MAX_US values
mfd: da9063: Fix OTP control register names to match datasheets for DA9063/63L
ocfs2: fix ocfs2 read inode data panic in ocfs2_iget
* mm/mincore.c: make mincore() more conservative
mm/mincore.c
ASoC: RT5677-SPI: Disable 16Bit SPI Transfers
ASoC: max98090: Fix restore of DAPM Muxes
ALSA: hda/realtek - EAPD turn on later
ALSA: hda/hdmi - Consider eld_valid when reporting jack event
ALSA: hda/hdmi - Read the pin sense from register when repolling
* ALSA: usb-audio: Fix a memory leak bug
sound/usb/mixer.c
crypto: x86/crct10dif-pcl - fix use via crypto_shash_digest()
crypto: crct10dif-generic - fix use via crypto_shash_digest()
crypto: vmx - fix copy-paste error in CTR mode
crypto: chacha20poly1305 - set cra_name correctly
sched/x86: Save [ER]FLAGS on context switch
* arm64: Clear OSDLR_EL1 on CPU boot
arch/arm64/kernel/debug-monitors.c
* arm64: compat: Reduce address limit
arch/arm64/include/asm/processor.h
power: supply: axp288_charger: Fix unchecked return value
ARM: exynos: Fix a leaked reference by adding missing of_node_put
objtool: Fix function fallthrough detection
x86/speculation/mds: Improve CPU buffer clear documentation
x86/speculation/mds: Revert CPU buffer clear on double fault exit
PCI: hv: Fix a memory leak in hv_eject_device_work()
* locking/rwsem: Prevent decrement of reader count before increment
kernel/locking/rwsem-xadd.c
* net: core: another layer of lists, around PF_MEMALLOC skb handling
include/linux/list.h
* UPSTREAM: fib_rules: fix error in backport of e9919a24d302 ("fib_rules: return 0...")
net/core/fib_rules.c
* UPSTREAM: bpf: relax inode permission check for retrieving bpf program
kernel/bpf/inode.c
Merge 4.9.177 into android-4.9
Linux 4.9.177
powerpc/booke64: set RI in default MSR
powerpc/lib: fix book3s/32 boot failure due to code patching
drivers/virt/fsl_hypervisor.c: prevent integer overflow in ioctl
drivers/virt/fsl_hypervisor.c: dereferencing error pointers in ioctl
* bonding: fix arp_validate toggling in active-backup mode
drivers/net/bonding/bond_options.c
* ipv4: Fix raw socket lookup for local traffic
net/ipv4/raw.c
* vrf: sit mtu should not be updated when vrf netdev is the link
net/ipv6/sit.c
vlan: disable SIOCSHWTSTAMP in container
* packet: Fix error path in packet_init
net/packet/af_packet.c
net: ucc_geth - fix Oops when changing number of buffers in the ring
* fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied
net/core/fib_rules.c
* bridge: Fix error path for kobject_init_and_add()
net/bridge/br_if.c
powerpc/64s: Include cpu header
x86/vdso: Pass --eh-frame-hdr to the linker
x86/vdso: Drop implicit common-page-size linker flag
x86: vdso: Use $LD instead of $CC to link
Revert "x86: vdso: Use $LD instead of $CC to link"
Revert "x86/vdso: Drop implicit common-page-size linker flag"
Don't jump to compute_result state from check_result state
rtlwifi: rtl8723ae: Fix missing break in switch statement
* ALSA: pcm: remove SNDRV_PCM_IOCTL1_INFO internal command
include/sound/pcm.h
sound/core/pcm_lib.c
sound/core/pcm_native.c
cw1200: fix missing unlock on error in cw1200_hw_scan()
Input: synaptics-rmi4 - fix possible double free
spi: ST ST95HF NFC: declare missing of table
spi: Micrel eth switch: declare missing of table
gpu: ipu-v3: dp: fix CSC handling
selftests/net: correct the return value for run_netsocktests
drm/sun4i: Set device driver data at bind time for use in unbind
s390: ctcm: fix ctcm_new_device error return code
MIPS: perf: ath79: Fix perfcount IRQ assignment
ipvs: do not schedule icmp errors from tunnels
selftests: netfilter: check icmp pkttoobig errors are set as related
* init: initialize jump labels before command line option parsing
init/main.c
tools lib traceevent: Fix missing equality check for strcmp
KVM: x86: avoid misreporting level-triggered irqs as edge-triggered in tracing
* x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T
include/linux/efi.h
mISDN: Check address length before reading address family
s390/3270: fix lockdep false positive on view->lock
mac80211: fix unaligned access in mesh table hash function
s390/dasd: Fix capacity calculation for large volumes
libnvdimm/btt: Fix a kmemdup failure check
* HID: input: add mapping for "Toggle Display" key
drivers/hid/hid-input.c
* HID: input: add mapping for keyboard Brightness Up/Down/Toggle keys
drivers/hid/hid-input.c
* HID: input: add mapping for Expose/Overview key
drivers/hid/hid-input.c
libnvdimm/namespace: Fix a potential NULL pointer dereference
iio: adc: xilinx: fix potential use-after-free on remove
USB: serial: fix unthrottle races
platform/x86: sony-laptop: Fix unintentional fall-through
* bpf: convert htab map to hlist_nulls
include/linux/list_nulls.h
include/linux/rculist_nulls.h
kernel/bpf/hashtab.c
* bpf: fix struct htab_elem layout
kernel/bpf/hashtab.c
* netfilter: compat: initialize all fields in xt_init
net/netfilter/x_tables.c
ANDROID: cuttlefish_defconfig: Disable DEVTMPFS
ANDROID: Move from clang r349610 to r353983c.
Merge upstream-f2fs-stable-linux-4.9.y into android-4.9
Merge 4.9.176 into android-4.9
Linux 4.9.176
x86/cpu/bugs: Use __initconst for 'const' init data
x86: stop exporting msr-index.h to userland
x86/speculation/mds: Fix documentation typo
Documentation: Correct the possible MDS sysfs values
x86/mds: Add MDSUM variant to the MDS documentation
x86/speculation/mds: Add 'mitigations=' support for MDS
x86/speculation: Support 'mitigations=' cmdline option
* cpu/speculation: Add 'mitigations=' cmdline option
include/linux/cpu.h
kernel/cpu.c
x86/speculation/mds: Print SMT vulnerable on MSBDS with mitigations off
x86/speculation/mds: Fix comment
x86/speculation/mds: Add SMT warning message
x86/speculation: Move arch_smt_update() call to after mitigation decisions
x86/speculation/mds: Add mds=full,nosmt cmdline option
Documentation: Add MDS vulnerability documentation
Documentation: Move L1TF to separate directory
x86/speculation/mds: Add mitigation mode VMWERV
* x86/speculation/mds: Add sysfs reporting for MDS
drivers/base/cpu.c
include/linux/cpu.h
x86/speculation/mds: Add mitigation control for MDS
x86/speculation/mds: Conditionally clear CPU buffers on idle entry
x86/kvm/vmx: Add MDS protection when L1D Flush is not active
x86/speculation/mds: Clear CPU buffers on exit to user
x86/speculation/mds: Add mds_clear_cpu_buffers()
x86/kvm: Expose X86_FEATURE_MD_CLEAR to guests
x86/speculation/mds: Add BUG_MSBDS_ONLY
x86/speculation/mds: Add basic bug infrastructure for MDS
x86/speculation: Consolidate CPU whitelists
x86/msr-index: Cleanup bit defines
kvm: x86: Report STIBP on GET_SUPPORTED_CPUID
x86/speculation: Provide IBPB always command line options
x86/speculation: Add seccomp Spectre v2 user space protection mode
x86/speculation: Enable prctl mode for spectre_v2_user
* x86/speculation: Add prctl() control for indirect branch speculation
include/linux/sched.h
include/uapi/linux/prctl.h
x86/speculation: Prevent stale SPEC_CTRL msr content
x86/speculation: Prepare arch_smt_update() for PRCTL mode
x86/speculation: Split out TIF update
x86/speculation: Prepare for conditional IBPB in switch_mm()
x86/speculation: Avoid __switch_to_xtra() calls
x86/process: Consolidate and simplify switch_to_xtra() code
x86/speculation: Prepare for per task indirect branch speculation control
x86/speculation: Add command line control for indirect branch speculation
x86/speculation: Unify conditional spectre v2 print functions
x86/speculataion: Mark command line parser data __initdata
x86/speculation: Mark string arrays const correctly
x86/speculation: Reorder the spec_v2 code
x86/l1tf: Show actual SMT state
* x86/speculation: Rework SMT state change
include/linux/sched/smt.h
kernel/cpu.c
* sched: Add sched_smt_active()
include/linux/sched/smt.h
kernel/sched/core.c
kernel/sched/sched.h
x86/Kconfig: Select SCHED_SMT if SMP enabled
x86/speculation: Reorganize speculation control MSRs update
x86/speculation: Rename SSBD update functions
x86/speculation: Disable STIBP when enhanced IBRS is in use
x86/speculation: Move STIPB/IBPB string conditionals out of cpu_show_common()
x86/speculation: Remove unnecessary ret variable in cpu_show_common()
x86/speculation: Clean up spectre_v2_parse_cmdline()
x86/speculation: Update the TIF_SSBD comment
x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
x86/speculation: Propagate information about RSB filling mitigation to sysfs
* x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
kernel/cpu.c
* x86/speculation: Apply IBPB more strictly to avoid cross-process data leak
include/linux/ptrace.h
kernel/ptrace.c
Documentation/l1tf: Fix small spelling typo
x86/cpu: Sanitize FAM6_ATOM naming
x86/speculation: Remove SPECTRE_V2_IBRS in enum spectre_v2_mitigation
* locking/atomics, asm-generic: Move some macros from <linux/bitops.h> to a new <linux/bits.h> file
include/linux/bitops.h
include/linux/bits.h
x86/speculation: Simplify the CPU bug detection logic
* bitops: avoid integer overflow in GENMASK(_ULL)
include/linux/bitops.h
x86/mm: Use WRITE_ONCE() when setting PTEs
x86/microcode: Update the new microcode revision unconditionally
x86/microcode: Make sure boot_cpu_data.microcode is up-to-date
x86/microcode/intel: Check microcode revision before updating sibling threads
x86/microcode/intel: Add a helper which gives the microcode revision
x86/bugs: Fix the AMD SSBD usage of the SPEC_CTRL MSR
x86/bugs: Switch the selection of mitigation from CPU vendor to CPU features
x86/bugs: Add AMD's SPEC_CTRL MSR usage
x86/bugs: Add AMD's variant of SSB_NO
x86/cpufeatures: Hide AMD-specific speculation flags
x86/MCE: Save microcode revision in machine check records
Merge 4.9.175 into android-4.9
Linux 4.9.175
timer/debug: Change /proc/timer_stats from 0644 to 0600
ASoC: Intel: avoid Oops if DMA setup fails
UAS: fix alignment of scatter/gather segments
* Bluetooth: Align minimum encryption key size for LE and BR/EDR connections
include/net/bluetooth/hci_core.h
net/bluetooth/hci_conn.c
Bluetooth: hidp: fix buffer overflow
scsi: qla2xxx: Fix incorrect region-size setting in optrom SYSFS routines
* usb-storage: Set virt_boundary_mask to avoid SG overflows
drivers/usb/storage/scsiglue.c
USB: serial: f81232: fix interrupt worker not stop
* usb: dwc3: Fix default lpm_nyet_threshold value
drivers/usb/dwc3/core.c
* genirq: Prevent use-after-free and work list corruption
kernel/irq/manage.c
ARM: 8680/1: boot/compressed: fix inappropriate Thumb2 mnemonic for __nop
* mm: add 'try_get_page()' helper function
include/linux/mm.h
iommu/amd: Set exclusion range correctly
virtio-blk: limit number of hw queues by nr_cpu_ids
drm/mediatek: fix possible object reference leak
scsi: csiostor: fix missing data copy in csio_scsi_err_handler()
* linux/kernel.h: Use parentheses around argument in u64_to_user_ptr()
include/linux/kernel.h
perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS
drm/mediatek: Fix an error code in mtk_hdmi_dt_parse_pdata()
ASoC: tlv320aic32x4: Fix Common Pins
IB/hfi1: Eliminate opcode tests on mr deref
ASoC: cs4270: Set auto-increment bit for register writes
ASoC: nau8810: fix the issue of widget with prefixed name
* ASoC:soc-pcm:fix a codec fixup issue in TDM case
sound/soc/soc-pcm.c
staging: greybus: power_supply: fix prop-descriptor request size
ubsan: Fix nasty -Wbuiltin-declaration-mismatch GCC-9 warnings
scsi: libsas: fix a race condition when smp task timeout
* f2fs: fix to avoid accessing xattr across the boundary
fs/f2fs/xattr.c
fs/f2fs/xattr.h
* f2fs: fix to avoid potential race on sbi->unusable_block_count access/update
fs/f2fs/checkpoint.c
fs/f2fs/segment.c
fs/f2fs/super.c
* f2fs: add tracepoint for f2fs_filemap_fault()
fs/f2fs/file.c
include/trace/events/f2fs.h
* f2fs: introduce DATA_GENERIC_ENHANCE
fs/f2fs/checkpoint.c
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/gc.c
fs/f2fs/inode.c
fs/f2fs/node.c
fs/f2fs/recovery.c
fs/f2fs/segment.c
fs/f2fs/segment.h
* f2fs: fix to handle error in f2fs_disable_checkpoint()
fs/f2fs/super.c
* f2fs: remove redundant check in f2fs_file_write_iter()
fs/f2fs/file.c
* f2fs: fix to be aware of readonly device in write_checkpoint()
fs/f2fs/checkpoint.c
* f2fs: fix to skip recovery on readonly device
fs/f2fs/checkpoint.c
fs/f2fs/super.c
* f2fs: fix to consider multiple device for readonly check
fs/f2fs/f2fs.h
fs/f2fs/super.c
* f2fs: relocate chksum_offset for large_nat_bitmap feature
fs/f2fs/checkpoint.c
fs/f2fs/f2fs.h
* f2fs: allow unfixed f2fs_checkpoint.checksum_offset
fs/f2fs/checkpoint.c
include/linux/f2fs_fs.h
* f2fs: Replace spaces with tab
fs/f2fs/acl.c
* f2fs: insert space before the open parenthesis '('
fs/f2fs/acl.c
* f2fs: allow address pointer number of dnode aligning to specified size
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/gc.c
fs/f2fs/node.c
fs/f2fs/super.c
include/linux/f2fs_fs.h
* f2fs: introduce f2fs_read_single_page() for cleanup
fs/f2fs/data.c
* f2fs: mark is_extension_exist() inline
fs/f2fs/namei.c
* f2fs: fix to set FI_UPDATE_WRITE correctly
fs/f2fs/data.c
* f2fs: fix to avoid panic in f2fs_inplace_write_data()
fs/f2fs/segment.c
* f2fs: fix to do sanity check on valid block count of segment
fs/f2fs/segment.h
* f2fs: fix to do sanity check on valid node/block count
fs/f2fs/super.c
* f2fs: fix to avoid panic in do_recover_data()
fs/f2fs/recovery.c
* f2fs: fix to do sanity check on free nid
fs/f2fs/node.c
* f2fs: fix to do checksum even if inode page is uptodate
fs/f2fs/inode.c
fs/f2fs/node.c
* f2fs: fix to avoid panic in f2fs_remove_inode_page()
fs/f2fs/node.c
* f2fs: fix to clear dirty inode in error path of f2fs_iget()
fs/f2fs/inode.c
* f2fs: remove new blank line of f2fs kernel message
fs/f2fs/file.c
fs/f2fs/super.c
* f2fs: fix wrong __is_meta_io() macro
fs/f2fs/checkpoint.c
fs/f2fs/data.c
fs/f2fs/f2fs.h
* f2fs: fix to avoid panic in dec_valid_node_count()
fs/f2fs/f2fs.h
* f2fs: fix to avoid panic in dec_valid_block_count()
fs/f2fs/f2fs.h
* f2fs: fix to use inline space only if inline_xattr is enable
fs/f2fs/f2fs.h
* f2fs: fix to retrieve inline xattr space
fs/f2fs/inline.c
* f2fs: fix error path of recovery
fs/f2fs/recovery.c
* f2fs: fix to avoid deadloop in foreground GC
fs/f2fs/gc.c
* f2fs: data: fix warning Using plain integer as NULL pointer
fs/f2fs/data.c
* f2fs: add tracepoint for f2fs_file_write_iter()
fs/f2fs/file.c
include/trace/events/f2fs.h
* f2fs: add comment for conditional compilation statement
fs/f2fs/f2fs.h
* f2fs: fix potential recursive call when enabling data_flush
fs/f2fs/checkpoint.c
fs/f2fs/data.c
* f2fs: improve discard handling with multi-device volumes
fs/f2fs/f2fs.h
fs/f2fs/segment.c
* f2fs: Reduce zoned block device memory usage
fs/f2fs/f2fs.h
fs/f2fs/segment.c
fs/f2fs/super.c
* f2fs: Fix use of number of devices
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/gc.c
fs/f2fs/segment.c
* ANDROID: block/cfq-iosched: make group_idle per io cgroup tunable
block/cfq-iosched.c
Merge remote-tracking branch 'origin/upstream-f2fs-stable-linux-4.9.y' into android-4.9
ANDROID: cuttlefish_defconfig: Enable CONFIG_CPUSETS and CONFIG_CGROUP_SCHEDTUNE
ANDROID: Communicates LMK events to userland where they can be logged
Merge 4.9.174 into android-4.9
Linux 4.9.174
media: v4l2: i2c: ov7670: Fix PLL bypass register values
x86/mce: Improve error message when kernel cannot recover, p2
* selinux: never allow relabeling on context mounts
security/selinux/hooks.c
Input: snvs_pwrkey - initialize necessary driver data before enabling IRQ
scsi: RDMA/srpt: Fix a credit leak for aborted commands
staging: iio: adt7316: fix the dac write calculation
staging: iio: adt7316: fix the dac read calculation
staging: iio: adt7316: allow adt751x to use internal vref for all dacs
perf/x86/amd: Update generic hardware cache events for Family 17h
ARM: iop: don't use using 64-bit DMA masks
ARM: orion: don't use using 64-bit DMA masks
xsysace: Fix error handling in ace_setup
sh: fix multiple function definition build errors
hugetlbfs: fix memory leak for resv_map
net: hns: Fix WARNING when remove HNS driver with SMMU enabled
net: hns: Use NAPI_POLL_WEIGHT for hns driver
net: hns: fix KASAN: use-after-free in hns_nic_net_xmit_hw()
scsi: storvsc: Fix calculation of sub-channel count
* scsi: core: add new RDAC LENOVO/DE_Series device
drivers/scsi/scsi_devinfo.c
vfio/pci: use correct format characters
rtc: da9063: set uie_unsupported when relevant
* debugfs: fix use-after-free on symlink traversal
fs/debugfs/inode.c
jffs2: fix use-after-free on symlink traversal
net: stmmac: don't log oversized frames
net: stmmac: fix dropping of multi-descriptor RX frames
net: stmmac: don't overwrite discard_frame status
* bonding: show full hw address in sysfs for slave entries
drivers/net/bonding/bond_sysfs_slave.c
net/mlx5: E-Switch, Fix esw manager vport indication for more vport commands
igb: Fix WARN_ONCE on runtime suspend
batman-adv: Reduce tt_global hash refcnt only for removed entry
batman-adv: Reduce tt_local hash refcnt only for removed entry
batman-adv: Reduce claim hash refcnt only for removed entry
rtc: sh: Fix invalid alarm warning for non-enabled alarm
* HID: debug: fix race condition with between rdesc_show() and device removal
drivers/hid/hid-debug.c
HID: logitech: check the return value of create_singlethread_workqueue
nvme-loop: init nvmet_ctrl fatal_err_work when allocate
* USB: core: Fix bug caused by duplicate interface PM usage counter
drivers/usb/core/driver.c
include/linux/usb.h
* USB: core: Fix unterminated string returned by usb_string()
drivers/usb/core/message.c
usb: usbip: fix isoc packet num validation in get_pipe
USB: w1 ds2490: Fix bug caused by improper use of altsetting array
USB: yurex: Fix protection fault after device removal
caif: reduce stack size with KASAN
* arm64: mm: don't print out page table entries on EL0 faults
arch/arm64/mm/fault.c
* arm64: mm: print out correct page table entries
arch/arm64/include/asm/system_misc.h
arch/arm64/mm/fault.c
* kasan: prevent compiler from optimizing away memset in tests
lib/Makefile
* arm64: proc: Set PTE_NG for table entries to avoid traversing them twice
arch/arm64/mm/proc.S
kasan: remove redundant initialization of variable 'real_size'
kasan: avoid -Wmaybe-uninitialized warning
* kasan: add a prototype of task_struct to avoid warning
include/linux/kasan.h
arm64: kasan: avoid bad virt_to_pfn()
x86/unwind: Disable KASAN checks for non-current tasks
mm/kasan: Switch to using __pa_symbol and lm_alias
x86/suspend: fix false positive KASAN warning on suspend/resume
net: phy: marvell: Fix buffer overrun with stats counters
bnxt_en: Improve multicast address setup logic.
* packet: validate msg_namelen in send directly
net/packet/af_packet.c
* ipv6: invert flowlabel sharing check in process and user mode
net/ipv6/ip6_flowlabel.c
* ipv6/flowlabel: wait rcu grace period before put_pid()
net/ipv6/ip6_flowlabel.c
* ipv4: ip_do_fragment: Preserve skb_iif during fragmentation
net/ipv4/ip_output.c
ALSA: line6: use dynamic buffers
* ext4: don't bother checking for encryption key in ->mmap()
fs/ext4/file.c
ANDROID: cuttlefish 4.9: enable CONFIG_CRYPTO_AES_NI_INTEL=y
Merge 4.9.173 into android-4.9
Linux 4.9.173
vfio/type1: Limit DMA mappings per container
leds: pca9532: fix a potential NULL pointer dereference
kconfig/[mn]conf: handle backspace (^H) key
* gpio: of: Fix of_gpiochip_add() error path
drivers/gpio/gpiolib-of.c
libata: fix using DMA buffers on stack
scsi: zfcp: reduce flood of fcrscn1 trace records on multi-element RSCN
ceph: fix use-after-free on symlink traversal
usb: u132-hcd: fix resource leak
scsi: qla4xxx: fix a potential NULL pointer dereference
net: ethernet: ti: fix possible object reference leak
net: ibm: fix possible object reference leak
net: xilinx: fix possible object reference leak
NFS: Fix a typo in nfs_init_timeout_values()
staging: rtl8712: uninitialized memory in read_bbreg_hdl()
net: ks8851: Set initial carrier state to down
net: ks8851: Delay requesting IRQ until opened
net: ks8851: Reassert reset pin if chip ID check fails
net: ks8851: Dequeue RX packets explicitly
ARM: dts: pfla02: increase phy reset duration
usb: gadget: net2272: Fix net2272_dequeue()
usb: gadget: net2280: Fix net2280_dequeue()
usb: gadget: net2280: Fix overrun of OUT messages
serial: ar933x_uart: Fix build failure with disabled console
sc16is7xx: missing unregister/delete driver on error in sc16is7xx_init()
netfilter: bridge: set skb transport_header before entering NF_INET_PRE_ROUTING
netfilter: nft_set_rbtree: check for inactive element after flag mismatch
qlcnic: Avoid potential NULL pointer dereference
s390: limit brk randomization to 32MB
ARM: dts: bcm283x: Fix hdmi hpd gpio pull
media: vivid: check if the cec_adapter is valid
usbnet: ipheth: fix potential null pointer dereference in ipheth_carrier_set
usbnet: ipheth: prevent TX queue timeouts when device not ready
Merge 4.9.172 into android-4.9
Linux 4.9.172
Documentation: Add nospectre_v1 parameter
powerpc/fsl: Add FSL_PPC_BOOK3E as supported arch for nospectre_v2 boot arg
* net: IP6 defrag: use rbtrees in nf_conntrack_reasm.c
net/ipv6/netfilter/nf_conntrack_reasm.c
* net: IP6 defrag: use rbtrees for IPv6 defrag
include/net/ipv6_frag.h
net/ipv6/reassembly.c
* ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module
include/net/ipv6.h
include/net/ipv6_frag.h
net/ipv6/netfilter/nf_conntrack_reasm.c
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
net/ipv6/reassembly.c
* net: IP defrag: encapsulate rbtree defrag code into callable functions
include/net/inet_frag.h
net/ipv4/inet_fragment.c
net/ipv4/ip_fragment.c
* ipv6: frags: fix a lockdep false positive
net/ipv6/reassembly.c
* ipv4: set the tcp_min_rtt_wlen range from 0 to one day
net/ipv4/sysctl_net_ipv4.c
net: stmmac: move stmmac_check_ether_addr() to driver probe
team: fix possible recursive locking when add slaves
net: rds: exchange of 8K and 1M pool
net/mlx5e: ethtool, Remove unsupported SFP EEPROM high pages query
mlxsw: spectrum: Fix autoneg status in ethtool
* ipv4: add sanity checks in ipv4_link_failure()
net/ipv4/route.c
* Revert "block/loop: Use global lock for ioctl() operation."
drivers/block/loop.c
drivers/block/loop.h
tipc: check link name with right length in tipc_nl_compat_link_set
tipc: check bearer name with right length in tipc_nl_compat_bearer_enable
fm10k: Fix a potential NULL pointer dereference
* netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON
net/bridge/netfilter/ebtables.c
NFS: Forbid setting AF_INET6 to "struct sockaddr_in"->sin_family.
* fs/proc/proc_sysctl.c: Fix a NULL pointer dereference
fs/proc/proc_sysctl.c
intel_th: gth: Fix an off-by-one in output unassigning
* slip: make slhc_free() silently accept an error pointer
drivers/net/slip/slhc.c
tipc: handle the err returned from cmd header function
vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
* USB: Consolidate LPM checks to avoid enabling LPM twice
drivers/usb/core/driver.c
drivers/usb/core/hub.c
drivers/usb/core/message.c
* USB: Add new USB LPM helpers
drivers/usb/core/driver.c
drivers/usb/core/hub.c
drivers/usb/core/message.c
drivers/usb/core/sysfs.c
drivers/usb/core/usb.h
drm/vc4: Fix compilation error reported by kbuild test bot
drm/vc4: Fix memory leak during gpu reset.
ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache
dmaengine: sh: rcar-dmac: With cyclic DMA residue 0 is valid
Input: synaptics-rmi4 - write config register values to the right offset
sunrpc: don't mark uninitialised items as VALID.
nfsd: Don't release the callback slot unless it was actually held
ceph: fix ci->i_head_snapc leak
ceph: ensure d_name stability in ceph_dentry_hash()
* sched/numa: Fix a possible divide-by-zero
kernel/sched/fair.c
IB/rdmavt: Fix frwr memory registration
* trace: Fix preempt_enable_no_resched() abuse
kernel/trace/ring_buffer.c
MIPS: scall64-o32: Fix indirect syscall number load
* tracing: Fix a memory leak by early error exit in trace_pid_write()
kernel/trace/trace.c
cifs: do not attempt cifs operation on smb2+ rename error
* kbuild: simplify ld-option implementation
scripts/Kbuild.include
Merge 4.9.171 into android-4.9
Linux 4.9.171
* kernel/sysctl.c: fix out-of-bounds access when setting file-max
kernel/sysctl.c
Revert "locking/lockdep: Add debug_locks check in __lock_downgrade()"
i2c-hid: properly terminate i2c_hid_dmi_desc_override_table[] array
* percpu: stop printing kernel addresses
mm/percpu.c
* ALSA: info: Fix racy addition/deletion of nodes
sound/core/info.c
* mm/vmstat.c: fix /proc/vmstat format for CONFIG_DEBUG_TLBFLUSH=y CONFIG_SMP=n
mm/vmstat.c
device_cgroup: fix RCU imbalance in error case
* sched/fair: Limit sched_cfs_period_timer() loop to avoid hard lockup
kernel/sched/fair.c
* Revert "kbuild: use -Oz instead of -Os when using clang"
Makefile
perf/x86/amd: Add event map for AMD Family 17h
mac80211: do not call driver wake_tx_queue op during reconfig
rt2x00: do not increment sequence number while re-transmitting
* kprobes: Fix error check when reusing optimized probes
kernel/kprobes.c
kprobes: Mark ftrace mcount handler functions nokprobe
* x86/kprobes: Verify stack frame on kretprobe
include/linux/kprobes.h
* arm64: futex: Restore oldval initialization to work around buggy compilers
arch/arm64/include/asm/futex.h
crypto: x86/poly1305 - fix overflow during partial reduction
Revert "svm: Fix AVIC incomplete IPI emulation"
Revert "scsi: fcoe: clear FC_RP_STARTED flags when receiving a LOGO"
* ALSA: core: Fix card races between register and disconnect
sound/core/init.c
staging: comedi: ni_usb6501: Fix possible double-free of ->usb_rx_buf
staging: comedi: ni_usb6501: Fix use of uninitialized mutex
staging: comedi: vmk80xx: Fix possible double-free of ->usb_rx_buf
staging: comedi: vmk80xx: Fix use of uninitialized semaphore
io: accel: kxcjk1013: restore the range after resume.
iio: adc: at91: disable adc channel interrupt in timeout case
iio: ad_sigma_delta: select channel when reading register
iio/gyro/bmg160: Use millidegrees for temperature scale
staging: iio: ad7192: Fix ad7193 channel address
KVM: x86: Don't clear EFER during SMM transitions for 32-bit vCPU
CIFS: keep FileInfo handle live during oplock break
tpm/tpm_i2c_atmel: Return -E2BIG when the transfer is incomplete
* modpost: file2alias: check prototype of handler
scripts/mod/file2alias.c
* modpost: file2alias: go back to simple devtable lookup
scripts/mod/file2alias.c
* mmc: sdhci: Fix data command CRC error handling
drivers/mmc/host/sdhci.c
crypto: crypto4xx - properly set IV after de- and encrypt
* ipv4: ensure rcu_read_lock() in ipv4_link_failure()
net/ipv4/route.c
* ipv4: recompile ip options in ipv4_link_failure
net/ipv4/route.c
vhost: reject zero size iova range
team: set slave to promisc if team is already in promisc mode
* tcp: tcp_grow_window() needs to respect tcp_space()
net/ipv4/tcp_input.c
net: fou: do not use guehdr after iptunnel_pull_offloads in gue_udp_recv
* net: bridge: multicast: use rcu to access port list from br_multicast_start_querier
net/bridge/br_multicast.c
* net: bridge: fix per-port af_packet sockets
net/bridge/br_input.c
net: atm: Fix potential Spectre v1 vulnerabilities
* bonding: fix event handling for stacked bonds
drivers/net/bonding/bond_main.c
* UPSTREAM: usb: hcd: use correct device pointer for dma ops
drivers/usb/core/hcd.c
UPSTREAM: usb: host: ehci: use correct device pointer for dma ops
* UPSTREAM: usb: separate out sysdev pointer from usb_bus
drivers/usb/core/buffer.c
drivers/usb/core/hcd.c
drivers/usb/core/usb.c
include/linux/usb.h
include/linux/usb/hcd.h
ANDROID: cuttlefish_defconfig: Enable CONFIG_XFRM_STATISTICS
Merge 4.9.170 into android-4.9
Linux 4.9.170
* appletalk: Fix compile regression
include/linux/atalk.h
net: stmmac: Set dma ring length before enabling the DMA
tpm/tpm_crb: Avoid unaligned reads in crb_recv()
* include/linux/swap.h: use offsetof() instead of custom __swapoffset macro
include/linux/swap.h
* lib/div64.c: off by one in shift
lib/div64.c
* appletalk: Fix use-after-free in atalk_proc_exit
include/linux/atalk.h
ARM: 8839/1: kprobe: make patch_lock a raw_spinlock_t
lkdtm: Add tests for NULL pointer dereference
soc/tegra: pmc: Drop locking from tegra_powergate_is_powered()
iommu/dmar: Fix buffer overflow during PCI bus notification
crypto: sha512/arm - fix crash bug in Thumb2 build
crypto: sha256/arm - fix crash bug in Thumb2 build
* kernel: hung_task.c: disable on suspend
kernel/hung_task.c
cifs: fallback to older infolevels on findfirst queryinfo retry
ACPI / SBS: Fix GPE storm on recent MacBookPro's
ARM: samsung: Limit SAMSUNG_PM_CHECK config option to non-Exynos platforms
HID: i2c-hid: override HID descriptors for certain devices
serial: uartps: console_setup() can't be placed to init section
* f2fs: fix to do sanity check with current segment number
fs/f2fs/super.c
9p locks: add mount option for lock retry interval
9p: do not trust pdu content for stat item size
rsi: improve kernel thread handling to fix kernel panic
gpio: pxa: handle corner case of unprobed device
* ext4: prohibit fstrim in norecovery mode
fs/ext4/ioctl.c
fix incorrect error code mapping for OBJECTID_NOT_FOUND
x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error
iommu/vt-d: Check capability before disabling protected memory
x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors
x86/hpet: Prevent potential NULL pointer dereference
irqchip/mbigen: Don't clear eventid when freeing an MSI
perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test()
perf tests: Fix a memory leak of cpu_map object in the openat_syscall_event_on_all_cpus test
perf evsel: Free evsel->counts in perf_evsel__exit()
perf hist: Add missing map__put() in error case
perf top: Fix error handling in cmd_top()
perf build-id: Fix memory leak in print_sdt_events()
perf config: Fix a memory leak in collect_config()
perf config: Fix an error in the config template documentation
tools/power turbostat: return the exit status of a command
thermal/int340x_thermal: fix mode setting
thermal/int340x_thermal: Add additional UUIDs
ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration
mmc: davinci: remove extraneous __init annotation
IB/mlx4: Fix race condition between catas error reset and aliasguid flows
ALSA: sb8: add a check for request_region
ALSA: echoaudio: add a check for ioremap_nocache
* ext4: report real fs size after failed resize
fs/ext4/resize.c
* ext4: add missing brelse() in add_new_gdb_meta_bg()
fs/ext4/resize.c
* perf/core: Restore mmap record type correctly
kernel/events/core.c
ARC: u-boot args: check that magic number is correct
ANDROID: cuttlefish_defconfig: Enable L2TP/PPTP
* ANDROID: Makefile: Properly resolve 4.9.169 merge
Makefile
Make arm64 serial port config compatible with crosvm
Merge 4.9.169 into android-4.9
Linux 4.9.169
* PCI: Add function 1 DMA alias quirk for Marvell 9170 SATA controller
drivers/pci/quirks.c
xtensa: fix return_address
* sched/fair: Do not re-read ->h_load_next during hierarchical load calculation
kernel/sched/fair.c
xen: Prevent buffer overflow in privcmd ioctl
parisc: Use cr16 interval timers unconditionally on qemu
* arm64: futex: Fix FUTEX_WAKE_OP atomic ops with non-zero result value
arch/arm64/include/asm/futex.h
ARM: dts: at91: Fix typo in ISC_D0 on PC9
virtio: Honour 'may_reduce_num' in vring_create_virtqueue
* genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent()
kernel/irq/chip.c
* block: do not leak memory in bio_copy_user_iov()
block/bio.c
Btrfs: do not allow trimming when a fs is mounted with the nologreplay option
ASoC: fsl_esai: fix channel swap issue when stream starts
* include/linux/bitrev.h: fix constant bitrev
include/linux/bitrev.h
parisc: Detect QEMU earlier in boot process
ALSA: seq: Fix OOB-reads from strlcpy
* ip6_tunnel: Match to ARPHRD_TUNNEL6 for dev type
net/ipv6/ip6_tunnel.c
* net: ethtool: not call vzalloc for zero sized memory request
net/core/ethtool.c
* netns: provide pure entropy for net_hash_mix()
include/net/net_namespace.h
include/net/netns/hash.h
net/core/net_namespace.c
net/mlx5e: Add a lock on tir list
bnxt_en: Improve RX consumer index validity check.
bnxt_en: Reset device on RX buffer errors.
* vrf: check accept_source_route on the original netdevice
include/net/ip.h
net/ipv4/ip_input.c
net/ipv4/ip_options.c
tcp: Ensure DCTCP reacts to losses
sctp: initialize _pad of sockaddr_in before copying to user memory
qmi_wwan: add Olicard 600
openvswitch: fix flow actions reallocation
net: rds: force to destroy connection if t_sock is NULL in rds_tcp_kill_sock().
kcm: switch order of device registration to fix a crash
* ipv6: sit: reset ip header pointer in ipip6_rcv
net/ipv6/sit.c
* ipv6: Fix dangling pointer when ipv6 fragment
net/ipv6/ip6_output.c
* tty: ldisc: add sysctl to prevent autoloading of ldiscs
drivers/tty/Kconfig
drivers/tty/tty_io.c
drivers/tty/tty_ldisc.c
* tty: mark Siemens R3964 line discipline as BROKEN
drivers/char/Kconfig
* arm64: kaslr: Reserve size of ARM64_MEMSTART_ALIGN in linear region
arch/arm64/mm/init.c
powerpc/security: Fix spectre_v2 reporting
powerpc/fsl: Fix the flush of branch predictor.
powerpc/fsl: Fixed warning: orphan section `__btb_flush_fixup'
powerpc/fsl: Update Spectre v2 reporting
powerpc/fsl: Enable runtime patching if nospectre_v2 boot arg is used
powerpc/fsl: Flush branch predictor when entering KVM
powerpc/fsl: Flush the branch predictor at each kernel entry (32 bit)
powerpc/fsl: Flush the branch predictor at each kernel entry (64bit)
powerpc/fsl: Add nospectre_v2 command line argument
powerpc/fsl: Emulate SPRN_BUCSR register
powerpc/fsl: Fix spectre_v2 mitigations reporting
powerpc/fsl: Add macro to flush the branch predictor
powerpc/fsl: Add infrastructure to fixup branch predictor flush
powerpc/powernv: Query firmware for count cache flush settings
powerpc/pseries: Query hypervisor for count cache flush settings
powerpc/64s: Add support for software count cache flush
powerpc/64s: Add new security feature flags for count cache flush
powerpc/asm: Add a patch_site macro & helpers for patching instructions
powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms
powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E
powerpc/64: Make meltdown reporting Book3S 64 specific
powerpc/64: Call setup_barrier_nospec() from setup_arch()
powerpc/64: Add CONFIG_PPC_BARRIER_NOSPEC
powerpc/64: Make stf barrier PPC_BOOK3S_64 specific.
powerpc/64: Disable the speculation barrier from the command line
powerpc64s: Show ori31 availability in spectre_v1 sysfs file not v2
powerpc/64s: Enhance the information in cpu_show_spectre_v1()
powerpc/64: Use barrier_nospec in syscall entry
powerpc: Use barrier_nospec in copy_from_user()
powerpc/64s: Enable barrier_nospec based on firmware settings
powerpc/64s: Patch barrier_nospec in modules
powerpc: Avoid code patching freed init sections
powerpc/64s: Add support for ori barrier_nospec patching
powerpc/64s: Add barrier_nospec
powerpc: Fix invalid use of register expressions
* lib/string.c: implement a basic bcmp
include/linux/string.h
lib/string.c
x86/vdso: Drop implicit common-page-size linker flag
x86: vdso: Use $LD instead of $CC to link
* kbuild: clang: choose GCC_TOOLCHAIN_DIR not on LD
Makefile
powerpc/tm: Limit TM code inside PPC_TRANSACTIONAL_MEM
x86/power: Make restore_processor_context() sane
x86/power/32: Move SYSENTER MSR restoration to fix_processor_context()
x86/power/64: Use struct desc_ptr for the IDT in struct saved_context
x86/power: Fix some ordering bugs in __restore_processor_context()
* fscrypt: remove filesystem specific build config option
fs/crypto/Kconfig
fs/crypto/fscrypt_private.h
fs/ext4/Kconfig
fs/ext4/dir.c
fs/ext4/ext4.h
fs/ext4/inode.c
fs/ext4/ioctl.c
fs/ext4/namei.c
fs/ext4/page-io.c
fs/ext4/readpage.c
fs/ext4/super.c
fs/ext4/sysfs.c
fs/f2fs/Kconfig
fs/f2fs/f2fs.h
fs/f2fs/super.c
fs/f2fs/sysfs.c
include/linux/fs.h
include/linux/fscrypt.h
* f2fs: use IS_ENCRYPTED() to check encryption status
fs/f2fs/data.c
fs/f2fs/dir.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/inode.c
fs/f2fs/namei.c
* ext4: use IS_ENCRYPTED() to check encryption status
fs/ext4/dir.c
fs/ext4/ext4.h
fs/ext4/ext4_jbd2.h
fs/ext4/extents.c
fs/ext4/file.c
fs/ext4/ialloc.c
fs/ext4/inode.c
fs/ext4/move_extent.c
fs/ext4/namei.c
fs/ext4/page-io.c
fs/ext4/readpage.c
* fscrypt: return -EXDEV for incompatible rename or link into encrypted dir
fs/crypto/hooks.c
fs/crypto/policy.c
include/linux/fscrypt.h
* fscrypt: remove CRYPTO_CTR dependency
fs/crypto/Kconfig
* fscrypt: add Adiantum support / removed speck
fs/crypto/crypto.c
fs/crypto/fname.c
fs/crypto/fscrypt_private.h
fs/crypto/keyinfo.c
fs/crypto/policy.c
include/uapi/linux/fs.h
* ANDROID: Makefile: Add '-fsplit-lto-unit' to cfi-clang-flags
Makefile
Merge 4.9.168 into android-4.9
Linux 4.9.168
ACPI / video: Extend chassis-type detection with a "Lunch Box" check
* drm/dp/mst: Configure no_stop_bit correctly for remote i2c xfers
drivers/gpu/drm/drm_dp_mst_topology.c
dmaengine: tegra: avoid overflow of byte tracking
x86/build: Mark per-CPU symbols as absolute explicitly for LLD
wlcore: Fix memory leak in case wl12xx_fetch_firmware failure
* selinux: do not override context on context mounts
security/selinux/hooks.c
x86/build: Specify elf_i386 linker emulation explicitly for i386 objects
drm/nouveau: Stop using drm_crtc_force_disable
regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting
media: s5p-jpeg: Check for fmt_ver_flag when doing fmt enumeration
netfilter: physdev: relax br_netfilter dependency
dmaengine: qcom_hidma: assign channel cookie correctly
dmaengine: imx-dma: fix warning comparison of distinct pointer types
hpet: Fix missing '=' character in the __setup() code of hpet_mmap_enable
HID: intel-ish: ipc: handle PIMR before ish_wakeup also clear PISR busy_clear bit
soc/tegra: fuse: Fix illegal free of IO base address
hwrng: virtio - Avoid repeated init of completion
media: mt9m111: set initial frame size other than 0x0
powerpc/pseries: Perform full re-add of CPU for topology update post-migration
* tty: increase the default flip buffer limit to 2*640K
drivers/tty/tty_buffer.c
ARM: avoid Cortex-A9 livelock on tight dmb loops
mt7601u: bump supported EEPROM version
soc: qcom: gsbi: Fix error handling in gsbi_probe()
ARM: dts: lpc32xx: Remove leading 0x and 0s from bindings notation
efi/memattr: Don't bail on zero VA if it equals the region's PA
ASoC: fsl-asoc-card: fix object reference leaks in fsl_asoc_card_probe
e1000e: fix cyclic resets at link up with active tx
cdrom: Fix race condition in cdrom_sysctl_register
* fbdev: fbmem: fix memory access if logo is bigger than the screen
drivers/video/fbdev/core/fbmem.c
iw_cxgb4: fix srqidx leak during connection abort
* genirq: Avoid summation loops for /proc/stat
include/linux/irqdesc.h
kernel/irq/chip.c
kernel/irq/internals.h
kernel/irq/irqdesc.c
bcache: improve sysfs_strtoul_clamp()
bcache: fix input overflow to sequential_cutoff
bcache: fix input overflow to cache set sysfs file io_error_halflife
* usb: f_fs: Avoid crash due to out-of-scope stack ptr access
drivers/usb/gadget/function/f_fs.c
* ALSA: PCM: check if ops are defined before suspending PCM
sound/core/pcm_native.c
ARM: 8833/1: Ensure that NEON code always compiles with Clang
* kprobes: Prohibit probing on bsearch()
lib/bsearch.c
ACPI / video: Refactor and fix dmi_is_desktop()
iwlwifi: pcie: fix emergency path
leds: lp55xx: fix null deref on firmware load failure
HID: intel-ish-hid: avoid binding wrong ishtp_cl_device
* vfs: fix preadv64v2 and pwritev64v2 compat syscalls with offset == -1
fs/read_write.c
media: mx2_emmaprp: Correct return type for mem2mem buffer helpers
media: s5p-g2d: Correct return type for mem2mem buffer helpers
media: s5p-jpeg: Correct return type for mem2mem buffer helpers
media: sh_veu: Correct return type for mem2mem buffer helpers
SoC: imx-sgtl5000: add missing put_device()
perf test: Fix failure of 'evsel-tp-sched' test on s390
scsi: megaraid_sas: return error when create DMA pool failed
IB/mlx4: Increase the timeout for CM cache
mlxsw: spectrum: Avoid -Wformat-truncation warnings
e1000e: Fix -Wformat-truncation warnings
mmc: omap: fix the maximum timeout setting
iommu/io-pgtable-arm-v7s: Only kmemleak_ignore L2 tables
ARM: 8840/1: use a raw_spinlock_t in unwind
coresight: etm4x: Add support to enable ETMv4.2
* scsi: core: replace GFP_ATOMIC with GFP_KERNEL in scsi_scan.c
drivers/scsi/scsi_scan.c
usb: chipidea: Grab the (legacy) USB PHY by phandle first
crypto: crypto4xx - add missing of_node_put after of_device_is_available
wil6210: check null pointer in _wil_cfg80211_merge_extra_ies
tools lib traceevent: Fix buffer overflow in arg_eval
* fs: fix guard_bio_eod to check for real EOD errors
fs/buffer.c
* jbd2: fix invalid descriptor block checksum
fs/jbd2/commit.c
cifs: Fix NULL pointer dereference of devname
dm thin: add sanity checks to thin-pool and external snapshot creation
cifs: use correct format characters
* fs/file.c: initialize init_files.resize_wait
fs/file.c
f2fs: do not use mutex lock in atomic context
ocfs2: fix a panic problem caused by o2cb_ctl
mm/slab.c: kmemleak no scan alien caches
* mm/vmalloc.c: fix kernel BUG at mm/vmalloc.c:512!
mm/vmalloc.c
mm/page_ext.c: fix an imbalance with kmemleak
* mm/cma.c: cma_declare_contiguous: correct err handling
mm/cma.c
scsi: hisi_sas: Set PHY linkrate when disconnected
enic: fix build warning without CONFIG_CPUMASK_OFFSTACK
* sysctl: handle overflow for file-max
kernel/sysctl.c
* include/linux/relay.h: fix percpu annotation in struct rchan
include/linux/relay.h
gpio: gpio-omap: fix level interrupt idling
* tracing: kdb: Fix ftdump to not sleep
include/linux/ring_buffer.h
kernel/trace/ring_buffer.c
kernel/trace/trace.c
h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux-
CIFS: fix POSIX lock leak and invalid ptr deref
* i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA
drivers/i2c/i2c-core.c
mm: mempolicy: make mbind() return -EIO when MPOL_MF_STRICT is specified
tty/serial: atmel: RS485 HD w/DMA: enable RX after TX is stopped
tty/serial: atmel: Add is_half_duplex helper
* lib/int_sqrt: optimize initial value compute
lib/int_sqrt.c
* ext4: cleanup bh release code in ext4_ind_remove_space()
fs/ext4/indirect.c
* arm64: debug: Ensure debug handlers check triggering exception level
arch/arm64/kernel/probes/kprobes.c
* arm64: debug: Don't propagate UNKNOWN FAR into si_code for debug signals
arch/arm64/mm/fault.c
* ext4: switch to fscrypt_prepare_setattr()
fs/ext4/inode.c
* ext4: switch to fscrypt_prepare_rename()
fs/ext4/namei.c
* ext4: switch to fscrypt_prepare_link()
fs/ext4/namei.c
* ext4: switch to fscrypt_file_open()
fs/ext4/file.c
* ext4, dax: set ext4_dax_aops for dax files
fs/ext4/inode.c
ANDROID: cuttlefish_defconfig: Enable CONFIG_OVERLAY_FS
ANDROID: cuttlefish: enable CONFIG_NET_SCH_INGRESS=y
Merge 4.9.167 into android-4.9
Linux 4.9.167
* arm64: support keyctl() system call in 32-bit mode
arch/arm64/Kconfig
* Revert "USB: core: only clean up what we allocated"
drivers/usb/core/config.c
* xhci: Fix port resume done detection for SS ports with LPM enabled
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.h
* USB: gadget: f_hid: fix deadlock in f_hidg_write()
drivers/usb/gadget/function/f_hid.c
KVM: x86: Emulate MSR_IA32_ARCH_CAPABILITIES on AMD hosts
KVM: Reject device ioctls from processes other than the VM's creator
x86/smp: Enforce CONFIG_HOTPLUG_CPU when SMP=y
* cpu/hotplug: Prevent crash when CPU bringup fails on CONFIG_HOTPLUG_CPU=n
kernel/cpu.c
perf intel-pt: Fix TSC slip
usb: host: xhci-rcar: Add XHCI_TRUST_TX_LENGTH quirk
* usb: common: Consider only available nodes for dr_mode
drivers/usb/common/common.c
gpio: adnp: Fix testing wrong value in adnp_gpio_direction_input
* fs/proc/proc_sysctl.c: fix NULL pointer dereference in put_links
fs/proc/proc_sysctl.c
Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/kgdboc
USB: serial: option: add Olicard 600
USB: serial: option: set driver_info for SIM5218 and compatibles
USB: serial: mos7720: fix mos_parport refcount imbalance on error path
USB: serial: ftdi_sio: add additional NovaTech products
USB: serial: cp210x: add new device id
serial: sh-sci: Fix setting SCSCR_TIE while transferring data
serial: max310x: Fix to avoid potential NULL pointer dereference
staging: vt6655: Fix interrupt race condition on device start up.
staging: vt6655: Remove vif check from vnt_interrupt
staging: comedi: ni_mio_common: Fix divide-by-zero for DIO cmdtest
tty: atmel_serial: fix a potential NULL pointer dereference
scsi: zfcp: fix scsi_eh host reset with port_forced ERP for non-NPIV FCP devices
scsi: zfcp: fix rport unblock if deleted SCSI devices on Scsi_Host
* scsi: sd: Quiesce warning if device does not report optimal I/O size
drivers/scsi/sd.c
* scsi: sd: Fix a race between closing an sd device and sd I/O
drivers/scsi/sd.c
* fs/open.c: allow opening only regular files during execve()
fs/open.c
* ALSA: pcm: Don't suspend stream in unrecoverable PCM state
sound/core/pcm_native.c
ALSA: pcm: Fix possible OOB access in PCM oss plugins
ALSA: seq: oss: Fix Spectre v1 vulnerability
* ALSA: rawmidi: Fix potential Spectre v1 vulnerability
sound/core/rawmidi.c
net: dsa: qca8k: remove leftover phy accessors
NFSv4.1 don't free interrupted slot on open
powerpc: bpf: Fix generation of load/store DW instructions
ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time
btrfs: raid56: properly unmap parity page in finish_parity_scrub()
btrfs: remove WARN_ON in log_dir_items
* tun: add a missing rcu_read_unlock() in error path
drivers/net/tun.c
* tun: properly test for IFF_UP
drivers/net/tun.c
mac8390: Fix mmio access size probe
* sctp: get sctphdr by offset in sctp_compute_cksum
include/net/sctp/checksum.h
vxlan: Don't call gro_cells_destroy() before device is unregistered
* tcp: do not use ipv6 header for ipv4 flow
net/ipv6/tcp_ipv6.c
* packets: Always register packet sk in the same order
include/net/sock.h
net/packet/af_packet.c
net: rose: fix a possible stack overflow
* net/packet: Set __GFP_NOWARN upon allocation in alloc_pg_vec
net/packet/af_packet.c
mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S
dccp: do not use ipv6 header for ipv4 flow
stmmac: copy unicast mac address to MAC registers
* cfg80211: size various nl80211 messages correctly
net/wireless/nl80211.c
video: fbdev: Set pixclock = 0 in goldfishfb
* Bluetooth: Verify that l2cap_get_conf_opt provides large enough buffer
net/bluetooth/l2cap_core.c
* Bluetooth: Check L2CAP option sizes returned from l2cap_get_conf_opt
net/bluetooth/l2cap_core.c
UPSTREAM: virt_wifi: Remove REGULATORY_WIPHY_SELF_MANAGED
Merge 4.9.166 into android-4.9
Linux 4.9.166
ath10k: avoid possible string overflow
power: supply: charger-manager: Fix incorrect return value
pwm-backlight: Enable/disable the PWM before/after LCD enable toggle.
* rtc: Fix overflow when converting time64_t to rtc_time
drivers/rtc/rtc-lib.c
* scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1
drivers/scsi/ufs/ufshcd.c
* USB: core: only clean up what we allocated
drivers/usb/core/config.c
* lib/int_sqrt: optimize small argument
lib/int_sqrt.c
serial: sprd: clear timeout interrupt only rather than all interrupts
* arm64: traps: disable irq in die()
arch/arm64/kernel/traps.c
* Hang/soft lockup in d_invalidate with simultaneous calls
fs/dcache.c
serial: sprd: adjust TIMEOUT to a big value
* tcp/dccp: drop SYN packets if accept queue is full
include/net/inet_connection_sock.h
net/ipv4/tcp_input.c
ALSA: hda - Enforces runtime_resume after S3 and S4 for each codec
ALSA: hda - Record the current power state before suspend/resume calls
locking/lockdep: Add debug_locks check in __lock_downgrade()
* Bluetooth: Fix decrementing reference count twice in releasing socket
net/bluetooth/hci_sock.c
* media: v4l2-ctrls.c/uvc: zero v4l2_event
drivers/media/v4l2-core/v4l2-ctrls.c
* ext4: brelse all indirect buffer in ext4_ind_remove_space()
fs/ext4/indirect.c
* ext4: fix data corruption caused by unaligned direct AIO
fs/ext4/file.c
* ext4: fix NULL pointer dereference while journal is aborted
fs/ext4/ext4_jbd2.h
objtool: Move objtool_file struct off the stack
* futex: Ensure that futex address is aligned in handle_futex_death()
kernel/futex.c
MIPS: Fix kernel crash for R6 in jump label branch function
MIPS: Ensure ELF appended dtb is relocated
mips: loongson64: lemote-2f: Add IRQF_NO_SUSPEND to "cascade" irqaction.
udf: Fix crash on IO error during truncate
libceph: wait for latest osdmap in ceph_monc_blacklist_add()
iommu/amd: fix sg->dma_address for sg->offset bigger than PAGE_SIZE
drm/vmwgfx: Don't double-free the mode stored in par->set_mode
mmc: pxamci: fix enum type confusion
Change-Id: I240c51a5bde3c2c7a9ada58c87d5d0966f26cb78
Signed-off-by: Robin Peng <robinpeng@google.com>
280 lines
7.9 KiB
C
280 lines
7.9 KiB
C
#ifndef __LINUX_BACKING_DEV_DEFS_H
|
|
#define __LINUX_BACKING_DEV_DEFS_H
|
|
|
|
#include <linux/list.h>
|
|
#include <linux/radix-tree.h>
|
|
#include <linux/rbtree.h>
|
|
#include <linux/spinlock.h>
|
|
#include <linux/percpu_counter.h>
|
|
#include <linux/percpu-refcount.h>
|
|
#include <linux/flex_proportions.h>
|
|
#include <linux/timer.h>
|
|
#include <linux/workqueue.h>
|
|
#include <linux/kref.h>
|
|
|
|
struct page;
|
|
struct device;
|
|
struct dentry;
|
|
|
|
/*
|
|
* Bits in bdi_writeback.state
|
|
*/
|
|
enum wb_state {
|
|
WB_registered, /* bdi_register() was done */
|
|
WB_shutting_down, /* wb_shutdown() in progress */
|
|
WB_writeback_running, /* Writeback is in progress */
|
|
WB_has_dirty_io, /* Dirty inodes on ->b_{dirty|io|more_io} */
|
|
};
|
|
|
|
enum wb_congested_state {
|
|
WB_async_congested, /* The async (write) queue is getting full */
|
|
WB_sync_congested, /* The sync queue is getting full */
|
|
};
|
|
|
|
typedef int (congested_fn)(void *, int);
|
|
|
|
enum wb_stat_item {
|
|
WB_RECLAIMABLE,
|
|
WB_WRITEBACK,
|
|
WB_DIRTIED,
|
|
WB_WRITTEN,
|
|
NR_WB_STAT_ITEMS
|
|
};
|
|
|
|
#define WB_STAT_BATCH (8*(1+ilog2(nr_cpu_ids)))
|
|
|
|
/*
|
|
* For cgroup writeback, multiple wb's may map to the same blkcg. Those
|
|
* wb's can operate mostly independently but should share the congested
|
|
* state. To facilitate such sharing, the congested state is tracked using
|
|
* the following struct which is created on demand, indexed by blkcg ID on
|
|
* its bdi, and refcounted.
|
|
*/
|
|
struct bdi_writeback_congested {
|
|
unsigned long state; /* WB_[a]sync_congested flags */
|
|
atomic_t refcnt; /* nr of attached wb's and blkg */
|
|
|
|
#ifdef CONFIG_CGROUP_WRITEBACK
|
|
struct backing_dev_info *__bdi; /* the associated bdi, set to NULL
|
|
* on bdi unregistration. For memcg-wb
|
|
* internal use only! */
|
|
int blkcg_id; /* ID of the associated blkcg */
|
|
struct rb_node rb_node; /* on bdi->cgwb_congestion_tree */
|
|
#endif
|
|
};
|
|
|
|
/*
|
|
* Each wb (bdi_writeback) can perform writeback operations, is measured
|
|
* and throttled, independently. Without cgroup writeback, each bdi
|
|
* (bdi_writeback) is served by its embedded bdi->wb.
|
|
*
|
|
* On the default hierarchy, blkcg implicitly enables memcg. This allows
|
|
* using memcg's page ownership for attributing writeback IOs, and every
|
|
* memcg - blkcg combination can be served by its own wb by assigning a
|
|
* dedicated wb to each memcg, which enables isolation across different
|
|
* cgroups and propagation of IO back pressure down from the IO layer upto
|
|
* the tasks which are generating the dirty pages to be written back.
|
|
*
|
|
* A cgroup wb is indexed on its bdi by the ID of the associated memcg,
|
|
* refcounted with the number of inodes attached to it, and pins the memcg
|
|
* and the corresponding blkcg. As the corresponding blkcg for a memcg may
|
|
* change as blkcg is disabled and enabled higher up in the hierarchy, a wb
|
|
* is tested for blkcg after lookup and removed from index on mismatch so
|
|
* that a new wb for the combination can be created.
|
|
*/
|
|
struct bdi_writeback {
|
|
struct backing_dev_info *bdi; /* our parent bdi */
|
|
|
|
unsigned long state; /* Always use atomic bitops on this */
|
|
unsigned long last_old_flush; /* last old data flush */
|
|
|
|
struct list_head b_dirty; /* dirty inodes */
|
|
struct list_head b_io; /* parked for writeback */
|
|
struct list_head b_more_io; /* parked for more writeback */
|
|
struct list_head b_dirty_time; /* time stamps are dirty */
|
|
spinlock_t list_lock; /* protects the b_* lists */
|
|
|
|
struct percpu_counter stat[NR_WB_STAT_ITEMS];
|
|
|
|
struct bdi_writeback_congested *congested;
|
|
|
|
unsigned long bw_time_stamp; /* last time write bw is updated */
|
|
unsigned long dirtied_stamp;
|
|
unsigned long written_stamp; /* pages written at bw_time_stamp */
|
|
unsigned long write_bandwidth; /* the estimated write bandwidth */
|
|
unsigned long avg_write_bandwidth; /* further smoothed write bw, > 0 */
|
|
|
|
/*
|
|
* The base dirty throttle rate, re-calculated on every 200ms.
|
|
* All the bdi tasks' dirty rate will be curbed under it.
|
|
* @dirty_ratelimit tracks the estimated @balanced_dirty_ratelimit
|
|
* in small steps and is much more smooth/stable than the latter.
|
|
*/
|
|
unsigned long dirty_ratelimit;
|
|
unsigned long balanced_dirty_ratelimit;
|
|
|
|
struct fprop_local_percpu completions;
|
|
int dirty_exceeded;
|
|
|
|
spinlock_t work_lock; /* protects work_list & dwork scheduling */
|
|
struct list_head work_list;
|
|
struct delayed_work dwork; /* work item used for writeback */
|
|
|
|
struct list_head bdi_node; /* anchored at bdi->wb_list */
|
|
|
|
#ifdef CONFIG_CGROUP_WRITEBACK
|
|
struct percpu_ref refcnt; /* used only for !root wb's */
|
|
struct fprop_local_percpu memcg_completions;
|
|
struct cgroup_subsys_state *memcg_css; /* the associated memcg */
|
|
struct cgroup_subsys_state *blkcg_css; /* and blkcg */
|
|
struct list_head memcg_node; /* anchored at memcg->cgwb_list */
|
|
struct list_head blkcg_node; /* anchored at blkcg->cgwb_list */
|
|
|
|
union {
|
|
struct work_struct release_work;
|
|
struct rcu_head rcu;
|
|
};
|
|
#endif
|
|
};
|
|
|
|
struct backing_dev_info {
|
|
struct list_head bdi_list;
|
|
unsigned long ra_pages; /* max readahead in PAGE_SIZE units */
|
|
unsigned long io_pages; /* max allowed IO size */
|
|
unsigned int capabilities; /* Device capabilities */
|
|
congested_fn *congested_fn; /* Function pointer if device is md/dm */
|
|
void *congested_data; /* Pointer to aux data for congested func */
|
|
|
|
char *name;
|
|
|
|
struct kref refcnt; /* Reference counter for the structure */
|
|
unsigned int min_ratio;
|
|
unsigned int max_ratio, max_prop_frac;
|
|
|
|
/*
|
|
* Sum of avg_write_bw of wbs with dirty inodes. > 0 if there are
|
|
* any dirty wbs, which is depended upon by bdi_has_dirty().
|
|
*/
|
|
atomic_long_t tot_write_bandwidth;
|
|
|
|
struct bdi_writeback wb; /* the root writeback info for this bdi */
|
|
struct list_head wb_list; /* list of all wbs */
|
|
#ifdef CONFIG_CGROUP_WRITEBACK
|
|
struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */
|
|
struct rb_root cgwb_congested_tree; /* their congested states */
|
|
struct rw_semaphore wb_switch_rwsem; /* no cgwb switch while syncing */
|
|
#else
|
|
struct bdi_writeback_congested *wb_congested;
|
|
#endif
|
|
wait_queue_head_t wb_waitq;
|
|
|
|
struct device *dev;
|
|
struct device *owner;
|
|
|
|
struct timer_list laptop_mode_wb_timer;
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
struct dentry *debug_dir;
|
|
struct dentry *debug_stats;
|
|
#endif
|
|
};
|
|
|
|
enum {
|
|
BLK_RW_ASYNC = 0,
|
|
BLK_RW_SYNC = 1,
|
|
};
|
|
|
|
void clear_wb_congested(struct bdi_writeback_congested *congested, int sync);
|
|
void set_wb_congested(struct bdi_writeback_congested *congested, int sync);
|
|
|
|
static inline void clear_bdi_congested(struct backing_dev_info *bdi, int sync)
|
|
{
|
|
clear_wb_congested(bdi->wb.congested, sync);
|
|
}
|
|
|
|
static inline void set_bdi_congested(struct backing_dev_info *bdi, int sync)
|
|
{
|
|
set_wb_congested(bdi->wb.congested, sync);
|
|
}
|
|
|
|
struct wb_lock_cookie {
|
|
bool locked;
|
|
unsigned long flags;
|
|
};
|
|
|
|
#ifdef CONFIG_CGROUP_WRITEBACK
|
|
|
|
/**
|
|
* wb_tryget - try to increment a wb's refcount
|
|
* @wb: bdi_writeback to get
|
|
*/
|
|
static inline bool wb_tryget(struct bdi_writeback *wb)
|
|
{
|
|
if (wb != &wb->bdi->wb)
|
|
return percpu_ref_tryget(&wb->refcnt);
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* wb_get - increment a wb's refcount
|
|
* @wb: bdi_writeback to get
|
|
*/
|
|
static inline void wb_get(struct bdi_writeback *wb)
|
|
{
|
|
if (wb != &wb->bdi->wb)
|
|
percpu_ref_get(&wb->refcnt);
|
|
}
|
|
|
|
/**
|
|
* wb_put - decrement a wb's refcount
|
|
* @wb: bdi_writeback to put
|
|
*/
|
|
static inline void wb_put(struct bdi_writeback *wb)
|
|
{
|
|
if (WARN_ON_ONCE(!wb->bdi)) {
|
|
/*
|
|
* A driver bug might cause a file to be removed before bdi was
|
|
* initialized.
|
|
*/
|
|
return;
|
|
}
|
|
|
|
if (wb != &wb->bdi->wb)
|
|
percpu_ref_put(&wb->refcnt);
|
|
}
|
|
|
|
/**
|
|
* wb_dying - is a wb dying?
|
|
* @wb: bdi_writeback of interest
|
|
*
|
|
* Returns whether @wb is unlinked and being drained.
|
|
*/
|
|
static inline bool wb_dying(struct bdi_writeback *wb)
|
|
{
|
|
return percpu_ref_is_dying(&wb->refcnt);
|
|
}
|
|
|
|
#else /* CONFIG_CGROUP_WRITEBACK */
|
|
|
|
static inline bool wb_tryget(struct bdi_writeback *wb)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline void wb_get(struct bdi_writeback *wb)
|
|
{
|
|
}
|
|
|
|
static inline void wb_put(struct bdi_writeback *wb)
|
|
{
|
|
}
|
|
|
|
static inline bool wb_dying(struct bdi_writeback *wb)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
#endif /* CONFIG_CGROUP_WRITEBACK */
|
|
|
|
#endif /* __LINUX_BACKING_DEV_DEFS_H */
|