506 Commits

Author SHA1 Message Date
Michael Bestas
7eae069564 Merge remote-tracking branch 'common/deprecated/android-4.4' into android-msm-wahoo-4.4
# By Chao Yu (415) and others
# Via Greg Kroah-Hartman (53) and others
* google/common/deprecated/android-4.4:
  ANDROID: regression introduced override_creds=off
  ANDROID: sched: Disallow WALT with CFS bandwidth control
  ANDROID: fiq_debugger: remove
  ANDROID: Add a tracepoint for mapping inode to full path
  ANDROID: fix binder change in merge of 4.4.183
  UPSTREAM: net-ipv6-ndisc: add support for RFC7710 RA Captive Portal Identifier
  f2fs: use EINVAL for superblock with invalid magic
  f2fs: fix to read source block before invalidating it
  f2fs: remove redundant check from f2fs_setflags_common()
  f2fs: use generic checking and prep function for FS_IOC_SETFLAGS
  ANDROID: overlayfs: Fix a regression in commit b24be4acd
  ANDROID: xfrm: remove in_compat_syscall() checks
  ANDROID: enable CONFIG_RTC_DRV_TEST on cuttlefish
  BACKPORT: binder: Set end of SG buffer area properly.
  ANDROID: overlayfs ovl_create_of_link regression
  f2fs: improve print log in f2fs_sanity_check_ckpt()
  f2fs: avoid out-of-range memory access
  f2fs: fix to avoid long latency during umount
  f2fs: allow all the users to pin a file
  f2fs: support swap file w/ DIO
  f2fs: allocate blocks for pinned file
  f2fs: fix is_idle() check for discard type
  f2fs: add a rw_sem to cover quota flag changes
  f2fs: set SBI_NEED_FSCK for xattr corruption case
  f2fs: use generic EFSBADCRC/EFSCORRUPTED
  f2fs: Use DIV_ROUND_UP() instead of open-coding
  f2fs: print kernel message if filesystem is inconsistent
  f2fs: introduce f2fs_<level> macros to wrap f2fs_printk()
  f2fs: avoid get_valid_blocks() for cleanup
  f2fs: ioctl for removing a range from F2FS
  f2fs: only set project inherit bit for directory
  f2fs: separate f2fs i_flags from fs_flags and ext4 i_flags
  ANDROID: Fixes to locking around handle_lmk_event
  ANDROID: Avoid taking multiple locks in handle_lmk_event
  ANDROID: kernel: cgroup: cpuset: Clear cpus_requested for empty buf
  ANDROID: kernel: cgroup: cpuset: Add missing allocation of cpus_requested in alloc_trial_cpuset
  f2fs: Add option to limit required GC for checkpoint=disable
  f2fs: Fix accounting for unusable blocks
  f2fs: Fix root reserved on remount
  f2fs: Lower threshold for disable_cp_again
  f2fs: fix sparse warning
  f2fs: fix f2fs_show_options to show nodiscard mount option
  f2fs: add error prints for debugging mount failure
  f2fs: fix to do sanity check on segment bitmap of LFS curseg
  f2fs: add missing sysfs entries in documentation
  f2fs: fix to avoid deadloop if data_flush is on
  f2fs: always assume that the device is idle under gc_urgent
  f2fs: add bio cache for IPU
  f2fs: allow ssr block allocation during checkpoint=disable period
  f2fs: fix to check layout on last valid checkpoint park
  UPSTREAM: binder: check for overflow when alloc for security context
  BACKPORT: binder: fix race between munmap() and direct reclaim
  f2fs: link f2fs quota ops for sysfile
  fs: sdcardfs: Add missing option to show_options
  ANDROID: cuttlefish_defconfig: Disable DEVTMPFS
  ANDROID: Move from clang r349610 to r353983c.
  f2fs: fix to avoid accessing xattr across the boundary
  f2fs: fix to avoid potential race on sbi->unusable_block_count access/update
  f2fs: add tracepoint for f2fs_filemap_fault()
  f2fs: introduce DATA_GENERIC_ENHANCE
  f2fs: fix to handle error in f2fs_disable_checkpoint()
  f2fs: remove redundant check in f2fs_file_write_iter()
  f2fs: fix to be aware of readonly device in write_checkpoint()
  f2fs: fix to skip recovery on readonly device
  f2fs: fix to consider multiple device for readonly check
  f2fs: relocate chksum_offset for large_nat_bitmap feature
  f2fs: allow unfixed f2fs_checkpoint.checksum_offset
  f2fs: Replace spaces with tab
  f2fs: insert space before the open parenthesis '('
  f2fs: allow address pointer number of dnode aligning to specified size
  f2fs: introduce f2fs_read_single_page() for cleanup
  f2fs: mark is_extension_exist() inline
  f2fs: fix to set FI_UPDATE_WRITE correctly
  f2fs: fix to avoid panic in f2fs_inplace_write_data()
  f2fs: fix to do sanity check on valid block count of segment
  f2fs: fix to do sanity check on valid node/block count
  f2fs: fix to avoid panic in do_recover_data()
  f2fs: fix to do sanity check on free nid
  f2fs: fix to do checksum even if inode page is uptodate
  f2fs: fix to avoid panic in f2fs_remove_inode_page()
  f2fs: fix to clear dirty inode in error path of f2fs_iget()
  f2fs: remove new blank line of f2fs kernel message
  f2fs: fix wrong __is_meta_io() macro
  f2fs: fix to avoid panic in dec_valid_node_count()
  f2fs: fix to avoid panic in dec_valid_block_count()
  f2fs: fix to use inline space only if inline_xattr is enable
  f2fs: fix to retrieve inline xattr space
  f2fs: fix error path of recovery
  f2fs: fix to avoid deadloop in foreground GC
  f2fs: data: fix warning Using plain integer as NULL pointer
  f2fs: add tracepoint for f2fs_file_write_iter()
  f2fs: add comment for conditional compilation statement
  f2fs: fix potential recursive call when enabling data_flush
  f2fs: improve discard handling with multi-device volumes
  f2fs: Reduce zoned block device memory usage
  f2fs: Fix use of number of devices
  ANDROID: Communicates LMK events to userland where they can be logged
  Make arm64 serial port config compatible with crosvm
  Fix merge issue with 4.4.178
  Fix merge issue with 4.4.177
  ANDROID: cuttlefish_defconfig: Enable CONFIG_OVERLAY_FS
  ANDROID: drop CONFIG_INPUT_KEYCHORD from cuttlefish and ranchu
  UPSTREAM: virt_wifi: Remove REGULATORY_WIPHY_SELF_MANAGED
  UPSTREAM: net: socket: set sock->sk to NULL after calling proto_ops::release()
  Revert "ANDROID: arm: process: Add display of memory around registers when displaying regs."
  f2fs: set pin_file under CAP_SYS_ADMIN
  f2fs: fix to avoid deadlock in f2fs_read_inline_dir()
  f2fs: fix to adapt small inline xattr space in __find_inline_xattr()
  f2fs: fix to do sanity check with inode.i_inline_xattr_size
  f2fs: give some messages for inline_xattr_size
  f2fs: don't trigger read IO for beyond EOF page
  f2fs: fix to add refcount once page is tagged PG_private
  f2fs: remove wrong comment in f2fs_invalidate_page()
  f2fs: fix to use kvfree instead of kzfree
  f2fs: print more parameters in trace_f2fs_map_blocks
  f2fs: trace f2fs_ioc_shutdown
  f2fs: fix to avoid deadlock of atomic file operations
  f2fs: fix to dirty inode for i_mode recovery
  f2fs: give random value to i_generation
  f2fs: no need to take page lock in readdir
  f2fs: fix to update iostat correctly in IPU path
  f2fs: fix encrypted page memory leak
  f2fs: make fault injection covering __submit_flush_wait()
  f2fs: fix to retry fill_super only if recovery failed
  f2fs: silence VM_WARN_ON_ONCE in mempool_alloc
  f2fs: correct spelling mistake
  f2fs: fix wrong #endif
  f2fs: don't clear CP_QUOTA_NEED_FSCK_FLAG
  f2fs: don't allow negative ->write_io_size_bits
  f2fs: fix to check inline_xattr_size boundary correctly
  ANDROID: mnt: Propagate remount correctly
  ANDROID: cuttlefish_defconfig: Add support for AC97 audio
  ANDROID: overlayfs: override_creds=off option bypass creator_cred
  FROMGIT: binder: create node flag to request sender's security context
  Revert "f2fs: fix to avoid deadlock of atomic file operations"
  Revert "f2fs: fix to check inline_xattr_size boundary correctly"
  BACKPORT: userfaultfd: shmem/hugetlbfs: only allow to register VM_MAYWRITE vmas
  ANDROID: cuttlefish_defconfig: Enable DEBUG_SET_MODULE_RONX
  ANDROID: Move from clang r346389b to r349610.
  UPSTREAM: virt_wifi: fix error return code in virt_wifi_newlink()
  ion: Disable ION_HEAP_TYPE_SYSTEM_CONTIG
  UPSTREAM: binder: filter out nodes when showing binder procs
  f2fs: do not use mutex lock in atomic context
  f2fs: fix potential data inconsistence of checkpoint
  f2fs: fix to avoid deadlock of atomic file operations
  f2fs: fix to check inline_xattr_size boundary correctly
  f2fs: jump to label 'free_node_inode' when failing from d_make_root()
  f2fs: fix to document inline_xattr_size option
  f2fs: fix to data block override node segment by mistake
  f2fs: fix typos in code comments
  f2fs: sync filesystem after roll-forward recovery
  fs: export evict_inodes
  f2fs: flush quota blocks after turnning it off
  f2fs: avoid null pointer exception in dcc_info
  f2fs: don't wake up too frequently, if there is lots of IOs
  f2fs: try to keep CP_TRIMMED_FLAG after successful umount
  f2fs: add quick mode of checkpoint=disable for QA
  f2fs: run discard jobs when put_super
  f2fs: fix to set sbi dirty correctly
  f2fs: UBSAN: set boolean value iostat_enable correctly
  f2fs: add brackets for macros
  f2fs: check if file namelen exceeds max value
  f2fs: fix to trigger fsck if dirent.name_len is zero
  f2fs: no need to check return value of debugfs_create functions
  f2fs: export FS_NOCOW_FL flag to user
  f2fs: check inject_rate validity during configuring
  f2fs: remove set but not used variable 'err'
  f2fs: fix compile warnings: 'struct *' declared inside parameter list
  f2fs: change error code to -ENOMEM from -EINVAL
  ANDROID: cuttlefish_defconfig: Enable CONFIG_RTC_HCTOSYS
  UPSTREAM: dm: do not allow readahead to limit IO size
  UPSTREAM: readahead: stricter check for bdi io_pages
  UPSTREAM: mm: don't cap request size based on read-ahead setting
  ANDROID: Fix cuttlefish redundant vsock connection.
  UPSTREAM: loop: drop caches if offset or block_size are changed
  UPSTREAM: virtio: new feature to detect IOMMU device quirk
  UPSTREAM: vring: Use the DMA API on Xen
  UPSTREAM: virtio_ring: Support DMA APIs
  UPSTREAM: vring: Introduce vring_use_dma_api()
  ANDROID: cuttlefish_defconfig: Enable vsock options
  UPSTREAM: vhost/vsock: fix reset orphans race with close timeout
  UPSTREAM: vhost/vsock: fix use-after-free in network stack callers
  UPSTREAM: vhost: correctly check the iova range when waking virtqueue
  UPSTREAM: vhost: synchronize IOTLB message with dev cleanup
  UPSTREAM: vhost: fix info leak due to uninitialized memory
  UPSTREAM: vhost: fix vhost_vq_access_ok() log check
  UPSTREAM: vhost: validate log when IOTLB is enabled
  UPSTREAM: vhost_net: add missing lock nesting notation
  UPSTREAM: vhost: use mutex_lock_nested() in vhost_dev_lock_vqs()
  UPSTREAM: vhost/vsock: fix uninitialized vhost_vsock->guest_cid
  UPSTREAM: vhost_net: correctly check tx avail during rx busy polling
  UPSTREAM: vsock: use new wait API for vsock_stream_sendmsg()
  UPSTREAM: vsock: cancel packets when failing to connect
  UPSTREAM: vhost-vsock: add pkt cancel capability
  UPSTREAM: vsock: track pkt owner vsock
  UPSTREAM: vhost: fix initialization for vq->is_le
  UPSTREAM: vhost/vsock: handle vhost_vq_init_access() error
  UPSTREAM: vsock: lookup and setup guest_cid inside vhost_vsock_lock
  UPSTREAM: vhost-vsock: fix orphan connection reset
  UPSTREAM: vsock/virtio: fix src/dst cid format
  UPSTREAM: VSOCK: Don't dec ack backlog twice for rejected connections
  UPSTREAM: vhost/vsock: drop space available check for TX vq
  UPSTREAM: virtio-vsock: fix include guard typo
  UPSTREAM: vhost/vsock: fix vhost virtio_vsock_pkt use-after-free
  UPSTREAM: VSOCK: Use kvfree()
  BACKPORT: vhost: split out vringh Kconfig
  UPSTREAM: vhost: drop vringh dependency
  UPSTREAM: vhost: drop vringh dependency
  UPSTREAM: vhost: detect 32 bit integer wrap around
  UPSTREAM: VSOCK: Add Makefile and Kconfig
  UPSTREAM: VSOCK: Introduce vhost_vsock.ko
  UPSTREAM: VSOCK: Introduce virtio_transport.ko
  BACKPORT: VSOCK: Introduce virtio_vsock_common.ko
  UPSTREAM: VSOCK: defer sock removal to transports
  UPSTREAM: VSOCK: transport-specific vsock_transport functions
  UPSTREAM: vsock: make listener child lock ordering explicit
  UPSTREAM: vhost: new device IOTLB API
  BACKPORT: vhost: convert pre sorted vhost memory array to interval tree
  UPSTREAM: vhost: introduce vhost memory accessors
  UPSTREAM: vhost_net: stop polling socket during rx processing
  UPSTREAM: VSOCK: constify vsock_transport structure
  UPSTREAM: vhost: lockless enqueuing
  UPSTREAM: vhost: simplify work flushing
  UPSTREAM: VSOCK: Only check error on skb_recv_datagram when skb is NULL
  BACKPORT: AF_VSOCK: Shrink the area influenced by prepare_to_wait
  UPSTREAM: vhost_net: basic polling support
  UPSTREAM: vhost: introduce vhost_vq_avail_empty()
  UPSTREAM: vhost: introduce vhost_has_work()
  UPSTREAM: vhost: rename vhost_init_used()
  UPSTREAM: vhost: rename cross-endian helpers
  UPSTREAM: vhost: fix error path in vhost_init_used()
  UPSTREAM: virtio: make find_vqs() checkpatch.pl-friendly
  UPSTREAM: net: move napi_hash[] into read mostly section
  ANDROID: cuttlefish_defconfig: remove DM_VERITY_HASH_PREFETCH_MIN_SIZE
  Revert "ANDROID: dm verity: add minimum prefetch size"
  ANDROID: f2fs: Complement "android_fs" tracepoint of read path
  f2fs: don't access node/meta inode mapping after iput
  f2fs: wait on atomic writes to count F2FS_CP_WB_DATA
  f2fs: sanity check of xattr entry size
  f2fs: fix use-after-free issue when accessing sbi->stat_info
  f2fs: check PageWriteback flag for ordered case
  f2fs: fix validation of the block count in sanity_check_raw_super
  f2fs: fix missing unlock(sbi->gc_mutex)
  f2fs: clean up structure extent_node
  f2fs: fix block address for __check_sit_bitmap
  f2fs: fix sbi->extent_list corruption issue
  f2fs: clean up checkpoint flow
  f2fs: flush stale issued discard candidates
  f2fs: correct wrong spelling, issing_*
  f2fs: use kvmalloc, if kmalloc is failed
  f2fs: remove redundant comment of unused wio_mutex
  f2fs: fix to reorder set_page_dirty and wait_on_page_writeback
  f2fs: clear PG_writeback if IPU failed
  f2fs: add an ioctl() to explicitly trigger fsck later
  f2fs: avoid frequent costly fsck triggers
  f2fs: fix m_may_create to make OPU DIO write correctly
  f2fs: fix to update new block address correctly for OPU
  f2fs: adjust trace print in f2fs_get_victim() to cover all paths
  f2fs: fix to allow node segment for GC by ioctl path
  f2fs: make "f2fs_fault_name[]" const char *
  f2fs: read page index before freeing
  f2fs: fix wrong return value of f2fs_acl_create
  f2fs: avoid build warn of fall_through
  f2fs: fix race between write_checkpoint and write_begin
  f2fs: check memory boundary by insane namelen
  f2fs: only flush the single temp bio cache which owns the target page
  f2fs: fix out-place-update DIO write
  f2fs: fix to be aware discard/preflush/dio command in is_idle()
  f2fs: add to account direct IO
  f2fs: move dir data flush to write checkpoint process
  f2fs: change segment to section in f2fs_ioc_gc_range
  f2fs: export migration_granularity sysfs entry
  f2fs: support subsectional garbage collection
  f2fs: introduce __is_large_section() for cleanup
  f2fs: clean up f2fs_sb_has_##feature_name
  f2fs: remove codes of unused wio_mutex
  f2fs: fix count of seg_freed to make sec_freed correct
  f2fs: fix to account preflush command for noflush_merge mode
  f2fs: avoid GC causing encrypted file corrupted
  ANDROID: cuttlefish_defconfig: Enable VIRTIO_INPUT
  ANDROID: Revert fs/squashfs back to linux-4.4.y
  ANDROID: uid_sys_stats: Copy task_struct comm field to bigger buffer
  ANDROID: cuttlefish_defconfig: Enable VIRT_WIFI
  FROMGIT, BACKPORT: mac80211-next: rtnetlink wifi simulation device
  ANDROID: Move from clang r328903 to r346389b.
  UPSTREAM: binder: fix race that allows malicious free of live buffer
  ANDROID: arm64 defconfig / build config for cuttlefish
  ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple
  Revert "ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple"
  ANDROID: sdcardfs: Add option to not link obb
  ANDROID: sdcardfs: Add sandbox
  UPSTREAM: seccomp: Fix tracer exit notifications during fatal signals
  UPSTREAM: arm64/ptrace: run seccomp after ptrace
  UPSTREAM: arm/ptrace: run seccomp after ptrace
  BACKPORT: x86/ptrace: run seccomp after ptrace
  UPSTREAM: seccomp: recheck the syscall after RET_TRACE
  UPSTREAM: seccomp: remove 2-phase API
  BACKPORT: x86/entry: Get rid of two-phase syscall entry work
  BACKPORT: seccomp: Add a seccomp_data parameter secure_computing()
  BACKPORT: x86/entry/64: Always run ptregs-using syscalls on the slow path
  UPSTREAM: x86/syscalls: Add syscall entry qualifiers
  UPSTREAM: x86/syscalls: Move compat syscall entry handling into syscalltbl.sh
  UPSTREAM: x86/syscalls: Remove __SYSCALL_COMMON and __SYSCALL_X32
  UPSTREAM: x86/syscalls: Refactor syscalltbl.sh
  Makefile: Tidy up 4.4.165 merge
  ANDROID: zram: set comp_len to PAGE_SIZE when page is huge
  BACKPORT: xfrm: Allow Output Mark to be Updated Using UPDSA
  ANDROID: sdcardfs: Add option to drop unused dentries
  f2fs: guarantee journalled quota data by checkpoint
  f2fs: cleanup dirty pages if recover failed
  f2fs: fix data corruption issue with hardware encryption
  f2fs: fix to recover inode->i_flags of inode block during POR
  f2fs: spread f2fs_set_inode_flags()
  f2fs: fix to spread clear_cold_data()
  Revert "f2fs: fix to clear PG_checked flag in set_page_dirty()"
  f2fs: account read IOs and use IO counts for is_idle
  f2fs: fix to account IO correctly for cgroup writeback
  f2fs: fix to account IO correctly
  f2fs: remove request_list check in is_idle()
  f2fs: allow to mount, if quota is failed
  f2fs: update REQ_TIME in f2fs_cross_rename()
  f2fs: do not update REQ_TIME in case of error conditions
  f2fs: remove unneeded disable_nat_bits()
  f2fs: remove unused sbi->trigger_ssr_threshold
  f2fs: shrink sbi->sb_lock coverage in set_file_temperature()
  f2fs: fix to recover cold bit of inode block during POR
  f2fs: submit cached bio to avoid endless PageWriteback
  f2fs: checkpoint disabling
  f2fs: clear PageError on the read path
  f2fs: allow out-place-update for direct IO in LFS mode
  f2fs: refactor ->page_mkwrite() flow
  Revert: "f2fs: check last page index in cached bio to decide submission"
  f2fs: support superblock checksum
  f2fs: add to account skip count of background GC
  f2fs: add to account meta IO
  f2fs: keep lazytime on remount
  f2fs: fix missing up_read
  f2fs: return correct errno in f2fs_gc
  f2fs: avoid f2fs_bug_on if f2fs_get_meta_page_nofail got EIO
  f2fs: mark inode dirty explicitly in recover_inode()
  f2fs: fix to recover inode's crtime during POR
  f2fs: fix to recover inode's i_gc_failures during POR
  f2fs: fix to recover inode's i_flags during POR
  f2fs: fix to recover inode's project id during POR
  f2fs: update i_size after DIO completion
  f2fs: report ENOENT correctly in f2fs_rename
  f2fs: fix remount problem of option io_bits
  f2fs: fix to recover inode's uid/gid during POR
  f2fs: avoid infinite loop in f2fs_alloc_nid
  f2fs: add new idle interval timing for discard and gc paths
  f2fs: split IO error injection according to RW
  f2fs: add SPDX license identifiers
  f2fs: surround fault_injection related option parsing using CONFIG_F2FS_FAULT_INJECTION
  f2fs: avoid sleeping under spin_lock
  f2fs: plug readahead IO in readdir()
  f2fs: fix to do sanity check with current segment number
  f2fs: fix memory leak of percpu counter in fill_super()
  f2fs: fix memory leak of write_io in fill_super()
  f2fs: cache NULL when both default_acl and acl are NULL
  f2fs: fix to flush all dirty inodes recovered in readonly fs
  f2fs: report error if quota off error during umount
  f2fs: submit bio after shutdown
  f2fs: avoid wrong decrypted data from disk
  Revert "f2fs: use printk_ratelimited for f2fs_msg"
  f2fs: fix unnecessary periodic wakeup of discard thread when dev is busy
  f2fs: fix to avoid NULL pointer dereference on se->discard_map
  f2fs: add additional sanity check in f2fs_acl_from_disk()
  Revert "BACKPORT, FROMLIST: fscrypt: add Speck128/256 support"
  Build fix for 076c36fce1.
  Revert "BACKPORT, FROMGIT: crypto: speck - add support for the Speck block cipher"
  Revert "FROMGIT: crypto: speck - export common helpers"
  Revert "BACKPORT, FROMGIT: crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS"
  Revert "BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck128-XTS"
  Revert "BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck64-XTS"
  Revert "BACKPORT, FROMLIST: crypto: arm64/speck - add NEON-accelerated implementation of Speck-XTS"
  Revert "fscrypt: add Speck128/256 support"
  UPSTREAM: loop: Add LOOP_SET_BLOCK_SIZE in compat ioctl
  BACKPORT: block/loop: set hw_sectors
  UPSTREAM: loop: add ioctl for changing logical block size
  ANDROID: usb: gadget: f_mtp: Return error if count is negative
  ANDROID: x86_64_cuttlefish_defconfig: disable CONFIG_MEMORY_STATE_TIME
  ANDROID: sdcardfs: Change current->fs under lock
  ANDROID: sdcardfs: Don't use OVERRIDE_CRED macro
  Revert "f2fs: use timespec64 for inode timestamps"
  ANDROID: restrict store of prefer_idle as boolean
  BACKPORT: arm/syscalls: Optimize address limit check
  UPSTREAM: syscalls: Use CHECK_DATA_CORRUPTION for addr_limit_user_check
  BACKPORT: arm64/syscalls: Check address limit on user-mode return
  BACKPORT: x86/syscalls: Check address limit on user-mode return
  BACKPORT: lkdtm: add bad USER_DS test
  UPSTREAM: bug: switch data corruption check to __must_check
  BACKPORT: lkdtm: Add tests for struct list corruption
  UPSTREAM: bug: Provide toggle for BUG on data corruption
  UPSTREAM: list: Split list_del() debug checking into separate function
  UPSTREAM: rculist: Consolidate DEBUG_LIST for list_add_rcu()
  BACKPORT: list: Split list_add() debug checking into separate function
  FROMLIST: ANDROID: binder: Add BINDER_GET_NODE_INFO_FOR_REF ioctl.
  f2fs: readahead encrypted block during GC
  f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc
  f2fs: fix performance issue observed with multi-thread sequential read
  f2fs: fix to skip verifying block address for non-regular inode
  f2fs: rework fault injection handling to avoid a warning
  f2fs: support fault_type mount option
  f2fs: fix to return success when trimming meta area
  f2fs: fix use-after-free of dicard command entry
  f2fs: support discard submission error injection
  f2fs: split discard command in prior to block layer
  f2fs: wake up gc thread immediately when gc_urgent is set
  f2fs: fix incorrect range->len in f2fs_trim_fs()
  f2fs: refresh recent accessed nat entry in lru list
  f2fs: fix avoid race between truncate and background GC
  f2fs: avoid race between zero_range and background GC
  f2fs: fix to do sanity check with block address in main area v2
  f2fs: fix to do sanity check with inline flags
  f2fs: fix to reset i_gc_failures correctly
  f2fs: fix invalid memory access
  f2fs: fix to avoid broken of dnode block list
  f2fs: use true and false for boolean values
  f2fs: fix to do sanity check with cp_pack_start_sum
  f2fs: avoid f2fs_bug_on() in cp_error case
  f2fs: fix to clear PG_checked flag in set_page_dirty()
  f2fs: fix to active page in lru list for read path
  f2fs: don't keep meta pages used for block migration
  f2fs: fix to restrict mount condition when without CONFIG_QUOTA
  f2fs: quota: do not mount as RDWR without QUOTA if quota feature enabled
  f2fs: quota: fix incorrect comments
  f2fs: add proc entry to show victim_secmap bitmap
  f2fs: let checkpoint flush dnode page of regular
  f2fs: issue discard align to section in LFS mode
  f2fs: don't allow any writes on aborted atomic writes
  f2fs: restrict setting up inode.i_advise
  f2fs: fix wrong kernel message when recover fsync data on ro fs
  f2fs: clean up ioctl interface naming
  f2fs: clean up with f2fs_is_{atomic,volatile}_file()
  f2fs: clean up with f2fs_encrypted_inode()
  f2fs: clean up with get_current_nat_page
  f2fs: kill EXT_TREE_VEC_SIZE
  f2fs: avoid duplicated permission check for "trusted." xattrs
  f2fs: fix to propagate error from __get_meta_page()
  f2fs: fix to do sanity check with i_extra_isize
  f2fs: blk_finish_plug of submit_bio in lfs mode
  f2fs: do not set free of current section
  f2fs: Keep alloc_valid_block_count in sync
  f2fs: issue small discard by LBA order
  f2fs: stop issuing discard immediately if there is queued IO
  f2fs: clean up with IS_INODE()
  f2fs: detect bug_on in f2fs_wait_discard_bios
  f2fs: fix defined but not used build warnings
  f2fs: enable real-time discard by default
  f2fs: fix to detect looped node chain correctly
  f2fs: fix to do sanity check with block address in main area
  f2fs: fix to skip GC if type in SSA and SIT is inconsistent
  f2fs: try grabbing node page lock aggressively in sync scenario
  f2fs: show the fsync_mode=nobarrier mount option
  f2fs: check the right return value of memory alloc function
  f2fs: Replace strncpy with memcpy
  f2fs: avoid the global name 'fault_name'
  f2fs: fix to do sanity check with reserved blkaddr of inline inode
  f2fs: fix to do sanity check with node footer and iblocks
  f2fs: Allocate and stat mem used by free nid bitmap more accurately
  f2fs: fix to do sanity check with user_block_count
  f2fs: fix to do sanity check with extra_attr feature
  f2fs: fix to correct return value of f2fs_trim_fs
  f2fs: fix to do sanity check with {sit,nat}_ver_bitmap_bytesize
  f2fs: fix to do sanity check with secs_per_zone
  f2fs: disable f2fs_check_rb_tree_consistence
  f2fs: introduce and spread verify_blkaddr
  f2fs: use timespec64 for inode timestamps
  f2fs: fix to wait on page writeback before updating page
  f2fs: assign REQ_RAHEAD to bio for ->readpages
  f2fs: fix a hungtask problem caused by congestion_wait
  f2fs: Fix uninitialized return in f2fs_ioc_shutdown()
  f2fs: don't issue discard commands in online discard is on
  f2fs: fix to propagate return value of scan_nat_page()
  f2fs: support in-memory inode checksum when checking consistency
  f2fs: fix error path of fill_super
  f2fs: relocate readdir_ra configure initialization
  f2fs: move s_res{u,g}id initialization to default_options()
  f2fs: don't acquire orphan ino during recovery
  f2fs: avoid potential deadlock in f2fs_sbi_store
  f2fs: indicate shutdown f2fs to allow unmount successfully
  f2fs: keep meta pages in cp_error state
  f2fs: do checkpoint in kill_sb
  f2fs: allow wrong configured dio to buffered write
  f2fs: flush journal nat entries for nat_bits during unmount
  BACKPORT: arm64/vdso: Fix nsec handling for CLOCK_MONOTONIC_RAW
  ANDROID: arm64: mm: fix 4.4.154 merge
  BACKPORT: zram: drop max_zpage_size and use zs_huge_class_size()
  BACKPORT: zsmalloc: introduce zs_huge_class_size()
  ANDROID: tracing: fix race condition reading saved tgids
  ANDROID: x86_64_cuttlefish_defconfig: Enable lz4 compression for zram
  UPSTREAM: drivers/block/zram/zram_drv.c: fix bug storing backing_dev
  BACKPORT: zram: introduce zram memory tracking
  BACKPORT: zram: record accessed second
  BACKPORT: zram: mark incompressible page as ZRAM_HUGE
  UPSTREAM: zram: correct flag name of ZRAM_ACCESS
  UPSTREAM: zram: Delete gendisk before cleaning up the request queue
  UPSTREAM: drivers/block/zram/zram_drv.c: make zram_page_end_io() static
  BACKPORT: zram: set BDI_CAP_STABLE_WRITES once
  UPSTREAM: zram: fix null dereference of handle
  UPSTREAM: zram: add config and doc file for writeback feature
  BACKPORT: zram: read page from backing device
  BACKPORT: zram: write incompressible pages to backing device
  BACKPORT: zram: identify asynchronous IO's return value
  BACKPORT: zram: add free space management in backing device
  UPSTREAM: zram: add interface to specif backing device
  UPSTREAM: zram: rename zram_decompress_page to __zram_bvec_read
  UPSTREAM: zram: inline zram_compress
  UPSTREAM: zram: clean up duplicated codes in __zram_bvec_write
  ANDROID: x86_64_cuttlefish_defconfig: Enable zram and zstd
  BACKPORT: crypto: zstd - Add zstd support
  UPSTREAM: zram: add zstd to the supported algorithms list
  UPSTREAM: lib: Add zstd modules
  UPSTREAM: lib: Add xxhash module
  UPSTREAM: zram: rework copy of compressor name in comp_algorithm_store()
  UPSTREAM: zram: constify attribute_group structures.
  UPSTREAM: zram: count same page write as page_stored
  UPSTREAM: zram: reduce load operation in page_same_filled
  UPSTREAM: zram: use zram_free_page instead of open-coded
  UPSTREAM: zram: introduce zram data accessor
  UPSTREAM: zram: remove zram_meta structure
  UPSTREAM: zram: use zram_slot_lock instead of raw bit_spin_lock op
  BACKPORT: zram: partial IO refactoring
  BACKPORT: zram: handle multiple pages attached bio's bvec
  UPSTREAM: zram: fix operator precedence to get offset
  BACKPORT: zram: extend zero pages to same element pages
  BACKPORT: zram: remove waitqueue for IO done
  UPSTREAM: zram: remove obsolete sysfs attrs
  UPSTREAM: zram: support BDI_CAP_STABLE_WRITES
  UPSTREAM: zram: revalidate disk under init_lock
  BACKPORT: mm: support anonymous stable page
  UPSTREAM: zram: use __GFP_MOVABLE for memory allocation
  UPSTREAM: zram: drop gfp_t from zcomp_strm_alloc()
  UPSTREAM: zram: add more compression algorithms
  UPSTREAM: zram: delete custom lzo/lz4
  UPSTREAM: zram: cosmetic: cleanup documentation
  UPSTREAM: zram: use crypto api to check alg availability
  BACKPORT: zram: switch to crypto compress API
  UPSTREAM: zram: rename zstrm find-release functions
  UPSTREAM: zram: introduce per-device debug_stat sysfs node
  UPSTREAM: zram: remove max_comp_streams internals
  UPSTREAM: zram: user per-cpu compression streams
  BACKPORT: zsmalloc: require GFP in zs_malloc()
  UPSTREAM: zram/zcomp: do not zero out zcomp private pages
  UPSTREAM: zram: pass gfp from zcomp frontend to backend
  UPSTREAM: socket: close race condition between sock_close() and sockfs_setattr()
  ANDROID: Refresh x86_64_cuttlefish_defconfig
  kernel/sys.c: fix merge error with 4.4.144
  ANDROID: sdcardfs: Check stacked filesystem depth
  Fix backport of "tcp: detect malicious patterns in tcp_collapse_ofo_queue()"
  tcp: detect malicious patterns in tcp_collapse_ofo_queue()
  tcp: avoid collapses in tcp_prune_queue() if possible
  treewide: Use array_size in f2fs_kvzalloc()
  treewide: Use array_size() in f2fs_kzalloc()
  treewide: Use array_size() in f2fs_kmalloc()
  overflow.h: Add allocation size calculation helpers
  f2fs: fix to clear FI_VOLATILE_FILE correctly
  f2fs: let sync node IO interrupt async one
  f2fs: don't change wbc->sync_mode
  f2fs: fix to update mtime correctly
  fs: f2fs: insert space around that ':' and ', '
  fs: f2fs: add missing blank lines after declarations
  fs: f2fs: changed variable type of offset "unsigned" to "loff_t"
  f2fs: clean up symbol namespace
  f2fs: make set_de_type() static
  f2fs: make __f2fs_write_data_pages() static
  f2fs: fix to avoid accessing cross the boundary
  f2fs: fix to let caller retry allocating block address
  disable loading f2fs module on PAGE_SIZE > 4KB
  f2fs: fix error path of move_data_page
  f2fs: don't drop dentry pages after fs shutdown
  f2fs: fix to avoid race during access gc_thread pointer
  f2fs: clean up with clear_radix_tree_dirty_tag
  f2fs: fix to don't trigger writeback during recovery
  f2fs: clear discard_wake earlier
  f2fs: let discard thread wait a little longer if dev is busy
  f2fs: avoid stucking GC due to atomic write
  f2fs: introduce sbi->gc_mode to determine the policy
  f2fs: keep migration IO order in LFS mode
  f2fs: fix to wait page writeback during revoking atomic write
  f2fs: Fix deadlock in shutdown ioctl
  f2fs: detect synchronous writeback more earlier
  mm: remove nr_pages argument from pagevec_lookup_{,range}_tag()
  ceph: use pagevec_lookup_range_nr_tag()
  mm: add variant of pagevec_lookup_range_tag() taking number of pages
  mm: use pagevec_lookup_range_tag() in write_cache_pages()
  mm: use pagevec_lookup_range_tag() in __filemap_fdatawait_range()
  nilfs2: use pagevec_lookup_range_tag()
  gfs2: use pagevec_lookup_range_tag()
  f2fs: use find_get_pages_tag() for looking up single page
  f2fs: simplify page iteration loops
  f2fs: use pagevec_lookup_range_tag()
  ext4: use pagevec_lookup_range_tag()
  ceph: use pagevec_lookup_range_tag()
  btrfs: use pagevec_lookup_range_tag()
  mm: implement find_get_pages_range_tag()
  f2fs: clean up with is_valid_blkaddr()
  f2fs: fix to initialize min_mtime with ULLONG_MAX
  f2fs: fix to let checkpoint guarantee atomic page persistence
  f2fs: fix to initialize i_current_depth according to inode type
  Revert "f2fs: add ovp valid_blocks check for bg gc victim to fg_gc"
  f2fs: don't drop any page on f2fs_cp_error() case
  f2fs: fix spelling mistake: "extenstion" -> "extension"
  f2fs: enhance sanity_check_raw_super() to avoid potential overflows
  f2fs: treat volatile file's data as hot one
  f2fs: introduce release_discard_addr() for cleanup
  f2fs: fix potential overflow
  f2fs: rename dio_rwsem to i_gc_rwsem
  f2fs: move mnt_want_write_file after range check
  f2fs: fix missing clear FI_NO_PREALLOC in some error case
  f2fs: enforce fsync_mode=strict for renamed directory
  f2fs: sanity check for total valid node blocks
  f2fs: sanity check on sit entry
  f2fs: avoid bug_on on corrupted inode
  f2fs: give message and set need_fsck given broken node id
  f2fs: clean up commit_inmem_pages()
  f2fs: do not check F2FS_INLINE_DOTS in recover
  f2fs: remove duplicated dquot_initialize and fix error handling
  f2fs: stop issue discard if something wrong with f2fs
  f2fs: fix return value in f2fs_ioc_commit_atomic_write
  f2fs: allocate hot_data for atomic write more strictly
  f2fs: check if inmem_pages list is empty correctly
  f2fs: fix race in between GC and atomic open
  f2fs: change le32 to le16 of f2fs_inode->i_extra_size
  f2fs: check cur_valid_map_mir & raw_sit block count when flush sit entries
  f2fs: correct return value of f2fs_trim_fs
  f2fs: fix to show missing bits in FS_IOC_GETFLAGS
  f2fs: remove unneeded F2FS_PROJINHERIT_FL
  f2fs: don't use GFP_ZERO for page caches
  f2fs: issue all big range discards in umount process
  f2fs: remove redundant block plug
  f2fs: remove unmatched zero_user_segment when convert inline dentry
  f2fs: introduce private inode status mapping
  fscrypt: log the crypto algorithm implementations
  crypto: api - Add crypto_type_has_alg helper
  crypto: skcipher - Add low-level skcipher interface
  crypto: skcipher - Add helper to retrieve driver name
  crypto: skcipher - Add default key size helper
  fscrypt: add Speck128/256 support
  fscrypt: only derive the needed portion of the key
  fscrypt: separate key lookup from key derivation
  fscrypt: use a common logging function
  fscrypt: remove internal key size constants
  fscrypt: remove unnecessary check for non-logon key type
  fscrypt: make fscrypt_operations.max_namelen an integer
  fscrypt: drop empty name check from fname_decrypt()
  fscrypt: drop max_namelen check from fname_decrypt()
  fscrypt: don't special-case EOPNOTSUPP from fscrypt_get_encryption_info()
  fscrypt: don't clear flags on crypto transform
  fscrypt: remove stale comment from fscrypt_d_revalidate()
  fscrypt: remove error messages for skcipher_request_alloc() failure
  fscrypt: remove unnecessary NULL check when allocating skcipher
  fscrypt: clean up after fscrypt_prepare_lookup() conversions
  fscrypt: use unbound workqueue for decryption
  f2fs: run fstrim asynchronously if runtime discard is on
  f2fs: turn down IO priority of discard from background
  f2fs: don't split checkpoint in fstrim
  f2fs: issue discard commands proactively in high fs utilization
  f2fs: add fsync_mode=nobarrier for non-atomic files
  f2fs: let fstrim issue discard commands in lower priority
  f2fs: avoid fsync() failure caused by EAGAIN in writepage()
  f2fs: clear PageError on writepage - part 2
  f2fs: check cap_resource only for data blocks
  Revert "f2fs: introduce f2fs_set_page_dirty_nobuffer"
  f2fs: clear PageError on writepage
  f2fs: call unlock_new_inode() before d_instantiate()
  f2fs: refactor read path to allow multiple postprocessing steps
  fscrypt: allow synchronous bio decryption
  f2fs: remain written times to update inode during fsync
  f2fs: make assignment of t->dentry_bitmap more readable
  f2fs: truncate preallocated blocks in error case
  f2fs: fix a wrong condition in f2fs_skip_inode_update
  f2fs: reserve bits for fs-verity
  f2fs: Add a segment type check in inplace write
  f2fs: no need to initialize zero value for GFP_F2FS_ZERO
  f2fs: don't track new nat entry in nat set
  f2fs: clean up with F2FS_BLK_ALIGN
  f2fs: check blkaddr more accuratly before issue a bio
  f2fs: Set GF_NOFS in read_cache_page_gfp while doing f2fs_quota_read
  f2fs: introduce a new mount option test_dummy_encryption
  f2fs: introduce F2FS_FEATURE_LOST_FOUND feature
  f2fs: release locks before return in f2fs_ioc_gc_range()
  f2fs: align memory boundary for bitops
  f2fs: remove unneeded set_cold_node()
  f2fs: add nowait aio support
  f2fs: wrap all options with f2fs_sb_info.mount_opt
  f2fs: Don't overwrite all types of node to keep node chain
  f2fs: introduce mount option for fsync mode
  f2fs: fix to restore old mount option in ->remount_fs
  f2fs: wrap sb_rdonly with f2fs_readonly
  f2fs: avoid selinux denial on CAP_SYS_RESOURCE
  f2fs: support hot file extension
  f2fs: fix to avoid race in between atomic write and background GC
  f2fs: do gc in greedy mode for whole range if gc_urgent mode is set
  f2fs: issue discard aggressively in the gc_urgent mode
  f2fs: set readdir_ra by default
  f2fs: add auto tuning for small devices
  f2fs: add mount option for segment allocation policy
  f2fs: don't stop GC if GC is contended
  f2fs: expose extension_list sysfs entry
  f2fs: fix to set KEEP_SIZE bit in f2fs_zero_range
  f2fs: introduce sb_lock to make encrypt pwsalt update exclusive
  f2fs: remove redundant initialization of pointer 'p'
  f2fs: flush cp pack except cp pack 2 page at first
  f2fs: clean up f2fs_sb_has_xxx functions
  f2fs: remove redundant check of page type when submit bio
  f2fs: fix to handle looped node chain during recovery
  f2fs: handle quota for orphan inodes
  f2fs: support passing down write hints to block layer with F2FS policy
  f2fs: support passing down write hints given by users to block layer
  f2fs: fix to clear CP_TRIMMED_FLAG
  f2fs: support large nat bitmap
  f2fs: fix to check extent cache in f2fs_drop_extent_tree
  f2fs: restrict inline_xattr_size configuration
  f2fs: fix heap mode to reset it back
  f2fs: fix potential corruption in area before F2FS_SUPER_OFFSET
  fscrypt: fix build with pre-4.6 gcc versions
  fscrypt: fix up fscrypt_fname_encrypted_size() for internal use
  fscrypt: define fscrypt_fname_alloc_buffer() to be for presented names
  fscrypt: calculate NUL-padding length in one place only
  fscrypt: move fscrypt_symlink_data to fscrypt_private.h
  fscrypt: remove fscrypt_fname_usr_to_disk()
  f2fs: switch to fscrypt_get_symlink()
  f2fs: switch to fscrypt ->symlink() helper functions
  fscrypt: new helper function - fscrypt_get_symlink()
  fscrypt: new helper functions for ->symlink()
  fscrypt: trim down fscrypt.h includes
  fscrypt: move fscrypt_is_dot_dotdot() to fs/crypto/fname.c
  fscrypt: move fscrypt_valid_enc_modes() to fscrypt_private.h
  fscrypt: move fscrypt_operations declaration to fscrypt_supp.h
  fscrypt: split fscrypt_dummy_context_enabled() into supp/notsupp versions
  fscrypt: move fscrypt_ctx declaration to fscrypt_supp.h
  fscrypt: move fscrypt_info_cachep declaration to fscrypt_private.h
  fscrypt: move fscrypt_control_page() to supp/notsupp headers
  fscrypt: move fscrypt_has_encryption_key() to supp/notsupp headers
  f2fs: don't put dentry page in pagecache into highmem
  f2fs: support inode creation time
  f2fs: rebuild sit page from sit info in mem
  f2fs: stop issuing discard if fs is readonly
  f2fs: clean up duplicated assignment in init_discard_policy
  f2fs: use GFP_F2FS_ZERO for cleanup
  f2fs: allow to recover node blocks given updated checkpoint
  f2fs: recover some i_inline flags
  f2fs: correct removexattr behavior for null valued extended attribute
  f2fs: drop page cache after fs shutdown
  f2fs: stop gc/discard thread after fs shutdown
  f2fs: hanlde error case in f2fs_ioc_shutdown
  f2fs: split need_inplace_update
  f2fs: fix to update last_disk_size correctly
  f2fs: kill F2FS_INLINE_XATTR_ADDRS for cleanup
  f2fs: clean up error path of fill_super
  f2fs: avoid hungtask when GC encrypted block if io_bits is set
  f2fs: allow quota to use reserved blocks
  f2fs: fix to drop all inmem pages correctly
  f2fs: speed up defragment on sparse file
  f2fs: support F2FS_IOC_PRECACHE_EXTENTS
  f2fs: add an ioctl to disable GC for specific file
  f2fs: prevent newly created inode from being dirtied incorrectly
  f2fs: support FIEMAP_FLAG_XATTR
  f2fs: fix to cover f2fs_inline_data_fiemap with inode_lock
  f2fs: check node page again in write end io
  f2fs: fix to caclulate required free section correctly
  f2fs: handle newly created page when revoking inmem pages
  f2fs: add resgid and resuid to reserve root blocks
  f2fs: implement cgroup writeback support
  f2fs: remove unused pend_list_tag
  f2fs: avoid high cpu usage in discard thread
  f2fs: make local functions static
  f2fs: add reserved blocks for root user
  f2fs: check segment type in __f2fs_replace_block
  f2fs: update inode info to inode page for new file
  f2fs: show precise # of blocks that user/root can use
  f2fs: clean up unneeded declaration
  f2fs: continue to do direct IO if we only preallocate partial blocks
  f2fs: enable quota at remount from r to w
  f2fs: skip stop_checkpoint for user data writes
  f2fs: fix missing error number for xattr operation
  f2fs: recover directory operations by fsync
  f2fs: return error during fill_super
  f2fs: fix an error case of missing update inode page
  f2fs: fix potential hangtask in f2fs_trace_pid
  f2fs: no need return value in restore summary process
  f2fs: use unlikely for release case
  f2fs: don't return value in truncate_data_blocks_range
  f2fs: clean up f2fs_map_blocks
  f2fs: clean up hash codes
  f2fs: fix error handling in fill_super
  f2fs: spread f2fs_k{m,z}alloc
  f2fs: inject fault to kvmalloc
  f2fs: inject fault to kzalloc
  f2fs: remove a redundant conditional expression
  f2fs: apply write hints to select the type of segment for direct write
  f2fs: switch to fscrypt_prepare_setattr()
  f2fs: switch to fscrypt_prepare_lookup()
  f2fs: switch to fscrypt_prepare_rename()
  f2fs: switch to fscrypt_prepare_link()
  f2fs: switch to fscrypt_file_open()
  f2fs: remove repeated f2fs_bug_on
  f2fs: remove an excess variable
  f2fs: fix lock dependency in between dio_rwsem & i_mmap_sem
  f2fs: remove unused parameter
  f2fs: still write data if preallocate only partial blocks
  f2fs: introduce sysfs readdir_ra to readahead inode block in readdir
  f2fs: fix concurrent problem for updating free bitmap
  f2fs: remove unneeded memory footprint accounting
  f2fs: no need to read nat block if nat_block_bitmap is set
  f2fs: reserve nid resource for quota sysfile
  fscrypt: resolve some cherry-pick bugs
  fscrypt: move to generic async completion
  crypto: introduce crypto wait for async op
  fscrypt: lock mutex before checking for bounce page pool
  fscrypt: new helper function - fscrypt_prepare_setattr()
  fscrypt: new helper function - fscrypt_prepare_lookup()
  fscrypt: new helper function - fscrypt_prepare_rename()
  fscrypt: new helper function - fscrypt_prepare_link()
  fscrypt: new helper function - fscrypt_file_open()
  fscrypt: new helper function - fscrypt_require_key()
  fscrypt: remove unneeded empty fscrypt_operations structs
  fscrypt: remove ->is_encrypted()
  fscrypt: switch from ->is_encrypted() to IS_ENCRYPTED()
  fs, fscrypt: add an S_ENCRYPTED inode flag
  fscrypt: clean up include file mess
  fscrypt: fix dereference of NULL user_key_payload
  fscrypt: make ->dummy_context() return bool
  f2fs: deny accessing encryption policy if encryption is off
  f2fs: inject fault in inc_valid_node_count
  f2fs: fix to clear FI_NO_PREALLOC
  f2fs: expose quota information in debugfs
  f2fs: separate nat entry mem alloc from nat_tree_lock
  f2fs: validate before set/clear free nat bitmap
  f2fs: avoid opened loop codes in __add_ino_entry
  f2fs: apply write hints to select the type of segments for buffered write
  f2fs: introduce scan_curseg_cache for cleanup
  f2fs: optimize the way of traversing free_nid_bitmap
  f2fs: keep scanning until enough free nids are acquired
  f2fs: trace checkpoint reason in fsync()
  f2fs: keep isize once block is reserved cross EOF
  f2fs: avoid race in between GC and block exchange
  f2fs: save a multiplication for last_nid calculation
  f2fs: fix summary info corruption
  f2fs: remove dead code in update_meta_page
  f2fs: remove unneeded semicolon
  f2fs: don't bother with inode->i_version
  f2fs: check curseg space before foreground GC
  f2fs: use rw_semaphore to protect SIT cache
  f2fs: support quota sys files
  f2fs: add quota_ino feature infra
  f2fs: optimize __update_nat_bits
  f2fs: modify for accurate fggc node io stat
  Revert "f2fs: handle dirty segments inside refresh_sit_entry"
  f2fs: add a function to move nid
  f2fs: export SSR allocation threshold
  f2fs: give correct trimmed blocks in fstrim
  f2fs: support bio allocation error injection
  f2fs: support get_page error injection
  f2fs: add missing sysfs description
  f2fs: support soft block reservation
  f2fs: handle error case when adding xattr entry
  f2fs: support flexible inline xattr size
  f2fs: show current cp state
  f2fs: add missing quota_initialize
  f2fs: show # of dirty segments via sysfs
  f2fs: stop all the operations by cp_error flag
  f2fs: remove several redundant assignments
  f2fs: avoid using timespec
  f2fs: fix to correct no_fggc_candidate
  Revert "f2fs: return wrong error number on f2fs_quota_write"
  f2fs: remove obsolete pointer for truncate_xattr_node
  f2fs: retry ENOMEM for quota_read|write
  f2fs: limit # of inmemory pages
  f2fs: update ctx->pos correctly when hitting hole in directory
  f2fs: relocate readahead codes in readdir()
  f2fs: allow readdir() to be interrupted
  f2fs: trace f2fs_readdir
  f2fs: trace f2fs_lookup
  f2fs: skip searching non-exist range in truncate_hole
  f2fs: expose some sectors to user in inline data or dentry case
  f2fs: avoid stale fi->gdirty_list pointer
  f2fs/crypto: drop crypto key at evict_inode only
  f2fs: fix to avoid race when accessing last_disk_size
  f2fs: Fix bool initialization/comparison
  f2fs: give up CP_TRIMMED_FLAG if it drops discards
  f2fs: trace f2fs_remove_discard
  f2fs: reduce cmd_lock coverage in __issue_discard_cmd
  f2fs: split discard policy
  f2fs: wrap discard policy
  f2fs: support issuing/waiting discard in range
  f2fs: fix to flush multiple device in checkpoint
  f2fs: enhance multiple device flush
  f2fs: fix to show ino management cache size correctly
  f2fs: drop FI_UPDATE_WRITE tag after f2fs_issue_flush
  f2fs: obsolete ALLOC_NID_LIST list
  f2fs: convert inline data for direct I/O & FI_NO_PREALLOC
  f2fs: allow readpages with NULL file pointer
  f2fs: show flush list status in sysfs
  f2fs: introduce read_xattr_block
  f2fs: introduce read_inline_xattr
  Revert "f2fs: reuse nids more aggressively"
  Revert "f2fs: node segment is prior to data segment selected victim"
  f2fs: fix potential panic during fstrim
  f2fs: hurry up to issue discard after io interruption
  f2fs: fix to show correct discard_granularity in sysfs
  f2fs: detect dirty inode in evict_inode
  f2fs: clear radix tree dirty tag of pages whose dirty flag is cleared
  f2fs: speed up gc_urgent mode with SSR
  f2fs: better to wait for fstrim completion
  f2fs: avoid race in between read xattr & write xattr
  f2fs: make get_lock_data_page to handle encrypted inode
  f2fs: use generic terms used for encrypted block management
  f2fs: introduce f2fs_encrypted_file for clean-up
  Revert "f2fs: add a new function get_ssr_cost"
  f2fs: constify super_operations
  f2fs: fix to wake up all sleeping flusher
  f2fs: avoid race in between atomic_read & atomic_inc
  f2fs: remove unneeded parameter of change_curseg
  f2fs: update i_flags correctly
  f2fs: don't check inode's checksum if it was dirtied or writebacked
  f2fs: don't need to update inode checksum for recovery
  f2fs: trigger fdatasync for non-atomic_write file
  f2fs: fix to avoid race in between aio and gc
  f2fs: wake up discard_thread iff there is a candidate
  f2fs: return error when accessing insane flie offset
  f2fs: trigger normal fsync for non-atomic_write file
  f2fs: clear FI_HOT_DATA correctly
  f2fs: fix out-of-order execution in f2fs_issue_flush
  f2fs: issue discard commands if gc_urgent is set
  f2fs: introduce discard_granularity sysfs entry
  f2fs: remove unused function overprovision_sections
  f2fs: check hot_data for roll-forward recovery
  f2fs: add tracepoint for f2fs_gc
  f2fs: retry to revoke atomic commit in -ENOMEM case
  f2fs: let fill_super handle roll-forward errors
  f2fs: merge equivalent flags F2FS_GET_BLOCK_[READ|DIO]
  f2fs: support journalled quota
  f2fs: fix potential overflow when adjusting GC cycle
  f2fs: avoid unneeded sync on quota file
  f2fs: introduce gc_urgent mode for background GC
  f2fs: use IPU for cold files
  f2fs: fix the size value in __check_sit_bitmap
  f2fs: add app/fs io stat
  f2fs: do not change the valid_block value if cur_valid_map was wrongly set or cleared
  f2fs: update cur_valid_map_mir together with cur_valid_map
  f2fs: use printk_ratelimited for f2fs_msg
  f2fs: expose features to sysfs entry
  f2fs: support inode checksum
  f2fs: return wrong error number on f2fs_quota_write
  f2fs: provide f2fs_balance_fs to __write_node_page
  f2fs: introduce f2fs_statfs_project
  f2fs: don't need to wait for node writes for atomic write
  f2fs: avoid naming confusion of sysfs init
  f2fs: support project quota
  f2fs: record quota during dot{,dot} recovery
  f2fs: enhance on-disk inode structure scalability
  f2fs: make max inline size changeable
  f2fs: add ioctl to expose current features
  f2fs: make background threads of f2fs being aware of freezing
  f2fs: don't give partially written atomic data from process crash
  f2fs: give a try to do atomic write in -ENOMEM case
  f2fs: preserve i_mode if __f2fs_set_acl() fails
  f2fs: alloc new nids for xattr block in recovery
  f2fs: spread struct f2fs_dentry_ptr for inline path
  f2fs: remove unused input parameter
  f2fs: avoid cpu lockup
  f2fs: include seq_file.h for sysfs.c
  f2fs: Don't clear SGID when inheriting ACLs
  f2fs: remove extra inode_unlock() in error path
  fscrypt: add support for AES-128-CBC
  fscrypt: inline fscrypt_free_filename()
  f2fs: make more close to v4.13-rc1
  f2fs: support plain user/group quota
  f2fs: avoid deadlock caused by lock order of page and lock_op
  f2fs: use spin_{,un}lock_irq{save,restore}
  f2fs: relax migratepage for atomic written page
  f2fs: don't count inode block in in-memory inode.i_blocks
  Revert "f2fs: fix to clean previous mount option when remount_fs"
  f2fs: do not set LOST_PINO for renamed dir
  f2fs: do not set LOST_PINO for newly created dir
  f2fs: skip ->writepages for {mete,node}_inode during recovery
  f2fs: introduce __check_sit_bitmap
  f2fs: stop gc/discard thread in prior during umount
  f2fs: introduce reserved_blocks in sysfs
  f2fs: avoid redundant f2fs_flush after remount
  f2fs: report # of free inodes more precisely
  f2fs: add ioctl to do gc with target block address
  f2fs: don't need to check encrypted inode for partial truncation
  f2fs: measure inode.i_blocks as generic filesystem
  f2fs: set CP_TRIMMED_FLAG correctly
  f2fs: require key for truncate(2) of encrypted file
  f2fs: move sysfs code from super.c to fs/f2fs/sysfs.c
  f2fs: clean up sysfs codes
  f2fs: fix wrong error number of fill_super
  f2fs: fix to show injection rate in ->show_options
  f2fs: Fix a return value in case of error in 'f2fs_fill_super'
  f2fs: use proper variable name
  f2fs: fix to avoid panic when encountering corrupt node
  f2fs: don't track newly allocated nat entry in list
  f2fs: add f2fs_bug_on in __remove_discard_cmd
  f2fs: introduce __wait_one_discard_bio
  f2fs: dax: fix races between page faults and truncating pages
  f2fs: simplify the way of calulating next nat address
  f2fs: sanity check size of nat and sit cache
  f2fs: fix a panic caused by NULL flush_cmd_control
  f2fs: remove the unnecessary cast for PTR_ERR
  f2fs: remove false-positive bug_on
  f2fs: Do not issue small discards in LFS mode
  f2fs: don't bother checking for encryption key in ->write_iter()
  f2fs: don't bother checking for encryption key in ->mmap()
  f2fs: wait discard IO completion without cmd_lock held
  f2fs: wake up all waiters in f2fs_submit_discard_endio
  f2fs: show more info if fail to issue discard
  f2fs: introduce io_list for serialize data/node IOs
  f2fs: split wio_mutex
  f2fs: combine huge num of discard rb tree consistence checks
  f2fs: fix a bug caused by NULL extent tree
  f2fs: try to freeze in gc and discard threads
  f2fs: add a new function get_ssr_cost
  f2fs: declare load_free_nid_bitmap static
  f2fs: avoid f2fs_lock_op for IPU writes
  f2fs: split bio cache
  f2fs: use fio instead of multiple parameters
  f2fs: remove unnecessary read cases in merged IO flow
  f2fs: use f2fs_submit_page_bio for ra_meta_pages
  f2fs: make sure f2fs_gc returns consistent errno
  f2fs: load inode's flag from disk
  f2fs: sanity check checkpoint segno and blkoff
  f2fs, block_dump: give WRITE direction to submit_bio
  fscrypt: correct collision claim for digested names
  f2fs: switch to using fscrypt_match_name()
  fscrypt: introduce helper function for filename matching
  fscrypt: fix context consistency check when key(s) unavailable
  fscrypt: Move key structure and constants to uapi
  fscrypt: remove fscrypt_symlink_data_len()
  fscrypt: remove unnecessary checks for NULL operations
  fscrypt: eliminate ->prepare_context() operation
  fscrypt: remove broken support for detecting keyring key revocation
  fscrypt: avoid collisions when presenting long encrypted filenames
  f2fs: check entire encrypted bigname when finding a dentry
  f2fs: sync f2fs_lookup() with ext4_lookup()
  f2fs: fix a mount fail for wrong next_scan_nid
  f2fs: relocate inode_{,un}lock in F2FS_IOC_SETFLAGS
  f2fs: show available_nids in f2fs/status
  f2fs: flush dirty nats periodically
  f2fs: introduce CP_TRIMMED_FLAG to avoid unneeded discard
  f2fs: allow cpc->reason to indicate more than one reason
  f2fs: release cp and dnode lock before IPU
  f2fs: shrink size of struct discard_cmd
  f2fs: don't hold cmd_lock during waiting discard command
  f2fs: nullify fio->encrypted_page for each writes
  f2fs: sanity check segment count
  f2fs: introduce valid_ipu_blkaddr to clean up
  f2fs: lookup extent cache first under IPU scenario
  f2fs: reconstruct code to write a data page
  f2fs: introduce __wait_discard_cmd
  f2fs: introduce __issue_discard_cmd
  f2fs: enable small discard by default
  f2fs: delay awaking discard thread
  f2fs: seperate read nat page from nat_tree_lock
  f2fs: fix multiple f2fs_add_link() having same name for inline dentry
  f2fs: skip encrypted inode in ASYNC IPU policy
  f2fs: fix out-of free segments
  f2fs: improve definition of statistic macros
  f2fs: assign allocation hint for warm/cold data
  f2fs: fix _IOW usage
  f2fs: add ioctl to flush data from faster device to cold area
  f2fs: introduce async IPU policy
  f2fs: add undiscard blocks stat
  f2fs: unlock cp_rwsem early for IPU writes
  f2fs: introduce __check_rb_tree_consistence
  f2fs: trace __submit_discard_cmd
  f2fs: in prior to issue big discard
  f2fs: clean up discard_cmd_control structure
  f2fs: use rb-tree to track pending discard commands
  f2fs: avoid dirty node pages in check_only recovery
  f2fs: fix not to set fsync/dentry mark
  f2fs: allocate hot_data for atomic writes
  f2fs: give time to flush dirty pages for checkpoint
  f2fs: fix fs corruption due to zero inode page
  f2fs: shrink blk plug region
  f2fs: extract rb-tree operation infrastructure
  f2fs: avoid frequent checkpoint during f2fs_gc
  f2fs: clean up some macros in terms of GET_SEGNO
  f2fs: clean up get_valid_blocks with consistent parameter
  f2fs: use segment number for get_valid_blocks
  f2fs: guard macro variables with braces
  f2fs: fix comment on f2fs_flush_merged_bios() after 86531d6b
  f2fs: prevent waiter encountering incorrect discard states
  f2fs: introduce f2fs_wait_discard_bios
  f2fs: split discard_cmd_list
  Revert "f2fs: put allocate_segment after refresh_sit_entry"
  f2fs: split make_dentry_ptr() into block and inline versions
  f2fs: submit bio of in-place-update pages
  f2fs: remove the redundant variable definition
  f2fs: avoid IO split due to mixed WB_SYNC_ALL and WB_SYNC_NONE
  f2fs: write small sized IO to hot log
  f2fs: use bitmap in discard_entry
  f2fs: clean up destroy_discard_cmd_control
  f2fs: count discard command entry
  f2fs: show issued flush/discard count
  f2fs: relax node version check for victim data in gc
  f2fs: start SSR much eariler to avoid FG_GC
  f2fs: allocate node and hot data in the beginning of partition
  f2fs: fix wrong max cost initialization
  f2fs: allow write page cache when writting cp
  f2fs: don't reserve additional space in xattr block
  f2fs: clean up xattr operation
  f2fs: don't track volatile file in dirty inode list
  f2fs: show the max number of volatile operations
  f2fs: fix race condition in between free nid allocator/initializer
  f2fs: use set_page_private marcro in f2fs_trace_pid
  f2fs: fix recording invalid last_victim
  f2fs: more reasonable mem_size calculating of ino_entry
  f2fs: calculate the f2fs_stat_info into base_mem
  f2fs: avoid stat_inc_atomic_write for non-atomic file
  f2fs: sanity check of crc_offset from raw checkpoint
  f2fs: cleanup the disk level filename updating
  f2fs: cover update_free_nid_bitmap with nid_list_lock
  f2fs: fix bad prefetchw of NULL page
  f2fs: clear FI_DATA_EXIST flag in truncate_inline_inode
  f2fs: move mnt_want_write_file after arguments checking
  f2fs: check new size by inode_newsize_ok in f2fs_insert_range
  f2fs: avoid copy date to user-space if move file range fail
  f2fs: drop duplicate new_size assign in f2fs_zero_range
  f2fs: adjust the way of calculating nat block
  f2fs: add fault injection on f2fs_truncate
  f2fs: check range before defragment
  f2fs: use parameter max_items instead of PIDVEC_SIZE
  f2fs: add a punch discard command function
  f2fs: allocate a bio for discarding when actually issuing it
  f2fs: skip writeback meta pages if cp_mutex acquire failed
  f2fs: show more precise message on orphan recovery failure
  f2fs: remove dead macro PGOFS_OF_NEXT_DNODE
  f2fs: drop duplicate radix tree lookup of nat_entry_set
  f2fs: make sure trace all f2fs_issue_flush
  f2fs: don't allow volatile writes for non-regular file
  f2fs: don't allow atomic writes for not regular files
  f2fs: fix stale ATOMIC_WRITTEN_PAGE private pointer
  f2fs: build stat_info before orphan inode recovery
  f2fs: fix the fault of calculating blkstart twice
  f2fs: fix the fault of checking F2FS_LINK_MAX for rename inode
  f2fs: don't allow to get pino when filename is encrypted
  f2fs: fix wrong error injection for evict_inode
  f2fs: le32_to_cpu for ckpt->cp_pack_total_block_count
  f2fs: le16_to_cpu for xattr->e_value_size
  f2fs: don't need to invalidate wrong node page
  f2fs: fix an error return value in truncate_partial_data_page
  f2fs: combine nat_bits and free_nid_bitmap cache
  f2fs: skip scanning free nid bitmap of full NAT blocks
  f2fs: use __set{__clear}_bit_le
  f2fs: update_free_nid_bitmap() can be static
  f2fs: __update_nat_bits() can be static
  f2fs: le16_to_cpu for xattr->e_value_size
  f2fs: don't overwrite node block by SSR
  f2fs: don't need to invalidate wrong node page
  f2fs: fix an error return value in truncate_partial_data_page
  fscrypt: catch up to v4.11-rc1
  f2fs: avoid to flush nat journal entries
  f2fs: avoid to issue redundant discard commands
  f2fs: fix a plint compile warning
  f2fs: add f2fs_drop_inode tracepoint
  f2fs: Fix zoned block device support
  f2fs: remove redundant set_page_dirty()
  f2fs: fix to enlarge size of write_io_dummy mempool
  f2fs: fix memory leak of write_io_dummy mempool during umount
  f2fs: fix to update F2FS_{CP_}WB_DATA count correctly
  f2fs: use MAX_FREE_NIDS for the free nids target
  f2fs: introduce free nid bitmap
  f2fs: new helper cur_cp_crc() getting crc in f2fs_checkpoint
  f2fs: update the comment of default nr_pages to skipping
  f2fs: drop the duplicate pval in f2fs_getxattr
  f2fs: Don't update the xattr data that same as the exist
  f2fs: kill __is_extent_same
  f2fs: avoid bggc->fggc when enough free segments are avaliable after cp
  f2fs: select target segment with closer temperature in SSR mode
  f2fs: show simple call stack in fault injection message
  fscrypt: catch fscrypto_get_policy in v4.10-rc6
  f2fs: use __clear_bit_le
  f2fs: no need lock_op in f2fs_write_inline_data
  f2fs: add bitmaps for empty or full NAT blocks
  f2fs: replace rw semaphore extent_tree_lock with mutex lock
  f2fs: avoid m_flags overlay when allocating more data blocks
  f2fs: remove unsafe bitmap checking
  f2fs: init local extent_info to avoid stale stack info in tp
  f2fs: remove unnecessary condition check for write_checkpoint in f2fs_gc
  f2fs: do SSR for node segments more aggresively
  f2fs: check discard alignment only for SEQWRITE zones
  f2fs: wait for discard completion after submission
  f2fs: much larger batched trim_fs job
  f2fs: avoid very large discard command
  f2fs: find data segments across all the types
  f2fs: do SSR in higher priority
  f2fs: do SSR for data when there is enough free space
  f2fs: node segment is prior to data segment selected victim
  f2fs: put allocate_segment after refresh_sit_entry
  f2fs: add ovp valid_blocks check for bg gc victim to fg_gc
  f2fs: do not wait for writeback in write_begin
  f2fs: replace __get_victim by dirty_segments in FG_GC
  f2fs: fix multiple f2fs_add_link() calls having same name
  f2fs: show actual device info in tracepoints
  f2fs: use SSR for warm node as well
  f2fs: enable inline_xattr by default
  f2fs: introduce noinline_xattr mount option
  f2fs: avoid reading NAT page by get_node_info
  f2fs: remove build_free_nids() during checkpoint
  f2fs: change recovery policy of xattr node block
  f2fs: super: constify fscrypt_operations structure
  f2fs: show checkpoint version at mount time
  f2fs: remove preflush for nobarrier case
  f2fs: check last page index in cached bio to decide submission
  f2fs: check io submission more precisely
  f2fs: fix trim_fs assignment
  Revert "f2fs: remove batched discard in f2fs_trim_fs"
  f2fs: fix missing bio_alloc(1)
  f2fs: call internal __write_data_page directly
  f2fs: avoid out-of-order execution of atomic writes
  f2fs: move write_node_page above fsync_node_pages
  f2fs: move flush tracepoint
  f2fs: show # of APPEND and UPDATE inodes
  f2fs: fix 446 coding style warnings in f2fs.h
  f2fs: fix 3 coding style errors in f2fs.h
  f2fs: declare missing static function
  f2fs: show the fault injection mount option
  f2fs: fix null pointer dereference when issuing flush in ->fsync
  f2fs: fix to avoid overflow when left shifting page offset
  f2fs: enhance lookup xattr
  f2fs: fix a dead loop in f2fs_fiemap()
  f2fs: do not preallocate blocks which has wrong buffer
  f2fs: show # of on-going flush and discard bios
  f2fs: add a kernel thread to issue discard commands asynchronously
  f2fs: factor out discard command info into discard_cmd_control
  f2fs: remove batched discard in f2fs_trim_fs
  f2fs: reorganize stat information
  f2fs: clean up flush/discard command namings
  f2fs: check in-memory sit version bitmap
  f2fs: check in-memory nat version bitmap
  f2fs: check in-memory block bitmap
  f2fs: introduce FI_ATOMIC_COMMIT
  f2fs: clean up with list_{first, last}_entry
  f2fs: return fs_trim if there is no candidate
  f2fs: avoid needless checkpoint in f2fs_trim_fs
  f2fs: relax async discard commands more
  f2fs: drop exist_data for inline_data when truncated to 0
  f2fs: don't allow encrypted operations without keys
  f2fs: show the max number of atomic operations
  f2fs: get io size bit from mount option
  f2fs: support IO alignment for DATA and NODE writes
  f2fs: add submit_bio tracepoint
  f2fs: reassign new segment for mode=lfs
  f2fs: fix a missing discard prefree segments
  f2fs: use rb_entry_safe
  f2fs: add a case of no need to read a page in write begin
  f2fs: fix a problem of using memory after free
  f2fs: remove unneeded condition
  f2fs: don't cache nat entry if out of memory
  f2fs: remove unused values in recover_fsync_data
  f2fs: support async discard based on v4.9
  f2fs: resolve op and op_flags confilcts
  f2fs: remove wrong backported codes
  f2fs: fix a missing size change in f2fs_setattr
  fs/super.c: fix race between freeze_super() and thaw_super()
  scripts/tags.sh: catch 4.9-rc6
  f2fs: fix to access nullified flush_cmd_control pointer
  f2fs: free meta pages if sanity check for ckpt is failed
  f2fs: detect wrong layout
  f2fs: call sync_fs when f2fs is idle
  Revert "f2fs: use percpu_counter for # of dirty pages in inode"
  f2fs: return AOP_WRITEPAGE_ACTIVATE for writepage
  f2fs: do not activate auto_recovery for fallocated i_size
  f2fs: fix 32-bit build
  f2fs: set ->owner for debugfs status file's file_operations
  f2fs: fix incorrect free inode count in ->statfs
  f2fs: drop duplicate header timer.h
  f2fs: fix wrong AUTO_RECOVER condition
  f2fs: do not recover i_size if it's valid
  f2fs: fix fdatasync
  f2fs: fix to account total free nid correctly
  f2fs: fix an infinite loop when flush nodes in cp
  f2fs: don't wait writeback for datas during checkpoint
  f2fs: fix wrong written_valid_blocks counting
  f2fs: avoid BG_GC in f2fs_balance_fs
  f2fs: fix redundant block allocation
  f2fs: use err for f2fs_preallocate_blocks
  f2fs: support multiple devices
  f2fs: allow dio read for LFS mode
  f2fs: revert segment allocation for direct IO
  f2fs: return directly if block has been removed from the victim
  Revert "f2fs: do not recover from previous remained wrong dnodes"
  f2fs: remove checkpoint in f2fs_freeze
  f2fs: assign segments correctly for direct_io
  f2fs: fix wrong i_atime recovery
  f2fs: record inode updating status correctly
  f2fs: Trace reset zone events
  f2fs: Reset sequential zones on zoned block devices
  f2fs: Cache zoned block devices zone type
  f2fs: Do not allow adaptive mode for host-managed zoned block devices
  f2fs: Always enable discard for zoned blocks devices
  f2fs: Suppress discard warning message for zoned block devices
  f2fs: Check zoned block feature for host-managed zoned block devices
  f2fs: Use generic zoned block device terminology
  f2fs: Add missing break in switch-case
  f2fs: avoid infinite loop in the EIO case on recover_orphan_inodes
  f2fs: report error of f2fs_fill_dentries
  fs/crypto: catch up 4.9-rc6
  f2fs: hide a maybe-uninitialized warning
  f2fs: remove percpu_count due to performance regression
  f2fs: make clean inodes when flushing inode page
  f2fs: keep dirty inodes selectively for checkpoint
  f2fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps
  f2fs: use BIO_MAX_PAGES for bio allocation
  f2fs: declare static function for __build_free_nids
  f2fs: call f2fs_balance_fs for setattr
  f2fs: count dirty inodes to flush node pages during checkpoint
  f2fs: avoid casted negative value as shrink count
  f2fs: don't interrupt free nids building during nid allocation
  f2fs: clean up free nid list operations
  f2fs: split free nid list
  f2fs: clear nlink if fail to add_link
  f2fs: fix sparse warnings
  f2fs: fix error handling in fsync_node_pages
  f2fs: fix to update largest extent under lock
  f2fs: be aware of extent beyond EOF in fiemap
  f2fs: don't miss any f2fs_balance_fs cases
  f2fs: add missing f2fs_balance_fs in f2fs_zero_range
  f2fs: give a chance to detach from dirty list
  f2fs: fix to release discard entries during checkpoint
  f2fs: exclude free nids building and allocation
  f2fs: fix to determine start_cp_addr by sbi->cur_cp_pack
  f2fs: fix overflow due to condition check order
  posix_acl: Clear SGID bit when setting file permissions
  f2fs: fix wrong sum_page pointer in f2fs_gc
  f2fs: backport from (4c1fad64 - Merge tag 'for-f2fs-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs)

 Conflicts:
	Makefile
	arch/arm64/configs/cuttlefish_defconfig
	arch/arm64/kernel/vdso.c
	arch/arm64/kernel/vdso/gettimeofday.S
	arch/x86/configs/x86_64_cuttlefish_defconfig
	build.config.cuttlefish.aarch64
	build.config.cuttlefish.x86_64
	drivers/base/power/main.c
	drivers/block/loop.c
	drivers/block/zram/zram_drv.c
	drivers/block/zram/zram_drv.h
	drivers/net/wireless/virt_wifi.c
	drivers/staging/android/lowmemorykiller.c
	drivers/vhost/vsock.c
	fs/ext4/crypto.c
	fs/ext4/crypto_key.c
	fs/f2fs/checkpoint.c
	fs/f2fs/data.c
	fs/f2fs/dir.c
	fs/f2fs/f2fs.h
	fs/f2fs/file.c
	fs/f2fs/inline.c
	fs/f2fs/inode.c
	fs/f2fs/node.c
	fs/f2fs/recovery.c
	fs/f2fs/segment.c
	fs/f2fs/segment.h
	fs/f2fs/super.c
	fs/overlayfs/inode.c
	fs/sdcardfs/super.c
	fs/squashfs/block.c
	fs/squashfs/lz4_wrapper.c
	include/linux/bug.h
	include/linux/f2fs_fs.h
	include/linux/msm_mdp.h
	include/linux/swap.h
	include/linux/virtio_vsock.h
	kernel/cpu.c
	kernel/trace/trace.c
	lib/Kconfig.debug
	lib/list_debug.c
	mm/zsmalloc.c
	net/vmw_vsock/virtio_transport_common.c

Change-Id: Ic475eba811d0e6973a374771d68f31b15865efcc
2021-08-12 14:44:02 +03:00
Nathan Chancellor
788c16d896 Merge 4.4.196 into android-msm-wahoo-4.4
Changes in 4.4.196: (36 commits)
        video: ssd1307fb: Start page range at page_offset
        gpu: drm: radeon: Fix a possible null-pointer dereference in radeon_connector_set_property()
        ipmi_si: Only schedule continuously in the thread in maintenance mode
        clk: qoriq: Fix -Wunused-const-variable
        clk: sirf: Don't reference clk_init_data after registration
        powerpc/rtas: use device model APIs and serialization during LPM
        powerpc/futex: Fix warning: 'oldval' may be used uninitialized in this function
        powerpc/pseries/mobility: use cond_resched when updating device tree
        pinctrl: tegra: Fix write barrier placement in pmx_writel
        vfio_pci: Restore original state on release
        powerpc/64s/exception: machine check use correct cfar for late handler
        powerpc/pseries: correctly track irq state in default idle
        scsi: core: Reduce memory required for SCSI logging
        mfd: intel-lpss: Remove D3cold delay
        ARM: 8898/1: mm: Don't treat faults reported from cache maintenance as writes
        HID: apple: Fix stuck function keys when using FN
        security: smack: Fix possible null-pointer dereferences in smack_socket_sock_rcv_skb()
        fat: work around race with userspace's read via blockdev while mounting
        hypfs: Fix error number left in struct pointer member
        ocfs2: wait for recovering done after direct unlock request
        kmemleak: increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K
        ANDROID: binder: remove waitqueue when thread exits.
        ANDROID: binder: synchronize_rcu() when using POLLFREE.
        hso: fix NULL-deref on tty open
        ipv6: drop incoming packets having a v4mapped source address
        net: ipv4: avoid mixed n_redirects and rate_tokens usage
        net: qlogic: Fix memory leak in ql_alloc_large_buffers
        nfc: fix memory leak in llcp_sock_bind()
        sch_dsmark: fix potential NULL deref in dsmark_init()
        xen-netfront: do not use ~0U as error return value for xennet_fill_frags()
        net/rds: Fix error handling in rds_ib_add_one()
        sch_cbq: validate TCA_CBQ_WRROPT to avoid crash
        Smack: Don't ignore other bprm->unsafe flags if LSM_UNSAFE_PTRACE is set
        smack: use GFP_NOFS while holding inode_smack::smk_lock
        NFC: fix attrs checks in netlink interface
        Linux 4.4.196

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Conflicts:
	drivers/android/binder.c
2019-10-07 12:37:12 -07:00
Nicolas Boichat
9add3e08a8 kmemleak: increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K
[ Upstream commit b751c52bb587ae66f773b15204ef7a147467f4c7 ]

The current default value (400) is too low on many systems (e.g.  some
ARM64 platform takes up 1000+ entries).

syzbot uses 16000 as default value, and has proved to be enough on beefy
configurations, so let's pick that value.

This consumes more RAM on boot (each entry is 160 bytes, so in total
~2.5MB of RAM), but the memory would later be freed (early_log is
__initdata).

Link: http://lkml.kernel.org/r/20190730154027.101525-1-drinkcat@chromium.org
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Suggested-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Joe Lawrence <joe.lawrence@redhat.com>
Cc: Uladzislau Rezki <urezki@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-10-07 21:01:03 +02:00
Nathan Chancellor
fc8d81bc49 Merge 4.4.191 into android-msm-wahoo-4.4
Changes in 4.4.191: (77 commits)
        HID: Add 044f:b320 ThrustMaster, Inc. 2 in 1 DT
        MIPS: kernel: only use i8253 clocksource with periodic clockevent
        netfilter: ebtables: fix a memory leak bug in compat
        bonding: Force slave speed check after link state recovery for 802.3ad
        can: dev: call netif_carrier_off() in register_candev()
        st21nfca_connectivity_event_received: null check the allocation
        st_nci_hci_connectivity_event_received: null check the allocation
        ASoC: ti: davinci-mcasp: Correct slot_width posed constraint
        net: usb: qmi_wwan: Add the BroadMobi BM818 card
        isdn: mISDN: hfcsusb: Fix possible null-pointer dereferences in start_isoc_chain()
        isdn: hfcsusb: Fix mISDN driver crash caused by transfer buffer on the stack
        perf bench numa: Fix cpu0 binding
        can: sja1000: force the string buffer NULL-terminated
        can: peak_usb: force the string buffer NULL-terminated
        NFSv4: Fix a potential sleep while atomic in nfs4_do_reclaim()
        net: cxgb3_main: Fix a resource leak in a error path in 'init_one()'
        net: hisilicon: make hip04_tx_reclaim non-reentrant
        net: hisilicon: fix hip04-xmit never return TX_BUSY
        net: hisilicon: Fix dma_map_single failed on arm64
        libata: add SG safety checks in SFF pio transfers
        selftests: kvm: Adding config fragments
        HID: wacom: correct misreported EKR ring values
        Revert "dm bufio: fix deadlock with loop device"
        userfaultfd_release: always remove uffd flags and clear vm_userfaultfd_ctx
        x86/retpoline: Don't clobber RFLAGS during CALL_NOSPEC on i386
        x86/apic: Handle missing global clockevent gracefully
        x86/boot: Save fields explicitly, zero out everything else
        x86/boot: Fix boot regression caused by bootparam sanitizing
        dm btree: fix order of block initialization in btree_split_beneath
        dm space map metadata: fix missing store of apply_bops() return value
        dm table: fix invalid memory accesses with too high sector number
        cgroup: Disable IRQs while holding css_set_lock
        GFS2: don't set rgrp gl_object until it's inserted into rgrp tree
        net: arc_emac: fix koops caused by sk_buff free
        vhost-net: set packet weight of tx polling to 2 * vq size
        vhost_net: use packet weight for rx handler, too
        vhost_net: introduce vhost_exceeds_weight()
        vhost: introduce vhost_exceeds_weight()
        vhost_net: fix possible infinite loop
        vhost: scsi: add weight support
        siphash: add cryptographically secure PRF
        siphash: implement HalfSipHash1-3 for hash tables
        inet: switch IP ID generator to siphash
        netfilter: ctnetlink: don't use conntrack/expect object addresses as id
        netfilter: conntrack: Use consistent ct id hash calculation
        Revert "perf test 6: Fix missing kvm module load for s390"
        x86/pm: Introduce quirk framework to save/restore extra MSR registers around suspend/resume
        x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h
        scsi: ufs: Fix NULL pointer dereference in ufshcd_config_vreg_hpm()
        dmaengine: ste_dma40: fix unneeded variable warning
        usb: gadget: composite: Clear "suspended" on reset/disconnect
        usb: host: fotg2: restart hcd after port reset
        tools: hv: fix KVP and VSS daemons exit code
        watchdog: bcm2835_wdt: Fix module autoload
        tcp: fix tcp_rtx_queue_tail in case of empty retransmit queue
        ALSA: usb-audio: Fix a stack buffer overflow bug in check_input_term
        ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit
        tcp: make sure EPOLLOUT wont be missed
        ALSA: seq: Fix potential concurrent access to the deleted pool
        KVM: x86: Don't update RIP or do single-step on faulting emulation
        x86/apic: Do not initialize LDR and DFR for bigsmp
        x86/apic: Include the LDR when clearing out APIC registers
        usb-storage: Add new JMS567 revision to unusual_devs
        USB: cdc-wdm: fix race between write and disconnect due to flag abuse
        usb: host: ohci: fix a race condition between shutdown and irq
        USB: storage: ums-realtek: Update module parameter description for auto_delink_en
        USB: storage: ums-realtek: Whitelist auto-delink support
        ptrace,x86: Make user_64bit_mode() available to 32-bit builds
        uprobes/x86: Fix detection of 32-bit user mode
        mmc: sdhci-of-at91: add quirk for broken HS200
        mmc: core: Fix init of SD cards reporting an invalid VDD range
        stm class: Fix a double free of stm_source_device
        VMCI: Release resource if the work is already queued
        Revert "cfg80211: fix processing world regdomain when non modular"
        mac80211: fix possible sta leak
        x86/ptrace: fix up botched merge of spectrev1 fix
        Linux 4.4.191

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Conflicts:
	drivers/scsi/ufs/ufshcd.c
	fs/userfaultfd.c
	sound/usb/mixer.c
2019-09-06 09:05:17 -07:00
Greg Kroah-Hartman
6da3fbc3ec Merge 4.4.191 into android-4.4
Changes in 4.4.191
	HID: Add 044f:b320 ThrustMaster, Inc. 2 in 1 DT
	MIPS: kernel: only use i8253 clocksource with periodic clockevent
	netfilter: ebtables: fix a memory leak bug in compat
	bonding: Force slave speed check after link state recovery for 802.3ad
	can: dev: call netif_carrier_off() in register_candev()
	st21nfca_connectivity_event_received: null check the allocation
	st_nci_hci_connectivity_event_received: null check the allocation
	ASoC: ti: davinci-mcasp: Correct slot_width posed constraint
	net: usb: qmi_wwan: Add the BroadMobi BM818 card
	isdn: mISDN: hfcsusb: Fix possible null-pointer dereferences in start_isoc_chain()
	isdn: hfcsusb: Fix mISDN driver crash caused by transfer buffer on the stack
	perf bench numa: Fix cpu0 binding
	can: sja1000: force the string buffer NULL-terminated
	can: peak_usb: force the string buffer NULL-terminated
	NFSv4: Fix a potential sleep while atomic in nfs4_do_reclaim()
	net: cxgb3_main: Fix a resource leak in a error path in 'init_one()'
	net: hisilicon: make hip04_tx_reclaim non-reentrant
	net: hisilicon: fix hip04-xmit never return TX_BUSY
	net: hisilicon: Fix dma_map_single failed on arm64
	libata: add SG safety checks in SFF pio transfers
	selftests: kvm: Adding config fragments
	HID: wacom: correct misreported EKR ring values
	Revert "dm bufio: fix deadlock with loop device"
	userfaultfd_release: always remove uffd flags and clear vm_userfaultfd_ctx
	x86/retpoline: Don't clobber RFLAGS during CALL_NOSPEC on i386
	x86/apic: Handle missing global clockevent gracefully
	x86/boot: Save fields explicitly, zero out everything else
	x86/boot: Fix boot regression caused by bootparam sanitizing
	dm btree: fix order of block initialization in btree_split_beneath
	dm space map metadata: fix missing store of apply_bops() return value
	dm table: fix invalid memory accesses with too high sector number
	cgroup: Disable IRQs while holding css_set_lock
	GFS2: don't set rgrp gl_object until it's inserted into rgrp tree
	net: arc_emac: fix koops caused by sk_buff free
	vhost-net: set packet weight of tx polling to 2 * vq size
	vhost_net: use packet weight for rx handler, too
	vhost_net: introduce vhost_exceeds_weight()
	vhost: introduce vhost_exceeds_weight()
	vhost_net: fix possible infinite loop
	vhost: scsi: add weight support
	siphash: add cryptographically secure PRF
	siphash: implement HalfSipHash1-3 for hash tables
	inet: switch IP ID generator to siphash
	netfilter: ctnetlink: don't use conntrack/expect object addresses as id
	netfilter: conntrack: Use consistent ct id hash calculation
	Revert "perf test 6: Fix missing kvm module load for s390"
	x86/pm: Introduce quirk framework to save/restore extra MSR registers around suspend/resume
	x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h
	scsi: ufs: Fix NULL pointer dereference in ufshcd_config_vreg_hpm()
	dmaengine: ste_dma40: fix unneeded variable warning
	usb: gadget: composite: Clear "suspended" on reset/disconnect
	usb: host: fotg2: restart hcd after port reset
	tools: hv: fix KVP and VSS daemons exit code
	watchdog: bcm2835_wdt: Fix module autoload
	tcp: fix tcp_rtx_queue_tail in case of empty retransmit queue
	ALSA: usb-audio: Fix a stack buffer overflow bug in check_input_term
	ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit
	tcp: make sure EPOLLOUT wont be missed
	ALSA: seq: Fix potential concurrent access to the deleted pool
	KVM: x86: Don't update RIP or do single-step on faulting emulation
	x86/apic: Do not initialize LDR and DFR for bigsmp
	x86/apic: Include the LDR when clearing out APIC registers
	usb-storage: Add new JMS567 revision to unusual_devs
	USB: cdc-wdm: fix race between write and disconnect due to flag abuse
	usb: host: ohci: fix a race condition between shutdown and irq
	USB: storage: ums-realtek: Update module parameter description for auto_delink_en
	USB: storage: ums-realtek: Whitelist auto-delink support
	ptrace,x86: Make user_64bit_mode() available to 32-bit builds
	uprobes/x86: Fix detection of 32-bit user mode
	mmc: sdhci-of-at91: add quirk for broken HS200
	mmc: core: Fix init of SD cards reporting an invalid VDD range
	stm class: Fix a double free of stm_source_device
	VMCI: Release resource if the work is already queued
	Revert "cfg80211: fix processing world regdomain when non modular"
	mac80211: fix possible sta leak
	x86/ptrace: fix up botched merge of spectrev1 fix
	Linux 4.4.191

Change-Id: I9c9b3ec748ba2977b818fd569d1788ed5da295b2
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2019-09-06 12:33:41 +02:00
Jason A. Donenfeld
994fcca7f1 siphash: add cryptographically secure PRF
commit 2c956a60778cbb6a27e0c7a8a52a91378c90e1d1 upstream.

SipHash is a 64-bit keyed hash function that is actually a
cryptographically secure PRF, like HMAC. Except SipHash is super fast,
and is meant to be used as a hashtable keyed lookup function, or as a
general PRF for short input use cases, such as sequence numbers or RNG
chaining.

For the first usage:

There are a variety of attacks known as "hashtable poisoning" in which an
attacker forms some data such that the hash of that data will be the
same, and then preceeds to fill up all entries of a hashbucket. This is
a realistic and well-known denial-of-service vector. Currently
hashtables use jhash, which is fast but not secure, and some kind of
rotating key scheme (or none at all, which isn't good). SipHash is meant
as a replacement for jhash in these cases.

There are a modicum of places in the kernel that are vulnerable to
hashtable poisoning attacks, either via userspace vectors or network
vectors, and there's not a reliable mechanism inside the kernel at the
moment to fix it. The first step toward fixing these issues is actually
getting a secure primitive into the kernel for developers to use. Then
we can, bit by bit, port things over to it as deemed appropriate.

While SipHash is extremely fast for a cryptographically secure function,
it is likely a bit slower than the insecure jhash, and so replacements
will be evaluated on a case-by-case basis based on whether or not the
difference in speed is negligible and whether or not the current jhash usage
poses a real security risk.

For the second usage:

A few places in the kernel are using MD5 or SHA1 for creating secure
sequence numbers, syn cookies, port numbers, or fast random numbers.
SipHash is a faster and more fitting, and more secure replacement for MD5
in those situations. Replacing MD5 and SHA1 with SipHash for these uses is
obvious and straight-forward, and so is submitted along with this patch
series. There shouldn't be much of a debate over its efficacy.

Dozens of languages are already using this internally for their hash
tables and PRFs. Some of the BSDs already use this in their kernels.
SipHash is a widely known high-speed solution to a widely known set of
problems, and it's time we catch-up.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Jean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Biggers <ebiggers3@gmail.com>
Cc: David Laight <David.Laight@aculab.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 4.4 as dependency of commits df453700e8d8 "inet: switch
 IP ID generator to siphash" and 3c79107631db "netfilter: ctnetlink: don't
 use conntrack/expect object addresses as id":
 - Adjust context]
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-09-06 10:18:12 +02:00
Eva Huang
b3072b1f5c arm64/config: support panic on warn by config
Add config:
  CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE

This patchset adds CONFIG_PANIC_ON_DEFAULT_ENABLE to determine
the behavior at build time. Even though we could do same thing
by kernel parameter, it's not handy for vendor kernel because
they usually store kernel cmd parameter into different partition
with kernel so that it needs platform image rebuild to change
kernel cmd line as well as kernel image.

To remove such dependency to save much time, this patch adds
default enable by Kconfig at build time.

Bug: 134156483
Change-Id: Ib73e6e2c8d2c2e87ad96cd4c59feeb1c8102d041
Signed-off-by: Eva Huang <evahuang@google.com>
2019-06-14 20:20:07 +00:00
Kees Cook
7514f97280 UPSTREAM: bug: Provide toggle for BUG on data corruption
(cherry-picked from de54ebbe26bb371a6f1fbc0593372232f04e3107)

The kernel checks for cases of data structure corruption under some
CONFIGs (e.g. CONFIG_DEBUG_LIST). When corruption is detected, some
systems may want to BUG() immediately instead of letting the system run
with known corruption.  Usually these kinds of manipulation primitives can
be used by security flaws to gain arbitrary memory write control. This
provides a new config CONFIG_BUG_ON_DATA_CORRUPTION and a corresponding
macro CHECK_DATA_CORRUPTION for handling these situations. Notably, even
if not BUGing, the kernel should not continue processing the corrupted
structure.

This is inspired by similar hardening by Syed Rameez Mustafa in MSM
kernels, and in PaX and Grsecurity, which is likely in response to earlier
removal of the BUG calls in commit 924d9addb9 ("list debugging: use
WARN() instead of BUG()").

Change-Id: I4cdfa9fbebe32a990a111d051e4ec4e421f77a09
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Satya Tangirala <satyat@google.com>
2018-09-21 14:51:06 -07:00
Greg Kroah-Hartman
141b41e393 Merge 'v4.4.118' into android-msm-wahoo-4.4-lts
Linux 4.4.118
    net: dst_cache_per_cpu_dst_set() can be static
    crypto: s5p-sss - Fix kernel Oops in AES-ECB mode
    KVM: nVMX: invvpid handling improvements
    KVM: VMX: clean up declaration of VPID/EPT invalidation types
    kvm: nVMX: Fix kernel panics induced by illegal INVEPT/INVVPID types
    KVM: nVMX: vmx_complete_nested_posted_interrupt() can't fail
    KVM: nVMX: kmap() can't fail
    x86/speculation: Fix typo IBRS_ATT, which should be IBRS_ALL
    x86/spectre: Simplify spectre_v2 command line parsing
  * x86/retpoline: Avoid retpolines for built-in __init functions
      include/linux/init.h
    x86/kvm: Update spectre-v1 mitigation
    x86/paravirt: Remove 'noreplace-paravirt' cmdline option
    x86/spectre: Fix spelling mistake: "vunerable"-> "vulnerable"
    x86/spectre: Report get_user mitigation for spectre_v1
  * nl80211: Sanitize array index in parse_txq_params
      net/wireless/nl80211.c
  * vfs, fdtable: Prevent bounds-check bypass via speculative execution
      include/linux/fdtable.h
    x86/syscall: Sanitize syscall table de-references under speculation
    x86/get_user: Use pointer masking to limit speculation
    x86: Introduce barrier_nospec
    x86: Implement array_index_mask_nospec
    array_index_nospec: Sanitize speculative array de-references
    Documentation: Document array_index_nospec
    x86/spectre: Check CONFIG_RETPOLINE in command line parser
    x86/cpu/bugs: Make retpoline module warning conditional
    x86/bugs: Drop one "mitigation" from dmesg
    x86/nospec: Fix header guards names
  * module/retpoline: Warn about missing retpoline in module
      include/linux/module.h
      kernel/module.c
      scripts/mod/modpost.c
    KVM: VMX: Make indirect call speculation safe
    KVM: x86: Make indirect calls in emulator speculation safe
    x86/retpoline: Remove the esp/rsp thunk
    KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously
  * kasan: rework Kconfig settings
      lib/Kconfig.debug
    drm/gma500: remove helper function
    x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug
  * genksyms: Fix segfault with invalid declarations
      scripts/genksyms/parse.tab.c_shipped
      scripts/genksyms/parse.tab.h_shipped
  * dell-wmi, dell-laptop: depends DMI
      drivers/platform/x86/Kconfig
  * netlink: fix nla_put_{u8,u16,u32} for KASAN
      include/net/netlink.h
  * ASoC: Intel: Kconfig: fix build when ACPI is not enabled
      sound/soc/intel/Kconfig
  * ARM: tegra: select USB_ULPI from EHCI rather than platform
      arch/arm64/Kconfig.platforms
      drivers/usb/host/Kconfig
    ncr5380: shut up gcc indentation warning
  * usb: phy: msm add regulator dependency
      drivers/usb/phy/Kconfig
    idle: i7300: add PCI dependency
  * binfmt_elf: compat: avoid unused function warning
      fs/compat_binfmt_elf.c
    isdn: sc: work around type mismatch warning
    power: bq27xxx_battery: mark some symbols __maybe_unused
  * Revert "power: bq27xxx_battery: Remove unneeded dependency in Kconfig"
      drivers/power/Kconfig
    ncpfs: fix unused variable warning
    gpio: xgene: mark PM functions as __maybe_unused
    net: hp100: remove unnecessary #ifdefs
    dmaengine: zx: fix build warning
    perf/x86: Shut up false-positive -Wmaybe-uninitialized warning
    wireless: cw1200: use __maybe_unused to hide pm functions_
    cw1200: fix bogus maybe-uninitialized warning
  * v4l: remove MEDIA_TUNER dependency for VIDEO_TUNER
      drivers/media/v4l2-core/Kconfig
    hdpvr: hide unused variable
    drm/gma500: Sanity-check pipe index
  * serial: 8250_mid: fix broken DMA dependency
      drivers/tty/serial/8250/Kconfig
    ASoC: rockchip: use __maybe_unused to hide st_irq_syscfg_resume
    ISDN: eicon: reduce stack size of sig_ind function
  * em28xx: only use mt9v011 if camera support is enabled
      drivers/media/usb/em28xx/Kconfig
  * go7007: add MEDIA_CAMERA_SUPPORT dependency
      drivers/media/usb/go7007/Kconfig
    KVM: add X86_LOCAL_APIC dependency
    Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning
    drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized
    tc358743: fix register i2c_rd/wr functions
  * staging: unisys: visorinput depends on INPUT
      drivers/staging/unisys/visorinput/Kconfig
  * i2c: remove __init from i2c_register_board_info()
      drivers/i2c/i2c-boardinfo.c
    b2c2: flexcop: avoid unused function warnings
    infiniband: cxgb4: use %pR format string for printing resources
    iio: adc: axp288: remove redundant duplicate const on axp288_adc_channels
  * ASoC: mediatek: add i2c dependency
      sound/soc/mediatek/Kconfig
  * genirq/msi: Add stubs for get_cached_msi_msg/pci_write_msi_msg
      include/linux/msi.h
  * tty: cyclades: cyz_interrupt is only used for PCI
      drivers/tty/Kconfig
    drm/vmwgfx: use *_32_bits() macros
    tlan: avoid unused label with PCI=n
    tc1100-wmi: fix build warning when CONFIG_PM not enabled
  * ipv4: ipconfig: avoid unused ic_proto_used symbol
      net/ipv4/ipconfig.c
  * netfilter: ipvs: avoid unused variable warnings
      net/netfilter/ipvs/ip_vs_ctl.c
    x86/platform/olpc: Fix resume handler build warning
    staging: wilc1000: fix kbuild test robot error
    rtlwifi: fix gcc-6 indentation warning
  * USB: cdc_subset: only build when one driver is enabled
      drivers/net/usb/Kconfig
      drivers/net/usb/Makefile
    hwrng: exynos - use __maybe_unused to hide pm functions
    fbdev: sm712fb: avoid unused function warnings
    Drivers: hv: vmbus: fix build warning
  * modsign: hide openssl output in silent builds
      certs/Makefile
    fbdev: s6e8ax0: avoid unused function warnings
  * mtd: cfi: enforce valid geometry configuration
      drivers/mtd/chips/Kconfig
    mtd: sh_flctl: pass FIFO as physical address
    amd-xgbe: Fix unused suspend handlers build warning
    fbdev: auo_k190x: avoid unused function warnings
  * driver-core: use 'dev' argument in dev_dbg_ratelimited stub
      include/linux/device.h
    target/user: Fix cast from pointer to phys_addr_t
    tty: hvc_xen: hide xen_console_remove when unused
    usb: musb/ux500: remove duplicate check for dma_is_compatible
    pwc: hide unused label
    SCSI: initio: remove duplicate module device table
    scsi: mvumi: use __maybe_unused to hide pm functions
    video: Use bool instead int pointer for get_opt_bool() argument
  * fbdev: sis: enforce selection of at least one backend
      drivers/video/fbdev/Kconfig
    staging: ste_rmi4: avoid unused function warnings
    video: fbdev: sis: remove unused variable
    scsi: fdomain: drop fdomain_pci_tbl when built-in
    mptfusion: hide unused seq_mpt_print_ioc_summary function
    mtd: maps: add __init attribute
    mtd: ichxrom: maybe-uninitialized with gcc-4.9
  * md: avoid warning for 32-bit sector_t
      drivers/md/md.c
  * profile: hide unused functions when !CONFIG_PROC_FS
      kernel/profile.c
    dpt_i2o: fix build warning
    drivers/net: fix eisa_driver probe section mismatch
    scsi: sim710: fix build warning
    x86/boot: Avoid warning for zero-filling .bss
    thermal: spear: use __maybe_unused for PM functions
    ssb: mark ssb_bus_register as __maybe_unused
    reiserfs: avoid a -Wmaybe-uninitialized warning
    ALSA: hda/ca0132 - fix possible NULL pointer use
  * arm64: Kconfig: select COMPAT_BINFMT_ELF only when BINFMT_ELF is set
      arch/arm64/Kconfig
    scsi: advansys: fix uninitialized data access
    x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG
    x86: add MULTIUSER dependency for KVM
  * thermal: fix INTEL_SOC_DTS_IOSF_CORE dependencies
      drivers/thermal/Kconfig
    x86/build: Silence the build with "make -s"
  * tools build: Add tools tree support for 'make -s'
      Makefile
    x86/fpu/math-emu: Fix possible uninitialized variable use
  * arm64: define BUG() instruction without CONFIG_BUG
      arch/arm64/include/asm/bug.h
    x86/ras/inject: Make it depend on X86_LOCAL_APIC=y
    scsi: advansys: fix build warning for PCI=n
    video: fbdev: via: remove possibly unused variables
    platform/x86: intel_mid_thermal: Fix suspend handlers unused warning
    gpio: intel-mid: Fix build warning when !CONFIG_PM
  * vmxnet3: prevent building with 64K pages
      drivers/net/Kconfig
    isdn: icn: remove a #warning
  * virtio_balloon: prevent uninitialized variable use
      drivers/virtio/virtio_balloon.c
    hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close
  * xen: XEN_ACPI_PROCESSOR is Dom0-only
      drivers/xen/Kconfig
    x86/mm/kmmio: Fix mmiotrace for page unaligned addresses
  * mm/early_ioremap: Fix boot hang with earlyprintk=efi,keep
      mm/early_ioremap.c
    dmaengine: jz4740: disable/unprepare clk if probe fails
    drm/armada: fix leak of crtc structure
  * xfrm: Fix stack-out-of-bounds with misconfigured transport mode policies.
      net/xfrm/xfrm_user.c
    spi: sun4i: disable clocks in the remove function
    ASoC: rockchip: disable clock on error
    clk: fix a panic error caused by accessing NULL pointer
    dmaengine: at_hdmac: fix potential NULL pointer dereference in atc_prep_dma_interleaved
    dmaengine: ioat: Fix error handling path
  * 509: fix printing uninitialized stack memory when OID is empty
      lib/oid_registry.c
  * btrfs: Fix possible off-by-one in btrfs_search_path_in_tree
      fs/btrfs/ioctl.c
  * net_sched: red: Avoid illegal values
      net/sched/sch_sfq.c
    net_sched: red: Avoid devision by zero
    gianfar: fix a flooded alignment reports because of padding issue.
    s390/dasd: prevent prefix I/O error
    powerpc/perf: Fix oops when grouping different pmu events
    ipvlan: Add the skb->mark as flow4's member to lookup route
    scripts/kernel-doc: Don't fail with status != 0 if error encountered with -none
    RDMA/cma: Make sure that PSN is not over max allowed
    pinctrl: sunxi: Fix A80 interrupt pin bank
    media: s5k6aa: describe some function parameters
  * perf bench numa: Fixup discontiguous/sparse numa nodes
      tools/perf/bench/numa.c
  * perf top: Fix window dimensions change handling
      tools/perf/builtin-top.c
    ARM: dts: am4372: Correct the interrupts_properties of McASP
    ARM: dts: Fix omap4 hang with GPS connected to USB by using wakeupgen
    ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function
    ARM: OMAP2+: Fix SRAM virt to phys translation for save_secure_ram_context
  * usb: build drivers/usb/common/ when USB_SUPPORT is set
      drivers/Makefile
  * usbip: keep usbip_device sockfd state in sync with tcp_socket
      drivers/usb/usbip/stub_dev.c
      drivers/usb/usbip/vhci_hcd.c
    staging: iio: adc: ad7192: fix external frequency setting
  * binder: check for binder_thread allocation failure in binder_poll()
      drivers/android/binder.c
  * staging: android: ashmem: Fix a race condition in pin ioctls
      drivers/staging/android/ashmem.c
    dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock
  * Make DST_CACHE a silent config option
      net/Kconfig
    arm64: dts: add #cooling-cells to CPU nodes
    video: fbdev/mmp: add MODULE_LICENSE
    ASoC: ux500: add MODULE_LICENSE tag
  * net: avoid skb_warn_bad_offload on IS_ERR
      net/core/dev.c
    netfilter: xt_RATEEST: acquire xt_rateest_mutex for hash insert
  * netfilter: on sockopt() acquire sock lock only in the required scope
      net/ipv4/ip_sockglue.c
      net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
      net/ipv6/ipv6_sockglue.c
      net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
    netfilter: ipt_CLUSTERIP: fix out-of-bounds accesses in clusterip_tg_check()
  * netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_{match|target}
      net/netfilter/x_tables.c
  * netfilter: x_tables: fix int overflow in xt_alloc_table_info()
      net/netfilter/x_tables.c
    KVM: x86: fix escape of guest dr6 to the host
    crypto: x86/twofish-3way - Fix %rbp usage
  * selinux: skip bounded transition processing if the policy isn't loaded
      security/selinux/ss/services.c
  * selinux: ensure the context is NUL terminated in security_context_to_sid_core()
      security/selinux/ss/services.c
  * Provide a function to create a NUL-terminated string from unterminated data
      include/linux/string.h
      mm/util.c
    drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all
  * blktrace: fix unlocked registration of tracepoints
      kernel/trace/blktrace.c
  * xfrm: check id proto in validate_tmpl()
      net/xfrm/xfrm_user.c
  * xfrm: Fix stack-out-of-bounds read on socket policy lookup.
      net/xfrm/xfrm_policy.c
  * mm,vmscan: Make unregister_shrinker() no-op if register_shrinker() failed.
      mm/vmscan.c
  * cfg80211: check dev_set_name() return value
      net/wireless/core.c
  * net: replace dst_cache ip6_tunnel implementation with the generic one
      include/net/ip6_tunnel.h
      net/ipv6/Kconfig
      net/ipv6/ip6_gre.c
      net/ipv6/ip6_tunnel.c
      net/ipv6/ip6_vti.c
  * net: add dst_cache support
      net/Kconfig
      net/core/Makefile

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2018-05-09 08:52:33 -07:00
Greg Kroah-Hartman
5f7f76a551 Merge 4.4.118 into android-4.4
Changes in 4.4.118
	net: add dst_cache support
	net: replace dst_cache ip6_tunnel implementation with the generic one
	cfg80211: check dev_set_name() return value
	mm,vmscan: Make unregister_shrinker() no-op if register_shrinker() failed.
	xfrm: Fix stack-out-of-bounds read on socket policy lookup.
	xfrm: check id proto in validate_tmpl()
	blktrace: fix unlocked registration of tracepoints
	drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all
	Provide a function to create a NUL-terminated string from unterminated data
	selinux: ensure the context is NUL terminated in security_context_to_sid_core()
	selinux: skip bounded transition processing if the policy isn't loaded
	crypto: x86/twofish-3way - Fix %rbp usage
	KVM: x86: fix escape of guest dr6 to the host
	netfilter: x_tables: fix int overflow in xt_alloc_table_info()
	netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_{match|target}
	netfilter: ipt_CLUSTERIP: fix out-of-bounds accesses in clusterip_tg_check()
	netfilter: on sockopt() acquire sock lock only in the required scope
	netfilter: xt_RATEEST: acquire xt_rateest_mutex for hash insert
	net: avoid skb_warn_bad_offload on IS_ERR
	ASoC: ux500: add MODULE_LICENSE tag
	video: fbdev/mmp: add MODULE_LICENSE
	arm64: dts: add #cooling-cells to CPU nodes
	Make DST_CACHE a silent config option
	dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock
	staging: android: ashmem: Fix a race condition in pin ioctls
	binder: check for binder_thread allocation failure in binder_poll()
	staging: iio: adc: ad7192: fix external frequency setting
	usbip: keep usbip_device sockfd state in sync with tcp_socket
	usb: build drivers/usb/common/ when USB_SUPPORT is set
	ARM: OMAP2+: Fix SRAM virt to phys translation for save_secure_ram_context
	ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function
	ARM: dts: Fix omap4 hang with GPS connected to USB by using wakeupgen
	ARM: dts: am4372: Correct the interrupts_properties of McASP
	perf top: Fix window dimensions change handling
	perf bench numa: Fixup discontiguous/sparse numa nodes
	media: s5k6aa: describe some function parameters
	pinctrl: sunxi: Fix A80 interrupt pin bank
	RDMA/cma: Make sure that PSN is not over max allowed
	scripts/kernel-doc: Don't fail with status != 0 if error encountered with -none
	ipvlan: Add the skb->mark as flow4's member to lookup route
	powerpc/perf: Fix oops when grouping different pmu events
	s390/dasd: prevent prefix I/O error
	gianfar: fix a flooded alignment reports because of padding issue.
	net_sched: red: Avoid devision by zero
	net_sched: red: Avoid illegal values
	btrfs: Fix possible off-by-one in btrfs_search_path_in_tree
	509: fix printing uninitialized stack memory when OID is empty
	dmaengine: ioat: Fix error handling path
	dmaengine: at_hdmac: fix potential NULL pointer dereference in atc_prep_dma_interleaved
	clk: fix a panic error caused by accessing NULL pointer
	ASoC: rockchip: disable clock on error
	spi: sun4i: disable clocks in the remove function
	xfrm: Fix stack-out-of-bounds with misconfigured transport mode policies.
	drm/armada: fix leak of crtc structure
	dmaengine: jz4740: disable/unprepare clk if probe fails
	mm/early_ioremap: Fix boot hang with earlyprintk=efi,keep
	x86/mm/kmmio: Fix mmiotrace for page unaligned addresses
	xen: XEN_ACPI_PROCESSOR is Dom0-only
	hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close
	virtio_balloon: prevent uninitialized variable use
	isdn: icn: remove a #warning
	vmxnet3: prevent building with 64K pages
	gpio: intel-mid: Fix build warning when !CONFIG_PM
	platform/x86: intel_mid_thermal: Fix suspend handlers unused warning
	video: fbdev: via: remove possibly unused variables
	scsi: advansys: fix build warning for PCI=n
	x86/ras/inject: Make it depend on X86_LOCAL_APIC=y
	arm64: define BUG() instruction without CONFIG_BUG
	x86/fpu/math-emu: Fix possible uninitialized variable use
	tools build: Add tools tree support for 'make -s'
	x86/build: Silence the build with "make -s"
	thermal: fix INTEL_SOC_DTS_IOSF_CORE dependencies
	x86: add MULTIUSER dependency for KVM
	x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG
	scsi: advansys: fix uninitialized data access
	arm64: Kconfig: select COMPAT_BINFMT_ELF only when BINFMT_ELF is set
	ALSA: hda/ca0132 - fix possible NULL pointer use
	reiserfs: avoid a -Wmaybe-uninitialized warning
	ssb: mark ssb_bus_register as __maybe_unused
	thermal: spear: use __maybe_unused for PM functions
	x86/boot: Avoid warning for zero-filling .bss
	scsi: sim710: fix build warning
	drivers/net: fix eisa_driver probe section mismatch
	dpt_i2o: fix build warning
	profile: hide unused functions when !CONFIG_PROC_FS
	md: avoid warning for 32-bit sector_t
	mtd: ichxrom: maybe-uninitialized with gcc-4.9
	mtd: maps: add __init attribute
	mptfusion: hide unused seq_mpt_print_ioc_summary function
	scsi: fdomain: drop fdomain_pci_tbl when built-in
	video: fbdev: sis: remove unused variable
	staging: ste_rmi4: avoid unused function warnings
	fbdev: sis: enforce selection of at least one backend
	video: Use bool instead int pointer for get_opt_bool() argument
	scsi: mvumi: use __maybe_unused to hide pm functions
	SCSI: initio: remove duplicate module device table
	pwc: hide unused label
	usb: musb/ux500: remove duplicate check for dma_is_compatible
	tty: hvc_xen: hide xen_console_remove when unused
	target/user: Fix cast from pointer to phys_addr_t
	driver-core: use 'dev' argument in dev_dbg_ratelimited stub
	fbdev: auo_k190x: avoid unused function warnings
	amd-xgbe: Fix unused suspend handlers build warning
	mtd: sh_flctl: pass FIFO as physical address
	mtd: cfi: enforce valid geometry configuration
	fbdev: s6e8ax0: avoid unused function warnings
	modsign: hide openssl output in silent builds
	Drivers: hv: vmbus: fix build warning
	fbdev: sm712fb: avoid unused function warnings
	hwrng: exynos - use __maybe_unused to hide pm functions
	USB: cdc_subset: only build when one driver is enabled
	rtlwifi: fix gcc-6 indentation warning
	staging: wilc1000: fix kbuild test robot error
	x86/platform/olpc: Fix resume handler build warning
	netfilter: ipvs: avoid unused variable warnings
	ipv4: ipconfig: avoid unused ic_proto_used symbol
	tc1100-wmi: fix build warning when CONFIG_PM not enabled
	tlan: avoid unused label with PCI=n
	drm/vmwgfx: use *_32_bits() macros
	tty: cyclades: cyz_interrupt is only used for PCI
	genirq/msi: Add stubs for get_cached_msi_msg/pci_write_msi_msg
	ASoC: mediatek: add i2c dependency
	iio: adc: axp288: remove redundant duplicate const on axp288_adc_channels
	infiniband: cxgb4: use %pR format string for printing resources
	b2c2: flexcop: avoid unused function warnings
	i2c: remove __init from i2c_register_board_info()
	staging: unisys: visorinput depends on INPUT
	tc358743: fix register i2c_rd/wr functions
	drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized
	Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning
	KVM: add X86_LOCAL_APIC dependency
	go7007: add MEDIA_CAMERA_SUPPORT dependency
	em28xx: only use mt9v011 if camera support is enabled
	ISDN: eicon: reduce stack size of sig_ind function
	ASoC: rockchip: use __maybe_unused to hide st_irq_syscfg_resume
	serial: 8250_mid: fix broken DMA dependency
	drm/gma500: Sanity-check pipe index
	hdpvr: hide unused variable
	v4l: remove MEDIA_TUNER dependency for VIDEO_TUNER
	cw1200: fix bogus maybe-uninitialized warning
	wireless: cw1200: use __maybe_unused to hide pm functions_
	perf/x86: Shut up false-positive -Wmaybe-uninitialized warning
	dmaengine: zx: fix build warning
	net: hp100: remove unnecessary #ifdefs
	gpio: xgene: mark PM functions as __maybe_unused
	ncpfs: fix unused variable warning
	Revert "power: bq27xxx_battery: Remove unneeded dependency in Kconfig"
	power: bq27xxx_battery: mark some symbols __maybe_unused
	isdn: sc: work around type mismatch warning
	binfmt_elf: compat: avoid unused function warning
	idle: i7300: add PCI dependency
	usb: phy: msm add regulator dependency
	ncr5380: shut up gcc indentation warning
	ARM: tegra: select USB_ULPI from EHCI rather than platform
	ASoC: Intel: Kconfig: fix build when ACPI is not enabled
	netlink: fix nla_put_{u8,u16,u32} for KASAN
	dell-wmi, dell-laptop: depends DMI
	genksyms: Fix segfault with invalid declarations
	x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug
	drm/gma500: remove helper function
	kasan: rework Kconfig settings
	KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously
	x86/retpoline: Remove the esp/rsp thunk
	KVM: x86: Make indirect calls in emulator speculation safe
	KVM: VMX: Make indirect call speculation safe
	module/retpoline: Warn about missing retpoline in module
	x86/nospec: Fix header guards names
	x86/bugs: Drop one "mitigation" from dmesg
	x86/cpu/bugs: Make retpoline module warning conditional
	x86/spectre: Check CONFIG_RETPOLINE in command line parser
	Documentation: Document array_index_nospec
	array_index_nospec: Sanitize speculative array de-references
	x86: Implement array_index_mask_nospec
	x86: Introduce barrier_nospec
	x86/get_user: Use pointer masking to limit speculation
	x86/syscall: Sanitize syscall table de-references under speculation
	vfs, fdtable: Prevent bounds-check bypass via speculative execution
	nl80211: Sanitize array index in parse_txq_params
	x86/spectre: Report get_user mitigation for spectre_v1
	x86/spectre: Fix spelling mistake: "vunerable"-> "vulnerable"
	x86/paravirt: Remove 'noreplace-paravirt' cmdline option
	x86/kvm: Update spectre-v1 mitigation
	x86/retpoline: Avoid retpolines for built-in __init functions
	x86/spectre: Simplify spectre_v2 command line parsing
	x86/speculation: Fix typo IBRS_ATT, which should be IBRS_ALL
	KVM: nVMX: kmap() can't fail
	KVM: nVMX: vmx_complete_nested_posted_interrupt() can't fail
	kvm: nVMX: Fix kernel panics induced by illegal INVEPT/INVVPID types
	KVM: VMX: clean up declaration of VPID/EPT invalidation types
	KVM: nVMX: invvpid handling improvements
	crypto: s5p-sss - Fix kernel Oops in AES-ECB mode
	net: dst_cache_per_cpu_dst_set() can be static
	Linux 4.4.118

Change-Id: I01c76e1c15a611e13a1e98092bc5c01cdb5b6adb
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2018-02-26 09:24:57 +01:00
Arnd Bergmann
0ffa39fb59 kasan: rework Kconfig settings
commit e7c52b84fb18f08ce49b6067ae6285aca79084a8 upstream.

We get a lot of very large stack frames using gcc-7.0.1 with the default
-fsanitize-address-use-after-scope --param asan-stack=1 options, which can
easily cause an overflow of the kernel stack, e.g.

  drivers/gpu/drm/i915/gvt/handlers.c:2434:1: warning: the frame size of 46176 bytes is larger than 3072 bytes
  drivers/net/wireless/ralink/rt2x00/rt2800lib.c:5650:1: warning: the frame size of 23632 bytes is larger than 3072 bytes
  lib/atomic64_test.c:250:1: warning: the frame size of 11200 bytes is larger than 3072 bytes
  drivers/gpu/drm/i915/gvt/handlers.c:2621:1: warning: the frame size of 9208 bytes is larger than 3072 bytes
  drivers/media/dvb-frontends/stv090x.c:3431:1: warning: the frame size of 6816 bytes is larger than 3072 bytes
  fs/fscache/stats.c:287:1: warning: the frame size of 6536 bytes is larger than 3072 bytes

To reduce this risk, -fsanitize-address-use-after-scope is now split out
into a separate CONFIG_KASAN_EXTRA Kconfig option, leading to stack
frames that are smaller than 2 kilobytes most of the time on x86_64.  An
earlier version of this patch also prevented combining KASAN_EXTRA with
KASAN_INLINE, but that is no longer necessary with gcc-7.0.1.

All patches to get the frame size below 2048 bytes with CONFIG_KASAN=y
and CONFIG_KASAN_EXTRA=n have been merged by maintainers now, so we can
bring back that default now.  KASAN_EXTRA=y still causes lots of
warnings but now defaults to !COMPILE_TEST to disable it in
allmodconfig, and it remains disabled in all other defconfigs since it
is a new option.  I arbitrarily raise the warning limit for KASAN_EXTRA
to 3072 to reduce the noise, but an allmodconfig kernel still has around
50 warnings on gcc-7.

I experimented a bit more with smaller stack frames and have another
follow-up series that reduces the warning limit for 64-bit architectures
to 1280 bytes (without CONFIG_KASAN).

With earlier versions of this patch series, I also had patches to address
the warnings we get with KASAN and/or KASAN_EXTRA, using a
"noinline_if_stackbloat" annotation.

That annotation now got replaced with a gcc-8 bugfix (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715) and a workaround for
older compilers, which means that KASAN_EXTRA is now just as bad as
before and will lead to an instant stack overflow in a few extreme
cases.

This reverts parts of commit 3f181b4d86 ("lib/Kconfig.debug: disable
-Wframe-larger-than warnings with KASAN=y").  Two patches in linux-next
should be merged first to avoid introducing warnings in an allmodconfig
build:
  3cd890dbe2a4 ("media: dvb-frontends: fix i2c access helpers for KASAN")
  16c3ada89cff ("media: r820t: fix r820t_write_reg for KASAN")

Do we really need to backport this?

I think we do: without this patch, enabling KASAN will lead to
unavoidable kernel stack overflow in certain device drivers when built
with gcc-7 or higher on linux-4.10+ or any version that contains a
backport of commit c5caf21ab0cf8.  Most people are probably still on
older compilers, but it will get worse over time as they upgrade their
distros.

The warnings we get on kernels older than this should all be for code
that uses dangerously large stack frames, though most of them do not
cause an actual stack overflow by themselves.The asan-stack option was
added in linux-4.0, and commit 3f181b4d86 ("lib/Kconfig.debug:
disable -Wframe-larger-than warnings with KASAN=y") effectively turned
off the warning for allmodconfig kernels, so I would like to see this
fix backported to any kernels later than 4.0.

I have done dozens of fixes for individual functions with stack frames
larger than 2048 bytes with asan-stack, and I plan to make sure that
all those fixes make it into the stable kernels as well (most are
already there).

Part of the complication here is that asan-stack (from 4.0) was
originally assumed to always require much larger stacks, but that
turned out to be a combination of multiple gcc bugs that we have now
worked around and fixed, but sanitize-address-use-after-scope (from
v4.10) has a much higher inherent stack usage and also suffers from at
least three other problems that we have analyzed but not yet fixed
upstream, each of them makes the stack usage more severe than it should
be.

Link: http://lkml.kernel.org/r/20171221134744.2295529-1-arnd@arndb.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[arnd: rebase to v4.4; only re-enable warning]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25 11:03:52 +01:00
Dmitry Vyukov
9b83f370dc BACKPORT: kernel: add kcov code coverage
kcov provides code coverage collection for coverage-guided fuzzing
(randomized testing).  Coverage-guided fuzzing is a testing technique
that uses coverage feedback to determine new interesting inputs to a
system.  A notable user-space example is AFL
(http://lcamtuf.coredump.cx/afl/).  However, this technique is not
widely used for kernel testing due to missing compiler and kernel
support.

kcov does not aim to collect as much coverage as possible.  It aims to
collect more or less stable coverage that is function of syscall inputs.
To achieve this goal it does not collect coverage in soft/hard
interrupts and instrumentation of some inherently non-deterministic or
non-interesting parts of kernel is disbled (e.g.  scheduler, locking).

Currently there is a single coverage collection mode (tracing), but the
API anticipates additional collection modes.  Initially I also
implemented a second mode which exposes coverage in a fixed-size hash
table of counters (what Quentin used in his original patch).  I've
dropped the second mode for simplicity.

This patch adds the necessary support on kernel side.  The complimentary
compiler support was added in gcc revision 231296.

We've used this support to build syzkaller system call fuzzer, which has
found 90 kernel bugs in just 2 months:

  https://github.com/google/syzkaller/wiki/Found-Bugs

We've also found 30+ bugs in our internal systems with syzkaller.
Another (yet unexplored) direction where kcov coverage would greatly
help is more traditional "blob mutation".  For example, mounting a
random blob as a filesystem, or receiving a random blob over wire.

Why not gcov.  Typical fuzzing loop looks as follows: (1) reset
coverage, (2) execute a bit of code, (3) collect coverage, repeat.  A
typical coverage can be just a dozen of basic blocks (e.g.  an invalid
input).  In such context gcov becomes prohibitively expensive as
reset/collect coverage steps depend on total number of basic
blocks/edges in program (in case of kernel it is about 2M).  Cost of
kcov depends only on number of executed basic blocks/edges.  On top of
that, kernel requires per-thread coverage because there are always
background threads and unrelated processes that also produce coverage.
With inlined gcov instrumentation per-thread coverage is not possible.

kcov exposes kernel PCs and control flow to user-space which is
insecure.  But debugfs should not be mapped as user accessible.

Based on a patch by Quentin Casasnovas.

[akpm@linux-foundation.org: make task_struct.kcov_mode have type `enum kcov_mode']
[akpm@linux-foundation.org: unbreak allmodconfig]
[akpm@linux-foundation.org: follow x86 Makefile layout standards]
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: syzkaller <syzkaller@googlegroups.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Tavis Ormandy <taviso@google.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Kostya Serebryany <kcc@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Kees Cook <keescook@google.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: David Drysdale <drysdale@google.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Bug: 64145065
(cherry-picked from 5c9a8750a6409c63a0f01d51a9024861022f6593)
Change-Id: I17b5e04f6e89b241924e78ec32ead79c38b860ce
Signed-off-by: Paul Lawrence <paullawrence@google.com>
2017-12-18 09:41:57 -08:00
Thierry Strudel
a73c81554f Merged linux-4.4.88 into android-msm-wahoo-4.4
Linux 4.4.88
    xfs: XFS_IS_REALTIME_INODE() should be false if no rt device present
    NFS: Fix 2 use after free issues in the I/O code
    ARM: 8692/1: mm: abort uaccess retries upon fatal signal
    Bluetooth: Properly check L2CAP config option output buffer length
    ALSA: msnd: Optimize / harden DSP and MIDI loops
    locktorture: Fix potential memory leak with rw lock test
    btrfs: resume qgroup rescan on rw remount
    drm/bridge: adv7511: Re-write the i2c address before EDID probing
    drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event()
    drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq context
    drm/bridge: adv7511: Fix mutex deadlock when interrupts are disabled
    drm: adv7511: really enable interrupts for EDID detection
    scsi: sg: recheck MMAP_IO request length with lock held
    scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE
    cs5536: add support for IDE controller variant
    workqueue: Fix flag collision
    drm/nouveau/pci/msi: disable MSI on big-endian platforms by default
    mwifiex: correct channel stat buffer overflows
    dlm: avoid double-free on error path in dlm_device_{register,unregister}
    Bluetooth: Add support of 13d3:3494 RTL8723BE device
    rtlwifi: rtl_pci_probe: Fix fail path of _rtl_pci_find_adapter
    Input: trackpoint - assume 3 buttons when buttons detection fails
    ath10k: fix memory leak in rx ring buffer allocation
    intel_th: pci: Add Cannon Lake PCH-LP support
    intel_th: pci: Add Cannon Lake PCH-H support
    driver core: bus: Fix a potential double free
    staging/rts5208: fix incorrect shift to extract upper nybble
    USB: core: Avoid race of async_completed() w/ usbdev_release()
    usb:xhci:Fix regression when ATI chipsets detected
    usb: Add device quirk for Logitech HD Pro Webcam C920-C
    USB: serial: option: add support for D-Link DWM-157 C1
    usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard
Linux 4.4.87
    crypto: algif_skcipher - only call put_page on referenced and used pages
    epoll: fix race between ep_poll_callback(POLLFREE) and ep_free()/ep_remove()
    kvm: arm/arm64: Force reading uncached stage2 PGD
    kvm: arm/arm64: Fix race in resetting stage2 PGD
    drm/ttm: Fix accounting error when fail to get pages for pool
    xfrm: policy: check policy direction value
    wl1251: add a missing spin_lock_init()
    CIFS: remove endian related sparse warning
    CIFS: Fix maximum SMB2 header size
    alpha: uapi: Add support for __SANE_USERSPACE_TYPES__
    cpuset: Fix incorrect memory_pressure control file mapping
    cpumask: fix spurious cpumask_of_node() on non-NUMA multi-node configs
    ceph: fix readpage from fscache
    i2c: ismt: Return EMSGSIZE for block reads with bogus length
    i2c: ismt: Don't duplicate the receive length for block reads
    irqchip: mips-gic: SYNC after enabling GIC region
Linux 4.4.86
    drm/i915: fix compiler warning in drivers/gpu/drm/i915/intel_uncore.c
    scsi: sg: reset 'res_in_use' after unlinking reserved array
    scsi: sg: protect accesses to 'reserved' page array
    arm64: fpsimd: Prevent registers leaking across exec
    x86/io: Add "memory" clobber to insb/insw/insl/outsb/outsw/outsl
    arm64: mm: abort uaccess retries upon fatal signal
    lpfc: Fix Device discovery failures during switch reboot test.
    p54: memset(0) whole array
    lightnvm: initialize ppa_addr in dev_to_generic_addr()
    gcov: support GCC 7.1
    gcov: add support for gcc version >= 6
    i2c: jz4780: drop superfluous init
    btrfs: remove duplicate const specifier
    ALSA: au88x0: Fix zero clear of stream->resources
    scsi: isci: avoid array subscript warning
Linux 4.4.85
    ACPI / APEI: Add missing synchronize_rcu() on NOTIFY_SCI removal
    ACPI: ioapic: Clear on-stack resource before using it
    ntb_transport: fix bug calculating num_qps_mw
    ntb_transport: fix qp count bug
    ASoC: rsnd: don't call update callback if it was NULL
    ASoC: rsnd: ssi: 24bit data needs right-aligned settings
    ASoC: rsnd: Add missing initialization of ADG req_rate
    ASoC: rsnd: avoid pointless loop in rsnd_mod_interrupt()
    ASoC: rsnd: disable SRC.out only when stop timing
    ASoC: simple-card: don't fail if sysclk setting is not supported
    staging: rtl8188eu: add RNX-N150NUB support
    iio: hid-sensor-trigger: Fix the race with user space powering up sensors
    iio: imu: adis16480: Fix acceleration scale factor for adis16480
    ANDROID: binder: fix proc->tsk check.
    binder: Use wake up hint for synchronous transactions.
    binder: use group leader instead of open thread
    Bluetooth: bnep: fix possible might sleep error in bnep_session
    Bluetooth: cmtp: fix possible might sleep error in cmtp_session
    Bluetooth: hidp: fix possible might sleep error in hidp_session_thread
    perf/core: Fix group {cpu,task} validation
    nfsd: Limit end of page list when decoding NFSv4 WRITE
    cifs: return ENAMETOOLONG for overlong names in cifs_open()/cifs_lookup()
    cifs: Fix df output for users with quota limits
    tracing: Fix freeing of filter in create_filter() when set_str is false
    drm: rcar-du: Fix H/V sync signal polarity configuration
    drm: rcar-du: Fix display timing controller parameter
    drm: rcar-du: Fix crash in encoder failure error path
    drm: rcar-du: lvds: Rename PLLEN bit to PLLON
    drm: rcar-du: lvds: Fix PLL frequency-related configuration
    drm/atomic: If the atomic check fails, return its value first
    drm: Release driver tracking before making the object available again
    i2c: designware: Fix system suspend
    ARCv2: PAE40: Explicitly set MSB counterpart of SLC region ops addresses
    ALSA: hda - Add stereo mic quirk for Lenovo G50-70 (17aa:3978)
    ALSA: core: Fix unexpected error at replacing user TLV
    Input: elan_i2c - add ELAN0602 ACPI ID to support Lenovo Yoga310
    Input: trackpoint - add new trackpoint firmware ID
    mei: me: add lewisburg device ids
    mei: me: add broxton pci device ids
    net_sched: fix order of queue length updates in qdisc_replace()
    net: sched: fix NULL pointer dereference when action calls some targets
    irda: do not leak initialized list.dev to userspace
    tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP
    ipv6: repair fib6 tree in failure case
    ipv6: reset fn->rr_ptr when replacing route
    tipc: fix use-after-free
    sctp: fully initialize the IPv6 address in sctp_v6_to_addr()
    ipv4: better IP_MAX_MTU enforcement
    net_sched/sfq: update hierarchical backlog when drop packet
    ipv4: fix NULL dereference in free_fib_info_rcu()
    dccp: defer ccid_hc_tx_delete() at dismantle time
    dccp: purge write queue in dccp_destroy_sock()
    af_key: do not use GFP_KERNEL in atomic contexts
Linux 4.4.84
    usb: qmi_wwan: add D-Link DWM-222 device ID
    usb: optimize acpi companion search for usb port devices
    perf/x86: Fix LBR related crashes on Intel Atom
    pids: make task_tgid_nr_ns() safe
    Sanitize 'move_pages()' permission checks
    irqchip/atmel-aic: Fix unbalanced refcount in aic_common_rtc_irq_fixup()
    irqchip/atmel-aic: Fix unbalanced of_node_put() in aic_common_irq_fixup()
    x86/asm/64: Clear AC on NMI entries
    xen: fix bio vec merging
    mm: revert x86_64 and arm64 ELF_ET_DYN_BASE base changes
    mm/mempolicy: fix use after free when calling get_mempolicy
    ALSA: usb-audio: Add mute TLV for playback volumes on C-Media devices
    ALSA: usb-audio: Apply sample rate quirk to Sennheiser headset
    ALSA: seq: 2nd attempt at fixing race creating a queue
    Input: elan_i2c - Add antoher Lenovo ACPI ID for upcoming Lenovo NB
    Input: elan_i2c - add ELAN0608 to the ACPI table
    crypto: x86/sha1 - Fix reads beyond the number of blocks passed
    parisc: pci memory bar assignment fails with 64bit kernels on dino/cujo
    audit: Fix use after free in audit_remove_watch_rule()
    netfilter: nf_ct_ext: fix possible panic after nf_ct_extend_unregister
Linux 4.4.83
    pinctrl: samsung: Remove bogus irq_[un]mask from resource management
    pinctrl: sunxi: add a missing function of A10/A20 pinctrl driver
    pnfs/blocklayout: require 64-bit sector_t
    iio: adc: vf610_adc: Fix VALT selection value for REFSEL bits
    usb:xhci:Add quirk for Certain failing HP keyboard on reset after resume
    usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter
    usb: core: unlink urbs from the tail of the endpoint's urb_list
    USB: Check for dropped connection before switching to full speed
    uas: Add US_FL_IGNORE_RESIDUE for Initio Corporation INIC-3069
    iio: light: tsl2563: use correct event code
    iio: accel: bmc150: Always restore device to normal mode after suspend-resume
    staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read
    USB: hcd: Mark secondary HCD as dead if the primary one died
    usb: musb: fix tx fifo flush handling again
    USB: serial: pl2303: add new ATEN device id
    USB: serial: cp210x: add support for Qivicon USB ZigBee dongle
    USB: serial: option: add D-Link DWM-222 device ID
    nfs/flexfiles: fix leak of nfs4_ff_ds_version arrays
    fuse: initialize the flock flag in fuse_file on allocation
    iscsi-target: Fix iscsi_np reset hung task during parallel delete
    iscsi-target: fix memory leak in iscsit_setup_text_cmd()
    mm: ratelimit PFNs busy info message
    cpuset: fix a deadlock due to incomplete patching of cpusets_enabled()
Linux 4.4.82
    net: account for current skb length when deciding about UFO
    ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output
    mm/mempool: avoid KASAN marking mempool poison checks as use-after-free
    KVM: arm/arm64: Handle hva aging while destroying the vm
    sparc64: Prevent perf from running during super critical sections
    udp: consistently apply ufo or fragmentation
    revert "ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output"
    revert "net: account for current skb length when deciding about UFO"
    packet: fix tp_reserve race in packet_set_ring
    net: avoid skb_warn_bad_offload false positives on UFO
    tcp: fastopen: tcp_connect() must refresh the route
    net: sched: set xt_tgchk_param par.nft_compat as 0 in ipt_init_target
    bpf, s390: fix jit branch offset related to ldimm64
    net: fix keepalive code vs TCP_FASTOPEN_CONNECT
    tcp: avoid setting cwnd to invalid ssthresh after cwnd reduction states
Linux 4.4.81
    workqueue: implicit ordered attribute should be overridable
    net: account for current skb length when deciding about UFO
    ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output
    mm: don't dereference struct page fields of invalid pages
    signal: protect SIGNAL_UNKILLABLE from unintentional clearing.
    lib/Kconfig.debug: fix frv build failure
    mm, slab: make sure that KMALLOC_MAX_SIZE will fit into MAX_ORDER
    ARM: 8632/1: ftrace: fix syscall name matching
    virtio_blk: fix panic in initialization error path
    drm/virtio: fix framebuffer sparse warning
    scsi: qla2xxx: Get mutex lock before checking optrom_state
    phy state machine: failsafe leave invalid RUNNING state
    x86/boot: Add missing declaration of string functions
    tg3: Fix race condition in tg3_get_stats64().
    net: phy: dp83867: fix irq generation
    sh_eth: R8A7740 supports packet shecksumming
    wext: handle NULL extra data in iwe_stream_add_point better
    sparc64: Measure receiver forward progress to avoid send mondo timeout
    xen-netback: correctly schedule rate-limited queues
    net: phy: Fix PHY unbind crash
    net: phy: Correctly process PHY_HALTED in phy_stop_machine()
    net/mlx5: Fix command bad flow on command entry allocation failure
    sctp: fix the check for _sctp_walk_params and _sctp_walk_errors
    sctp: don't dereference ptr before leaving _sctp_walk_{params, errors}()
    dccp: fix a memleak for dccp_feat_init err process
    dccp: fix a memleak that dccp_ipv4 doesn't put reqsk properly
    dccp: fix a memleak that dccp_ipv6 doesn't put reqsk properly
    net: ethernet: nb8800: Handle all 4 RGMII modes identically
    ipv6: Don't increase IPSTATS_MIB_FRAGFAILS twice in ip6_fragment()
    packet: fix use-after-free in prb_retire_rx_blk_timer_expired()
    openvswitch: fix potential out of bound access in parse_ct
    mcs7780: Fix initialization when CONFIG_VMAP_STACK is enabled
    rtnetlink: allocate more memory for dev_set_mac_address()
    ipv4: initialize fib_trie prior to register_netdev_notifier call.
    ipv6: avoid overflow of offset in ip6_find_1stfragopt
    net: Zero terminate ifr_name in dev_ifname().
    ipv4: ipv6: initialize treq->txhash in cookie_v[46]_check()
    saa7164: fix double fetch PCIe access condition
    drm: rcar-du: fix backport bug
    f2fs: sanity check checkpoint segno and blkoff
    media: lirc: LIRC_GET_REC_RESOLUTION should return microseconds
    mm, mprotect: flush TLB if potentially racing with a parallel reclaim leaving stale TLB entries
    iser-target: Avoid isert_conn->cm_id dereference in isert_login_recv_done
    iscsi-target: Fix delayed logout processing greater than SECONDS_FOR_LOGOUT_COMP
    iscsi-target: Fix initial login PDU asynchronous socket close OOPs
    iscsi-target: Fix early sk_data_ready LOGIN_FLAGS_READY race
    iscsi-target: Always wait for kthread_should_stop() before kthread exit
    target: Avoid mappedlun symlink creation during lun shutdown
    media: platform: davinci: return -EINVAL for VPFE_CMD_S_CCDC_RAW_PARAMS ioctl
    ARM: dts: armada-38x: Fix irq type for pca955
    ext4: fix overflow caused by missing cast in ext4_resize_fs()
    ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize
    mm/page_alloc: Remove kernel address exposure in free_reserved_area()
    KVM: async_pf: make rcu irq exit if not triggered from idle task
    ASoC: do not close shared backend dailink
    ALSA: hda - Fix speaker output from VAIO VPCL14M1R
    workqueue: restore WQ_UNBOUND/max_active==1 to be ordered
    libata: array underflow in ata_find_dev()

Bug: 62730977
Change-Id: I08905b35c8abf614055051b789f2114c2157dab9
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-09-21 13:31:24 -07:00
Greg Kroah-Hartman
dfff30bca9 Merge 4.4.81 into android-4.4
Changes in 4.4.81
	libata: array underflow in ata_find_dev()
	workqueue: restore WQ_UNBOUND/max_active==1 to be ordered
	ALSA: hda - Fix speaker output from VAIO VPCL14M1R
	ASoC: do not close shared backend dailink
	KVM: async_pf: make rcu irq exit if not triggered from idle task
	mm/page_alloc: Remove kernel address exposure in free_reserved_area()
	ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize
	ext4: fix overflow caused by missing cast in ext4_resize_fs()
	ARM: dts: armada-38x: Fix irq type for pca955
	media: platform: davinci: return -EINVAL for VPFE_CMD_S_CCDC_RAW_PARAMS ioctl
	target: Avoid mappedlun symlink creation during lun shutdown
	iscsi-target: Always wait for kthread_should_stop() before kthread exit
	iscsi-target: Fix early sk_data_ready LOGIN_FLAGS_READY race
	iscsi-target: Fix initial login PDU asynchronous socket close OOPs
	iscsi-target: Fix delayed logout processing greater than SECONDS_FOR_LOGOUT_COMP
	iser-target: Avoid isert_conn->cm_id dereference in isert_login_recv_done
	mm, mprotect: flush TLB if potentially racing with a parallel reclaim leaving stale TLB entries
	media: lirc: LIRC_GET_REC_RESOLUTION should return microseconds
	f2fs: sanity check checkpoint segno and blkoff
	drm: rcar-du: fix backport bug
	saa7164: fix double fetch PCIe access condition
	ipv4: ipv6: initialize treq->txhash in cookie_v[46]_check()
	net: Zero terminate ifr_name in dev_ifname().
	ipv6: avoid overflow of offset in ip6_find_1stfragopt
	ipv4: initialize fib_trie prior to register_netdev_notifier call.
	rtnetlink: allocate more memory for dev_set_mac_address()
	mcs7780: Fix initialization when CONFIG_VMAP_STACK is enabled
	openvswitch: fix potential out of bound access in parse_ct
	packet: fix use-after-free in prb_retire_rx_blk_timer_expired()
	ipv6: Don't increase IPSTATS_MIB_FRAGFAILS twice in ip6_fragment()
	net: ethernet: nb8800: Handle all 4 RGMII modes identically
	dccp: fix a memleak that dccp_ipv6 doesn't put reqsk properly
	dccp: fix a memleak that dccp_ipv4 doesn't put reqsk properly
	dccp: fix a memleak for dccp_feat_init err process
	sctp: don't dereference ptr before leaving _sctp_walk_{params, errors}()
	sctp: fix the check for _sctp_walk_params and _sctp_walk_errors
	net/mlx5: Fix command bad flow on command entry allocation failure
	net: phy: Correctly process PHY_HALTED in phy_stop_machine()
	net: phy: Fix PHY unbind crash
	xen-netback: correctly schedule rate-limited queues
	sparc64: Measure receiver forward progress to avoid send mondo timeout
	wext: handle NULL extra data in iwe_stream_add_point better
	sh_eth: R8A7740 supports packet shecksumming
	net: phy: dp83867: fix irq generation
	tg3: Fix race condition in tg3_get_stats64().
	x86/boot: Add missing declaration of string functions
	phy state machine: failsafe leave invalid RUNNING state
	scsi: qla2xxx: Get mutex lock before checking optrom_state
	drm/virtio: fix framebuffer sparse warning
	virtio_blk: fix panic in initialization error path
	ARM: 8632/1: ftrace: fix syscall name matching
	mm, slab: make sure that KMALLOC_MAX_SIZE will fit into MAX_ORDER
	lib/Kconfig.debug: fix frv build failure
	signal: protect SIGNAL_UNKILLABLE from unintentional clearing.
	mm: don't dereference struct page fields of invalid pages
	ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output
	net: account for current skb length when deciding about UFO
	workqueue: implicit ordered attribute should be overridable
	Linux 4.4.81

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2017-08-11 13:09:21 -07:00
Sudip Mukherjee
623f4fcd94 lib/Kconfig.debug: fix frv build failure
[ Upstream commit da0510c47519fe0999cffe316e1d370e29f952be ]

The build of frv allmodconfig was failing with the errors like:

  /tmp/cc0JSPc3.s: Assembler messages:
  /tmp/cc0JSPc3.s:1839: Error: symbol `.LSLT0' is already defined
  /tmp/cc0JSPc3.s:1842: Error: symbol `.LASLTP0' is already defined
  /tmp/cc0JSPc3.s:1969: Error: symbol `.LELTP0' is already defined
  /tmp/cc0JSPc3.s:1970: Error: symbol `.LELT0' is already defined

Commit 866ced950b ("kbuild: Support split debug info v4") introduced
splitting the debug info and keeping that in a separate file.  Somehow,
the frv-linux gcc did not like that and I am guessing that instead of
splitting it started copying.  The first report about this is at:

  https://lists.01.org/pipermail/kbuild-all/2015-July/010527.html.

I will try and see if this can work with frv and if still fails I will
open a bug report with gcc.  But meanwhile this is the easiest option to
solve build failure of frv.

Fixes: 866ced950b ("kbuild: Support split debug info v4")
Link: http://lkml.kernel.org/r/1482062348-5352-1-git-send-email-sudipm.mukherjee@gmail.com
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-11 09:08:59 -07:00
Siqi Lin
0d6871912b ANDROID: kernel: printk: Add cpu and pid to printk log prefix
Add CPU number and process ID to printk log messages. This information
is useful to get a timeline of what was running on a CPU before a
watchdog.

Based on commit bf1f48d03d41 ("kernel: printk: Add cpu and pid into log prefix")
from android-msm-marlin-3.18.

Bug: 62670012
Change-Id: I7c0119f22db08638f4da102927215bbe03120b3f
Signed-off-by: Siqi Lin <siqilin@google.com>
2017-06-16 01:41:20 +00:00
Thierry Strudel
1bfb0526f6 Merge branch 'android-msm-8998-4.4-common' into android-msm-wahoo-4.4
Conflicts:
	Makefile
	arch/arm64/configs/wahoo_defconfig
	arch/arm64/include/asm/cpufeature.h
	arch/arm64/kernel/sleep.S
	arch/arm64/kernel/vmlinux.lds.S
	arch/arm64/mm/fault.c
	drivers/android/binder.c
	drivers/firmware/efi/arm-init.c
	drivers/firmware/efi/efi.c
	drivers/input/keyboard/gpio_keys.c
	drivers/input/misc/Makefile
	drivers/input/misc/vl53L0/Makefile
	drivers/input/misc/vl53L0/inc/vl53l010_api.h
	drivers/input/misc/vl53L0/inc/vl53l010_device.h
	drivers/input/misc/vl53L0/inc/vl53l010_strings.h
	drivers/input/misc/vl53L0/inc/vl53l010_tuning.h
	drivers/input/misc/vl53L0/inc/vl53l0_api.h
	drivers/input/misc/vl53L0/inc/vl53l0_api_calibration.h
	drivers/input/misc/vl53L0/inc/vl53l0_api_core.h
	drivers/input/misc/vl53L0/inc/vl53l0_api_histogram.h
	drivers/input/misc/vl53L0/inc/vl53l0_api_ranging.h
	drivers/input/misc/vl53L0/inc/vl53l0_api_strings.h
	drivers/input/misc/vl53L0/inc/vl53l0_def.h
	drivers/input/misc/vl53L0/inc/vl53l0_device.h
	drivers/input/misc/vl53L0/inc/vl53l0_interrupt_threshold_settings.h
	drivers/input/misc/vl53L0/inc/vl53l0_platform.h
	drivers/input/misc/vl53L0/inc/vl53l0_platform_log.h
	drivers/input/misc/vl53L0/inc/vl53l0_tuning.h
	drivers/input/misc/vl53L0/inc/vl53l0_types.h
	drivers/input/misc/vl53L0/src/vl53l010_api.c
	drivers/input/misc/vl53L0/src/vl53l010_tuning.c
	drivers/input/misc/vl53L0/src/vl53l0_api.c
	drivers/input/misc/vl53L0/src/vl53l0_api_calibration.c
	drivers/input/misc/vl53L0/src/vl53l0_api_core.c
	drivers/input/misc/vl53L0/src/vl53l0_api_histogram.c
	drivers/input/misc/vl53L0/src/vl53l0_api_ranging.c
	drivers/input/misc/vl53L0/src/vl53l0_api_strings.c
	drivers/input/misc/vl53L0/src/vl53l0_i2c_platform.c
	drivers/input/misc/vl53L0/src/vl53l0_platform.c
	drivers/input/misc/vl53L0/src/vl53l0_port_i2c.c
	drivers/input/misc/vl53L0/stmvl53l0-cci.h
	drivers/input/misc/vl53L0/stmvl53l0-i2c.h
	drivers/input/misc/vl53L0/stmvl53l0.h
	drivers/input/misc/vl53L0/stmvl53l0_module-cci.c
	drivers/input/misc/vl53L0/stmvl53l0_module-i2c.c
	drivers/input/misc/vl53L0/stmvl53l0_module.c
	drivers/input/touchscreen/Makefile
	drivers/leds/leds-qpnp.c
	drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.c
	drivers/media/platform/msm/camera_v2/msm.c
	drivers/pinctrl/qcom/pinctrl-msm.c
	drivers/platform/msm/ipa/ipa_v3/ipa_client.c
	drivers/platform/msm/mhi/mhi_ssr.c
	drivers/power/supply/qcom/qpnp-smb2.c
	drivers/power/supply/qcom/smb-lib.c
	drivers/power/supply/qcom/smb-lib.h
	drivers/soc/qcom/icnss.c
	drivers/soc/qcom/qdsp6v2/audio_notifier.c
	drivers/soc/qcom/service-notifier.c
	drivers/video/fbdev/msm/mdss_panel.h
	fs/exec.c
	fs/ext4/inode.c
	fs/ext4/readpage.c
	fs/namei.c
	fs/sdcardfs/derived_perm.c
	fs/sdcardfs/file.c
	fs/sdcardfs/inode.c
	fs/sdcardfs/lookup.c
	fs/sdcardfs/main.c
	fs/sdcardfs/multiuser.h
	fs/sdcardfs/packagelist.c
	fs/sdcardfs/sdcardfs.h
	fs/sdcardfs/super.c
	fs/utimes.c
	include/linux/string.h
	lib/kstrtox.c
	lib/string.c
	net/ipv4/tcp_ipv4.c
	net/unix/af_unix.c
	sound/soc/codecs/wcd934x/wcd934x-mbhc.h
	sound/soc/msm/msm8998.c

Change-Id: I918ebad22a5f81d48be07bd2bc2ac435ed9acb0a
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-04-07 12:27:45 -07:00
Thierry Strudel
ab757a987a Merge branch 'android-msm-8998-4.4' into android-msm-8998-4.4-common
Conflicts:
	Documentation/scheduler/sched-hmp.txt
	drivers/base/cpu.c
	include/linux/cgroup-defs.h
	include/linux/cgroup.h
	include/trace/events/sched.h
	kernel/cgroup.c
	kernel/cpuset.c
	kernel/sched/core.c
	kernel/sched/core_ctl.c
	kernel/sched/fair.c
	kernel/sched/hmp.c
	kernel/sched/rt.c
	kernel/sched/tune.c
	kernel/sysctl.c

Test: builds for msmcortex_defconfig
Change-Id: I82e0a13c9ca21d5f52cdbe52a2add501c1fca05d
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-04-07 09:56:07 -07:00
Prasad Sodagudi
4f659aa55e rcu: Induce msm watchdog bite for rcu stalls
Every RCU stall need to be debugged, So collect the ram
dumps on every RCU stall to debug further by inducing
non secure watchdog bite whenever rcu stall detected.

Change-Id: I6c1cfddc92f06b48c3f22fe9970b70f2ec670bf6
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2017-03-09 10:07:35 -08:00
Chris Fries
18f26a64a2 kernel: Add CC_WERROR config to turn warnings into errors
Add configuration option CONFIG_CC_WERROR to prevent warnings
from creeping in.

Signed-off-by: Chris Fries <cfries@google.com>
2017-03-08 15:10:52 +00:00
Andres Oportus
ac087abe13 Merge android-msm-8998-4.4-common into android-msm-muskie-4.4
Add and enable EAS support by bringing remote tracking branch
android-msm-8998-4.4-common in kernel/private/msm-qcom into
branch android-msm-muskie-4.4

Manual merges:
	arch/arm/boot/dts/qcom/msm8998.dtsi (from msmcobalt.dtsi in android-msm-8998-4.4-common)
	arch/arm64/configs/muskie_defconfig (from msmcobalt_defconfig in android-msm-8998-4.4-common)
	include/linux/cpu.h (taken from android-msm-muskie-4.4)
	drivers/staging/qca-wifi-host-cmn/hif/src/hif_napi.c (remove core_ctl_set_boost calls)

Change-Id: I8e0dd7233d4ab7122d5e3d7b5c8d5fc42165a494
Signed-off-by: Andres Oportus <andresoportus@google.com>
2017-01-11 22:31:42 -08:00
Dmitry Vyukov
53b8336401 UPSTREAM: kernel: add kcov code coverage
kcov provides code coverage collection for coverage-guided fuzzing
(randomized testing).  Coverage-guided fuzzing is a testing technique
that uses coverage feedback to determine new interesting inputs to a
system.  A notable user-space example is AFL
(http://lcamtuf.coredump.cx/afl/).  However, this technique is not
widely used for kernel testing due to missing compiler and kernel
support.

kcov does not aim to collect as much coverage as possible.  It aims to
collect more or less stable coverage that is function of syscall inputs.
To achieve this goal it does not collect coverage in soft/hard
interrupts and instrumentation of some inherently non-deterministic or
non-interesting parts of kernel is disbled (e.g.  scheduler, locking).

Currently there is a single coverage collection mode (tracing), but the
API anticipates additional collection modes.  Initially I also
implemented a second mode which exposes coverage in a fixed-size hash
table of counters (what Quentin used in his original patch).  I've
dropped the second mode for simplicity.

This patch adds the necessary support on kernel side.  The complimentary
compiler support was added in gcc revision 231296.

We've used this support to build syzkaller system call fuzzer, which has
found 90 kernel bugs in just 2 months:

  https://github.com/google/syzkaller/wiki/Found-Bugs

We've also found 30+ bugs in our internal systems with syzkaller.
Another (yet unexplored) direction where kcov coverage would greatly
help is more traditional "blob mutation".  For example, mounting a
random blob as a filesystem, or receiving a random blob over wire.

Why not gcov.  Typical fuzzing loop looks as follows: (1) reset
coverage, (2) execute a bit of code, (3) collect coverage, repeat.  A
typical coverage can be just a dozen of basic blocks (e.g.  an invalid
input).  In such context gcov becomes prohibitively expensive as
reset/collect coverage steps depend on total number of basic
blocks/edges in program (in case of kernel it is about 2M).  Cost of
kcov depends only on number of executed basic blocks/edges.  On top of
that, kernel requires per-thread coverage because there are always
background threads and unrelated processes that also produce coverage.
With inlined gcov instrumentation per-thread coverage is not possible.

kcov exposes kernel PCs and control flow to user-space which is
insecure.  But debugfs should not be mapped as user accessible.

Based on a patch by Quentin Casasnovas.

[akpm@linux-foundation.org: make task_struct.kcov_mode have type `enum kcov_mode']
[akpm@linux-foundation.org: unbreak allmodconfig]
[akpm@linux-foundation.org: follow x86 Makefile layout standards]
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: syzkaller <syzkaller@googlegroups.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Tavis Ormandy <taviso@google.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Kostya Serebryany <kcc@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Kees Cook <keescook@google.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: David Drysdale <drysdale@google.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit 5c9a8750a6409c63a0f01d51a9024861022f6593)
Signed-off-by: Alexander Potapenko <glider@google.com>

Change-Id: Ia7d116ded35eb31a514406f864d7d591606c65f3
2016-11-02 10:21:27 -07:00
Andres Oportus
66ce6b8ab6 Revert HMP
Revert "sched/tune: add sysctl interface to define a boost value"
Revert "sched: Initialize HMP stats inside init_sd_lb_stats()"
Revert "sched: Fix integer overflow in sched_update_nr_prod()"
Revert "sched: Add a device tree property to specify the sched boost type"
Revert "sched: Add a stub function for init_clusters()"
Revert "sched: add a knob to prefer the waker CPU for sync wakeups"
Revert "sched: Fix a division by zero bug in scale_exec_time()"
Revert "sched: Fix CPU selection when all online CPUs are isolated"
Revert "sched: don't assume higher capacity means higher power in lb"
Revert "sched/core_ctl: Integrate core control with cpu isolation"
Revert "sched/core_ctl: Refactor cpu data"
Revert "trace: Move core control trace events to scheduler"
Revert "core_ctrl: Move core control into kernel"
Revert "sched/core: Add trace point for cpu isolation"
Revert "sched: add cpu isolation support"
Revert "sched: constrain HMP scheduler tunable range with in better way"
Revert "sched: panic on corrupted stack end"
Revert "sched: Move data structures under CONFIG_SCHED_HMP"
Revert "sched: Further re-factor HMP specific code"
Revert "sched: Make use of sysctl_sched_wake_to_idle in select_best_cpu"
Revert "sched: Introduce sched_freq_aggregate_threshold tunable"
Revert "sched: handle frequency alert notifications better"
Revert "sched: inherit the group id from the group leader"
Revert "sched/fair: Add flag to indicate why we picked the CPU"
Revert "sched: Move notify_migration() under CONFIG_SCHED_HMP"
Revert "sched: Move most HMP specific code to a separate file."
Revert "sched: Consolidate CONFIG_SCHED_HMP sections in various files"
Revert "sched: Fix compile issues for !CONFIG_SCHED_HMP"
Revert "sched: Remove all existence of CONFIG_SCHED_FREQ_INPUT"
Revert "sched: Move CPU cstate tracking under CONFIG_SCHED_HMP"
Revert "sched: Remove unused PELT extensions for HMP scheduling"
Revert "sched: Remove unused migration notifier code."
Revert "Revert "arm64: Add support for app specific settings""
Revert "sched/fair: Don't check for migration for a pinned task"
Revert "sched/core: Fix uninitialized variable used for tracepoint"
Revert "sched/core: Fix null-pointer dereference"
Revert "sched: break the forever prev_cpu selection preference"
Revert "sched: core: Fix possible hotplug race in set_cpus_allowed_ptr"
Revert "sched: kill unnecessary divisions on fast path"
Revert "sched: prevent race where update CPU cycles"
Revert "sched: fix overflow in scaled execution time calculation"
Revert "sched: remove unused parameter cpu from cpu_cycles_to_freq()"
Revert "sched: avoid potential race between governor and thermal driver"
Revert "sched: fix potential deflated frequency estimation during IRQ handling"
Revert "sched: fix CPU frequency estimation while idle"
Revert "sched: preserve CPU cycle counter in rq"
Revert "arm64: Add support for app specific settings"
Revert "Revert "sched: warn/panic upon excessive scheduling latency""
Revert "Revert "sched: add scheduling latency tracking procfs node""
Revert "sched: eliminate sched_early_detection_duration knob"
Revert "sched: Remove the sched heavy task frequency guidance feature"
Revert "sched: eliminate sched_migration_fixup knob"
Revert "sched: eliminate sched_upmigrate_min_nice knob"
Revert "sched: eliminate sched_enable_power_aware knob and parameter"
Revert "sched: eliminate sched_freq_account_wait_time knob"
Revert "sched: eliminate sched_account_wait_time knob"
Revert "sched: Aggregate for frequency"
Revert "sched: simplify CPU frequency estimation and cycle counter API"
Revert "sched: use correct Kconfig macro name CONFIG_SCHED_HMP_CSTATE_AWARE"
Revert "Revert "sched: set HMP scheduler's default initial task load to 100%""
Revert "watchdog: introduce touch_softlockup_watchdog_sched()"
Revert "sched/cgroup: Fix/cleanup cgroup teardown/init"
Revert "sched: take into account of limited CPU min and max frequencies"
Revert "sched: add support for CPU frequency estimation with cycle counter"
Revert "sched: revise sched_boost to make the best of big cluster CPUs"
Revert "sched: fix excessive task packing where CONFIG_SCHED_HMP_CSTATE_AWARE=y"
Revert "sched: add option whether CPU C-state is used to guide task placement"
Revert "sched: update placement logic to prefer C-state and busier CPUs"
Revert "sched: Optimize wakeup placement logic when need_idle is set"
Revert "kernel: sched: Fix compilation issues for Usermode Linux"
Revert "sched/cputime: Fix steal time accounting vs. CPU hotplug"
Revert "sched/cputime: Fix steal_account_process_tick() to always return jiffies"
Revert "sched: fix circular dependency of rq->lock and kswadp waitqueue lock"
Revert "sched: move out migration notification out of spinlock"
Revert "sched: fix compile failure with !CONFIG_SCHED_HMP"
Revert "sched: restrict sync wakee placement bias with waker's demand"
Revert "sched: add preference for waker cluster CPU in wakee task placement"
Revert "sched/core: Add protection against null-pointer dereference"
Revert "sched: allow select_prev_cpu_us to be set to values greater than 100us"
Revert "sched: clean up idle task's mark_start restoring in init_idle()"
Revert "sched: let sched_boost take precedence over sched_restrict_cluster_spill"
Revert "sched: Add separate load tracking histogram to predict loads"
Revert "sched: Provide a wake up API without sending freq notifications"
Revert "sched: Take downmigrate threshold into consideration"
Revert "sched: Provide a facility to restrict RT tasks to lower power cluster"
Revert "sched: Take cluster's minimum power into account for optimizing sbc()"
Revert "sched: Revise the inter cluster load balance restrictions"
Revert "sched: colocate related threads"
Revert "sched: Update fair and rt placement logic to use scheduler clusters"
Revert "sched: Introduce the concept CPU clusters in the scheduler"
Revert "sched: remove init_new_task_load from CONFIG_SMP"
Revert "sched: Export sched_setscheduler_nocheck()"
Revert "Revert "sched: Export sched_setscheduler_nocheck""
Revert "vmstat: make vmstat_updater deferrable again and shut down on idle"
Revert "sched: fix compile failure where !CONFIG_SCHED_HMP"
Revert "sched: select task's prev_cpu as the best CPU when it was chosen recently"
Revert "sched: use ktime instead of sched_clock for load tracking"
Revert "sched: Update min/max capacity for the CPUFREQ_CREATE_POLICY notifier"
Revert "sched/cputime: fix a deadlock on 32bit systems"
Revert "sched: Optimize scheduler trace events to reduce trace buffer usage"
Revert "sched: initialize frequency domain cpumask"
Revert "sched: print sched_task_load always"
Revert "sched: add preference for prev and sibling CPU in RT task placement"
Revert "sched: core: Don't use current task_cpu when migrating with stop_one_cpu"
Revert "sched: Notify cpufreq governor early about potential big tasks"
Revert "sched: Skip resetting HMP stats when max frequencies remain unchanged"
Revert "sched: update sched_task_load trace event"
Revert "sched: avoid unnecessary multiplication and division"
Revert "sched: precompute required frequency for CPU load"
Revert "sched: clean up fixup_hmp_sched_stats()"
Revert "sched: account new task load so that governor can apply different policy"
Revert "sched: Fix frequency change checks when affined tasks are migrating"
Revert "sched: Add tunables for static cpu and cluster cost"
Revert "sched/core: Add API to set cluster d-state"
Revert "sched: take into account of governor's frequency max load"
Revert "sched: set HMP scheduler's default initial task load to 100%"
Revert "sched: add preference for prev and sibling CPU in HMP task placement"
Revert "sched: Update task->on_rq when tasks are moving between runqueues"
Revert "sched: remove temporary demand fixups in fixup_busy_time()"
Revert "sched: add frequency zone awareness to the load balancer"
Revert "sched: Update the wakeup placement logic for fair and rt tasks"
Revert "sched: remove the notion of small tasks and small task packing"
Revert "sched: Rework energy aware scheduling"
Revert "sched: encourage idle load balance and discourage active load balance"
Revert "sched: avoid stale cumulative_runnable_avg HMP statistics"
Revert "sched: Add load based placement for RT tasks"
Revert "sched: Avoid running idle_balance() consecutively"
Revert "sched: inline function scale_load_to_cpu()"
Revert "sched: look for least busy and fallback CPU only when it's needed"
Revert "sched: iterate search CPUs starting from prev_cpu for optimization"
Revert "sched: Optimize the select_best_cpu() "for" loop"
Revert "sched: Optimize select_best_cpu() to reduce execution time"
Revert "sched/debug: Add Kconfig to trigger panics on all 'BUG:' conditions"
Revert "sched: fix incorrect prev_runnable_sum accounting with long ISR run"
Revert "sched: prevent task migration while governor queries CPUs' load"
Revert "sched: report loads greater than 100% only during load alert notifications"
Revert "sched: turn off the TTWU_QUEUE feature"
Revert "sched: avoid unnecessary HMP scheduler stat re-accounting"
Revert "sched/fair: Fix capacity and nr_run comparisons in can_migrate_task()"
Revert "Revert "sched: Use only partial wait time as task demand""
Revert "sched/deadline: Add basic HMP extensions"
Revert "sched: Fix racy invocation of fixup_busy_time via move_queued_task"
Revert "sched: don't inflate the task load when the CPU max freq is restricted"
Revert "sched: auto adjust the upmigrate and downmigrate thresholds"
Revert "sched: don't inherit initial task load from the parent"
Revert "sched/fair: Add irq load awareness to the tick CPU selection logic"
Revert "sched: disable IRQs in update_min_max_capacity"
Revert "sched: Use only partial wait time as task demand"
Revert "sched: fix race conditions where HMP tunables change"
Revert "sched: check HMP scheduler tunables validity"
Revert "sched: Update max_capacity when an entire cluster is hotplugged"
Revert "sched: Ensure attempting load balance when HMP active balance flags are set"
Revert "sched: add scheduling latency tracking procfs node"
Revert "sched: warn/panic upon excessive scheduling latency"
Revert "sched/core: Fix incorrect wait time and wait count statistics"
Revert "sched: Update cur_freq in the cpufreq policy notifier callback"
Revert "sched: avoid CPUs with high irq activity for non-small tasks"
Revert "sched: actively migrate big tasks on power CPU to idle performance CPU"
Revert "sched: Add cgroup-based criteria for upmigration"
Revert "sched: avoid running idle_balance() on behalf of wrong CPU"
Revert "sched: Keep track of average nr_big_tasks"
Revert "sched: Fix bug in average nr_running and nr_iowait calculation"
Revert "sched: Avoid pulling all tasks from a CPU during load balance"
Revert "sched: Avoid pulling big tasks to the little cluster during load balance"
Revert "sched: fix rounding error on scaled execution time calculation"
Revert "sched/fair: Respect wake to idle over sync wakeup"
Revert "sched: Support CFS_BANDWIDTH feature in HMP scheduler"
Revert "sched: Consolidate hmp stats into their own struct"
Revert "sched: Add userspace interface to set PF_WAKE_UP_IDLE"
Revert "sched_avg: add run queue averaging"
Revert "sched: add sched feature FORCE_CPU_THROTTLING_IMMINENT"
Revert "sched: continue to search less power efficient cpu for load balancer"
Revert "sched: Update cur_freq for offline CPUs in notifier callback"
Revert "sched: Fix overflow in max possible capacity calculation"
Revert "sched: add preference for prev_cpu in HMP task placement"
Revert "sched: Per-cpu prefer_idle flag"
Revert "sched: Consider PF_WAKE_UP_IDLE in select_best_cpu()"
Revert "sched: Add sysctl to enable power aware scheduling"
Revert "sched: Ensure no active EA migration occurs when EA is disabled"
Revert "sched: take account of irq preemption when calculating irqload delta"
Revert "sched: Prevent race conditions where upmigrate_min_nice changes"
Revert "sched: Avoid frequent task migration due to EA in lb"
Revert "sched: Avoid migrating tasks to little cores due to EA"
Revert "sched: Add temperature to cpu_load trace point"
Revert "sched: Only do EA migration when CPU throttling is imminent"
Revert "sched: Avoid frequent migration of running task"
Revert "sched: treat sync waker CPUs with 1 task as idle"
Revert "sched: extend sched_task_load tracepoint to indicate prefer_idle"
Revert "sched: extend sched_task_load tracepoint to indicate sync wakeup"
Revert "sched: add sync wakeup recognition in select_best_cpu"
Revert "sched: Provide knob to prefer mostly_idle over idle cpus"
Revert "sched: make sched_cpu_high_irqload a runtime tunable"
Revert "sched: trace: extend sched_cpu_load to print irqload"
Revert "sched: avoid CPUs with high irq activity"
Revert "sched: refresh sched_clock() after acquiring rq lock in irq path"
Revert "sched: track soft/hard irqload per-RQ with decaying avg"
Revert "sched: do not set window until sched_clock is fully initialized"
Revert "sched: Make RT tasks eligible for boost"
Revert "sched: Limit LBF_PWR_ACTIVE_BALANCE to within cluster"
Revert "sched: Packing support until a frequency threshold"
Revert "sched: tighten up jiffy to sched_clock mapping"
Revert "sched: Avoid unnecessary load balance when tasks don't fit on dst_cpu"
Revert "sched: print sched_cpu_load tracepoint for all CPUs"
Revert "sched: per-cpu mostly_idle threshold"
Revert "sched: Add API to set task's initial task load"
Revert "sched: use C-states in non-small task wakeup placement logic"
Revert "sched: take rq lock prior to saving idle task's mark_start"
Revert "sched: update governor notification logic"
Revert "sched: window-stats: Retain idle thread's mark_start"
Revert "sched: Add checks for frequency change"
Revert "sched: Use absolute scale for notifying governor"
Revert "sched: window-stats: Enhance cpu busy time accounting"
Revert "sched: window-stats: ftrace event improvements"
Revert "sched: improve logic for alerting governor"
Revert "sched: Stop task migration to busy CPUs due to power active balance"
Revert "sched: window-stats: Fix accounting bug in legacy mode"
Revert "sched: window-stats: Note legacy mode in fork() and exit()"
Revert "sched: Fix reference to stale task_struct in try_to_wake_up()"
Revert "sched: Remove hack to enable/disable HMP scheduling extensions"
Revert "sched: fix wrong load_scale_factor/capacity/nr_big/small_tasks"
Revert "sched: add check for cpu idleness when using C-state information"
Revert "sched: extend sched_task_load tracepoint to indicate small tasks"
Revert "sched: Add C-state tracking to the sched_cpu_load trace event"
Revert "sched: window-stats: add a new AVG policy"
Revert "sched: Fix compile error"
Revert "sched: update ld_moved for active balance from the load balancer"
Revert "sched: actively migrate tasks to idle big CPUs during sched boost"
Revert "sched: always do idle balance with a NEWLY_IDLE idle environment"
Revert "sched: fix bail condition in bail_inter_cluster_balance()"
Revert "sched: Initialize env->loop variable to 0"
Revert "sched: window-stats: use policy_mutex in sched_set_window()"
Revert "sched: window-stats: Avoid taking all cpu's rq->lock for long"
Revert "sched: window_stats: Add "disable" mode support"
Revert "sched: window-stats: Fix exit race"
Revert "sched: window-stats: code cleanup"
Revert "sched: window-stats: legacy mode"
Revert "sched: window-stats: Code cleanup"
Revert "sched: window-stats: Code cleanup"
Revert "sched: window-stats: Code cleanup"
Revert "sched: window-stats: Remove unused prev_window variable"
Revert "sched: disable frequency notifications by default"
Revert "sched: fix misalignment between requested and actual windows"
Revert "sched: Make RAVG_HIST_SIZE tunable"
Revert "sched: Fix possibility of "stuck" reserved flag"
Revert "sched: initialize env->flags variable to 0"
Revert "sched: window-stats: 64-bit type for curr/prev_runnable_sum"
Revert "sched: window-stats: Allow acct_wait_time to be tuned"
Revert "sched: window-stats: Account interrupt handling time as busy time"
Revert "sched: window-stats: Account idle time as busy time"
Revert "sched: window-stats: Account wait time"
Revert "sched: window-stats: update task demand on tick"
Revert "sched: Fix herding issue"
Revert "sched: window-stats: print window size in /proc/sched_debug"
Revert "sched: Extend ftrace event to record boost and reason code"
Revert "sched: Avoid needless migration"
Revert "sched: Drop active balance request upon cpu going offline"
Revert "sched: trigger immediate migration of tasks upon boost"
Revert "sched: Extend boost benefit for small and low-prio tasks"
Revert "sched: window-stats: Handle policy change properly"
Revert "sched: window-stats: Reset all window stats"
Revert "sched: window-stats: Additional error checking in sched_set_window()"
Revert "sched: window-stats: Fix incorrect calculation of partial_demand"
Revert "sched: window-stats: Fix potential wrong use of rq"
Revert "sched: set initial task load to just above a small task"
Revert "sched/fair: Check whether any CPUs are available"
Revert "sched: enable hmp, power aware scheduling for targets with > 4 CPUs"
Revert "sched: remove sysctl control for HMP and power-aware task placement"
Revert "sched: support legacy mode better"
Revert "sched: code cleanup"
Revert "sched: Add BUG_ON when task_cpu() is incorrect"
Revert "sched: avoid active migration of tasks not in TASK_RUNNING state"
Revert "sched: fix up task load during migration"
Revert "sched: avoid pushing tasks to an offline CPU"
Revert "sched: Add a per rq max_possible_capacity for use in power calculations"
Revert "sched: Disable interrupts when holding the rq lock in sched_get_busy()"
Revert "sched: Make wallclock more accurate"
Revert "sched: Make task and CPU load calculations safe from truncation"
Revert "sched/fair: Introduce C-state aware task placement for small tasks"
Revert "sched/fair: Introduce scheduler boost for low latency workloads"
Revert "sched: Move call to trace_sched_cpu_load()"
Revert "sched: fair: Reset balance_interval before sending NOHZ kick"
Revert "sched: Avoid active migration of small tasks"
Revert "sched: Account for cpu's current frequency when calculating its power cost"
Revert "sched: make sched_set_window() return failure when PELT is in use"
Revert "sched: debug: Print additional information in /proc/sched_debug"
Revert "sched: Move around code"
Revert "sched: Update capacity of all online cpus when min_max_freq changes"
Revert "sched: update task statistics when CPU frequency changes"
Revert "sched: Add new trace events"
Revert "sched: do not balance on exec if SCHED_HMP"
Revert "sched: Use historical load for freq governor input"
Revert "sched: window-stats: apply scaling to full elapsed windows"
Revert "sched: notify cpufreq on over/underprovisioned CPUs"
Revert "sched: Introduce spill threshold tunables to manage overcommitment"
Revert "sched: add affinity, task load information to sched tracepoints"
Revert "sched: add migration load change notifier for frequency guidance"
Revert "sched/fair: Limit MAX_PINNED_INTERVAL for more frequent load balancing"
Revert "sched/fair: Help out higher capacity CPUs when they are overcommitted"
Revert "sched/rt: Introduce power aware scheduling for real time tasks"
Revert "sched: balance power inefficient CPUs with one task"
Revert "sched: check for power inefficient task placement in tick"
Revert "sched: do nohz load balancing in order of power efficiency"
Revert "sched: run idle_balance() on most power-efficient CPU"
Revert "sched: add hook for platform-specific CPU power information"
Revert "sched: add power aware scheduling sysctl"
Revert "sched: Extend update_task_ravg() to accept wallclock as argument"
Revert "sched: add sched_get_busy, sched_set_window APIs"
Revert "sched: window-stats: adjust RQ curr, prev sums on task migration"
Revert "sched: window-stats: Add aggregated runqueue windowed stats"
Revert "sched: window-stats: add prev_window counter per-task"
Revert "sched: window-stats: synchronize windows across cpus"
Revert "sched: window-stats: Do not account wait time"
Revert "sched: window-stats: update during migration and earlier at wakeup"
Revert "sched: move definition of update_task_ravg()"
Revert "sched: Switch to windows based load stats by default"
Revert "sched: Provide tunable to switch between PELT and window-based stats"
Revert "sched: Provide scaled load information for tasks in /proc"
Revert "sched: Add additional ftrace events"
Revert "sched: Extend /proc/sched_debug with additional information"
Revert "sched: Tighten controls for tasks spillover to idle cluster"
Revert "sched: Track number of big and small tasks on a cpu"
Revert "sched: Handle cpu-bound tasks stuck on wrong cpu"
Revert "sched: Extend active balance to accept 'push_task' argument"
Revert "sched: Send NOHZ kick to idle cpu in same cluster"
Revert "sched: Basic task placement support for HMP systems"
Revert "sched: Use rq->efficiency in scaling load stats"
Revert "sched: Introduce efficiency, load_scale_factor and capacity"
Revert "sched: Add CONFIG_SCHED_HMP Kconfig option"
Revert "sched: Add scaled task load statistics"
Revert "sched: Introduce CONFIG_SCHED_FREQ_INPUT"
Revert "sched: window-based load stats improvements"
Revert "sched: Add min_max_freq and rq->max_possible_freq"
Revert "sched: move task load based functions"
Revert "sched: fix race between try_to_wake_up() and move_task()"
Revert "sched: Skip load update for idle task"
Revert "sched: Window-based load stat improvements"
Revert "sched: Call the notify_on_migrate notifier chain for wakeups as well"
Revert "cpufreq: cpu-boost: Introduce scheduler assisted load based syncs"
Revert "sched: window-based load stats for tasks"
Revert "sched: Make scheduler aware of cpu frequency state"
Revert "sched/debug: Make sysrq prints of sched debug data optional"
Revert "tracing/sched: add load balancer tracepoint"
Revert "sched: change WARN_ON_ONCE to printk_deferred() in try_to_wake_up_local()"
Revert "tracing/sched: Track per-cpu rt and non-rt cpu_load."
Revert "sched: re-calculate a cpu's next_balance point upon sched domain changes"
Revert "sched: provide per cpu-cgroup option to notify on migrations"
Revert "sched: Fix SCHED_HRTICK bug leading to late preemption of tasks"
Revert "kernel: reduce sleep duration in wait_task_inactive"
Revert "sched: add sysctl for controlling task migrations on wake"
Revert "sched/rt: Add Kconfig option to enable panicking for RT throttling"
Revert "sched/rt: print RT tasks when RT throttling is activated"
Revert "sched: add PF_WAKE_UP_IDLE"
Revert "sched: Make the scheduler aware of C-state for cpus"
Revert "sched: Fix crash in sched_init_numa()"
Revert "cpufreq: interactive: New 'interactive' governor"
Revert "drivers: cpuidle: lpm-levels: Notify sched of idle state entry/exit"
Revert "arm64: topology: Add support for topology DT bindings"
Revert "clk: msm: clock-osm: register cycle counter callbacks with
scheduler"
Revert "arm64: fpsimd: Enable FP(floating-point) settings for msm8996"
Documentation: remove sched-hmp and sched-zone docs
sched: Add a set_wake_up_idle dummy implementation
driver: thermal: remove call to sched
defconfig: remove HMP related config

Change-Id: Icfc908d8e5414499642c2dffb59a7d6496392b0d
Signed-off-by: Andres Oportus <andresoportus@google.com>
2016-10-26 10:30:58 -07:00
Kyle Yan
01ee295a4a lib: spinlock: Change MSM_WATCHDOG_V2 to QCOM_WATCHDOG_V2
Change DEBUG_SPINLOCK_BITE_ON_BUG to depend on QCOM_WATCHDOG_V2 instead
of MSM_WATCHDOG_V2 as MSM_WATCHDOG_V2 is no longer used.

CRs-Fixed: 1070295
Change-Id: I549abf9978a19da5bbd258d803287464cd73f23c
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
2016-09-22 17:32:41 -07:00
Dmitry Shmidt
341e02d8bb Merge remote-tracking branch 'linaro-ext/EAS/v4.4-easv5.2+aosp-changes' into android-4.4
Change-Id: Ic24b43ee867bc4f70b31bedaad734717b64b86a1
2016-09-08 17:07:42 -07:00
Matt Wagantall
2a4445395f sched/rt: Add Kconfig option to enable panicking for RT throttling
This may be useful for detecting and debugging RT throttling issues.

Change-Id: I5807a897d11997d76421c1fcaa2918aad988c6c9
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
[rameezmustafa@codeaurora.org]: Port to msm-3.18]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[jstultz: forwardported to 4.4]
Signed-off-by: John Stultz <john.stultz@linaro.org>
2016-08-11 14:26:55 -07:00
Tejun Heo
e2b6ea208b workqueue: implement lockup detector
Workqueue stalls can happen from a variety of usage bugs such as
missing WQ_MEM_RECLAIM flag or concurrency managed work item
indefinitely staying RUNNING.  These stalls can be extremely difficult
to hunt down because the usual warning mechanisms can't detect
workqueue stalls and the internal state is pretty opaque.

To alleviate the situation, this patch implements workqueue lockup
detector.  It periodically monitors all worker_pools periodically and,
if any pool failed to make forward progress longer than the threshold
duration, triggers warning and dumps workqueue state as follows.

 BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 31s!
 Showing busy workqueues and worker pools:
 workqueue events: flags=0x0
   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=17/256
     pending: monkey_wrench_fn, e1000_watchdog, cache_reap, vmstat_shepherd, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, release_one_tty, cgroup_release_agent
 workqueue events_power_efficient: flags=0x80
   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=2/256
     pending: check_lifetime, neigh_periodic_work
 workqueue cgroup_pidlist_destroy: flags=0x0
   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/1
     pending: cgroup_pidlist_destroy_work_fn
 ...

The detection mechanism is controller through kernel parameter
workqueue.watchdog_thresh and can be updated at runtime through the
sysfs module parameter file.

v2: Decoupled from softlockup control knobs.

CRs-Fixed: 1007459
Change-Id: Id7dfbbd2701128a942b1bcac2299e07a66db8657
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Don Zickus <dzickus@redhat.com>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Chris Mason <clm@fb.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Git-commit: 82607adcf9cdf40fb7b5331269780c8f70ec6e35
Git-repo: git://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-05-05 15:05:53 -07:00
Trilok Soni
1ca0992ef1 lib: memtest: Add MEMTEST_ENABLE_DEFAULT option
As of now memtest remains disabled until we specify the patterns
through the kernel command line. Some platforms have two
different configurations files (one for debug and another for
product) which can use the configuration option to enable the
memtest by default (in the debug configuration file).

CRs-Fixed: 1007344
Change-Id: I0bf7b33c3584f3d6cf5ef58dfe72be46212041da
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-05-05 15:05:52 -07:00
Trilok Soni
bf6ceddd56 mm/page_owner: ask users about default setting of PAGE_OWNER
Since this commit 48c96a3685 ("mm/page_owner: keep track
of page owners") doesn't enable the page_owner by default
even though CONFIG_PAGE_OWNER is enabled.

Add configuration option CONFIG_PAGE_OWNER_ENABLE_DEFAULT to
allow user to enable it by default through the defconfig file.

CRs-Fixed: 1006743
Change-Id: I9b565a34e2068bf575974eaf3dc9f7820bdd7a96
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-05-03 15:53:55 -07:00
Satya Durga Srinivasu Prabhala
3bf4100be3 Revert "kernel: lib: allow larger stack frame size for KASan"
This reverts commit 8bb334401c
("kernel: lib: allow larger stack frame size for KASan").

Stack frame size set to 5600 to fix compilation error/s if
KASAN enabled by the commit 8bb334401c ("kernel: lib: allow
larger stack frame size for KASan") in 3.18 Kernel and same
commit got pulled into Kernel 4.4, which replaced stack
frame size 0 with 5600 as part of resolution of merge conflict.
But, by setting stack frame size to 0 will ignore stack frame
size warnings and so the compilation errors. So, revert commit
to fix below error while compiling Kernel 4.4 with KASAN enabled
and GCC 5.1 compiler.

kernel/net/wireless/nl80211.c: In function 'nl80211_send_wiphy':
kernel/net/wireless/nl80211.c:1745:1: warning: the frame size of \
5760 bytes is larger than 5600 bytes [-Wframe-larger-than=]
error, forbidden warning: nl80211.c:1745
make[4]: *** [net/wireless/nl80211.o] Error 1

CRs-Fixed: 1004225
Change-Id: I97e52302197c9933bec5cac3ebdc4ec73fee0816
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-04-22 11:57:43 -07:00
Vignesh Radhakrishnan
1dd9d8dd98 kmemleak : Make module scanning optional using config
Currently kmemleak scans module memory as provided
in the area list. This takes up lot of time with
irq's and preemption disabled. Provide a compile
time configurable config to enable this functionality.

Change-Id: I5117705e7e6726acdf492e7f87c0703bc1f28da0
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
[satyap: trivial merge conflict resolution and remove duplicate entry]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-03-23 21:23:43 -07:00
Matt Wagantall
61c44b5807 sched/debug: Add Kconfig to trigger panics on all 'BUG:' conditions
Introduce CONFIG_PANIC_ON_SCHED_BUG to trigger panics along with all
'BUG:' prints from the scheduler core, even potentially-recoverable
ones such as scheduling while atomic, sleeping from invalid context,
and detection of broken arch topologies.

Change-Id: I5d2f561614604357a2bc7900b047e53b3a0b7c6d
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
[joonwoop@codeaurora.org: fixed trivial merge conflict in
 lib/Kconfig.debug.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-03-23 20:02:09 -07:00
Matt Wagantall
5f10bd75eb sched/debug: Make sysrq prints of sched debug data optional
Calls to sysrq_sched_debug_show() can yield rather verbose output
which contributes to log spew and, under heavy load, may increase
the chances of a watchdog bark.

Make printing of this data optional with the introduction of a
new Kconfig, CONFIG_SYSRQ_SCHED_DEBUG.

Change-Id: I5f54d901d0dea403109f7ac33b8881d967a899ed
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-23 19:58:37 -07:00
Matt Wagantall
cc06d4a91d sched/rt: Add Kconfig option to enable panicking for RT throttling
This may be useful for detecting and debugging RT throttling issues.

Change-Id: I5807a897d11997d76421c1fcaa2918aad988c6c9
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
[rameezmustafa@codeaurora.org]: Port to msm-3.18]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[joonwoop@codeaurora.org: fixed conflict in lib/Kconfig.debug]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-03-23 19:58:29 -07:00
Rohit Vaswani
774b4c9f4a lib: Kconfig.debug: Fix the recursive dependency
An earlier commit 52a3101ed9b61787a49f3b5c298aa9240f4006dd
added a recursive dependency as part of CONFIG_DEBUG_SPINLOCK

lib/Kconfig.debug:585:error: recursive dependency detected!
lib/Kconfig.debug:585:symbol DEBUG_SPINLOCK_BITE_ON_BUG depends on DEBUG_SPINLOCK_PANIC_ON_BUG
lib/Kconfig.debug:593:symbol DEBUG_SPINLOCK_PANIC_ON_BUG depends on DEBUG_SPINLOCK_BITE_ON_BUG

Fix this by adding a choice menu.

Change-Id: I0e50103397bb71dec7056db5148cba988550b860
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2016-03-22 11:16:38 -07:00
Prasad Sodagudi
805c18d71c lib: spinlock: Trigger a watchdog bite on spin_dump for rwlock
Currently dump_stack is printed once a spin_bug is detected for rwlock.
So provide an options to trigger a panic or watchdog bite for debugging
rwlock magic corruptions and lockups.

Change-Id: I20807e8eceb8b81635e58701d1f9f9bd36ab5877
[abhimany: replace msm with qcom]
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2016-03-22 11:16:32 -07:00
Rohit Vaswani
77d758e283 lib: spinlock: Cause a watchdog bite on spin_dump
Currently we cause a BUG_ON once a spin_bug is detected, but
that causes a whole lot of processing and the other CPUs would
have proceeded to perform other actions and the state of the system
is moved by the time we can analyze it.
Provide an option to trigger  a watchdog bite instead so that we
can get the traces as close to the issue as possible.

Change-Id: Ic8d692ebd02c6940a3b4e5798463744db20b0026
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2016-03-22 11:16:31 -07:00
Syed Rameez Mustafa
e2cddd1040 kernel/lib: add additional debug capabilites for data corruption
Data corruptions in the kernel often end up in system crashes that
are easier to debug closer to the time of detection. Specifically,
if we do not panic immediately after lock or list corruptions have been
detected, the problem context is lost in the ensuing system mayhem.
Add support for allowing system crash immediately after such corruptions
are detected. The CONFIG option controls the enabling/disabling of the
feature.

Change-Id: I9b2eb62da506a13007acff63e85e9515145909ff
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[abhimany: minor merge conflict resolution]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2016-03-22 11:16:29 -07:00
Se Wang (Patrick) Oh
8bb334401c kernel: lib: allow larger stack frame size for KASan
Some functions consume more than allowed stack frame
size with KASan enabled and GCC warns it as an error.
To avoid compilation warning, allow larger stack frame
size when KASan is enabled instead of changing each file.

Below is one of the warning messages for reference.
kernel/net/wireless/nl80211.c: In function 'nl80211_send_wiphy':
kernel/net/wireless/nl80211.c:1705:1: warning: the frame size
of 5488 bytes is larger than 2048 bytes [-Wframe-larger-than=]

Change-Id: I953018f459bf048366f0ba5ff7c980edcd9bbe07
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
[satyap: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-03-22 11:10:46 -07:00
Andrey Ryabinin
788349f659 UBSAN: run-time undefined behavior sanity checker
UBSAN uses compile-time instrumentation to catch undefined behavior
(UB).  Compiler inserts code that perform certain kinds of checks before
operations that could cause UB.  If check fails (i.e.  UB detected)
__ubsan_handle_* function called to print error message.

So the most of the work is done by compiler.  This patch just implements
ubsan handlers printing errors.

GCC has this capability since 4.9.x [1] (see -fsanitize=undefined
option and its suboptions).
However GCC 5.x has more checkers implemented [2].
Article [3] has a bit more details about UBSAN in the GCC.

[1] - https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Debugging-Options.html
[2] - https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
[3] - http://developerblog.redhat.com/2014/10/16/gcc-undefined-behavior-sanitizer-ubsan/

Issues which UBSAN has found thus far are:

Found bugs:

 * out-of-bounds access - 97840cb67f ("netfilter: nfnetlink: fix
   insufficient validation in nfnetlink_bind")

undefined shifts:

 * d48458d4a7 ("jbd2: use a better hash function for the revoke
   table")

 * 10632008b9 ("clockevents: Prevent shift out of bounds")

 * 'x << -1' shift in ext4 -
   http://lkml.kernel.org/r/<5444EF21.8020501@samsung.com>

 * undefined rol32(0) -
   http://lkml.kernel.org/r/<1449198241-20654-1-git-send-email-sasha.levin@oracle.com>

 * undefined dirty_ratelimit calculation -
   http://lkml.kernel.org/r/<566594E2.3050306@odin.com>

 * undefined roundown_pow_of_two(0) -
   http://lkml.kernel.org/r/<1449156616-11474-1-git-send-email-sasha.levin@oracle.com>

 * [WONTFIX] undefined shift in __bpf_prog_run -
   http://lkml.kernel.org/r/<CACT4Y+ZxoR3UjLgcNdUm4fECLMx2VdtfrENMtRRCdgHB2n0bJA@mail.gmail.com>

   WONTFIX here because it should be fixed in bpf program, not in kernel.

signed overflows:

 * 32a8df4e0b ("sched: Fix odd values in effective_load()
   calculations")

 * mul overflow in ntp -
   http://lkml.kernel.org/r/<1449175608-1146-1-git-send-email-sasha.levin@oracle.com>

 * incorrect conversion into rtc_time in rtc_time64_to_tm() -
   http://lkml.kernel.org/r/<1449187944-11730-1-git-send-email-sasha.levin@oracle.com>

 * unvalidated timespec in io_getevents() -
   http://lkml.kernel.org/r/<CACT4Y+bBxVYLQ6LtOKrKtnLthqLHcw-BMp3aqP3mjdAvr9FULQ@mail.gmail.com>

 * [NOTABUG] signed overflow in ktime_add_safe() -
   http://lkml.kernel.org/r/<CACT4Y+aJ4muRnWxsUe1CMnA6P8nooO33kwG-c8YZg=0Xc8rJqw@mail.gmail.com>

[akpm@linux-foundation.org: fix unused local warning]
[akpm@linux-foundation.org: fix __int128 build woes]
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Yury Gribov <y.gribov@samsung.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Kostya Serebryany <kcc@google.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
Git-commit: c6d308534aef6c99904bf5862066360ae067abc4
[tsoni@codeaurora.org: trivial merge conflict resolution]
CRs-Fixed: 969533
Change-Id: I048b9936b1120e0d375b7932c59de78d8ef8f411
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
[satyap@codeaurora.org: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-03-22 11:09:57 -07:00
Vignesh Radhakrishnan
07ca3d98c6 kmemleak : Make kmemleak_stack_scan optional using config
Currently we have kmemleak_stack_scan enabled by default.
This can hog the cpu with pre-emption disabled for a long
time starving other tasks.

Make this optional at compile time, since if required
we can always write to sysfs entry and enable this option.

Change-Id: Ie30447861c942337c7ff25ac269b6025a527e8eb
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2016-03-22 11:03:48 -07:00
Vignesh Radhakrishnan
12471ac6f8 kmemleak : Make kmemleak_stack_scan optional using config
Currently we have kmemleak_stack_scan enabled by default.
This can hog the cpu with pre-emption disabled for a long
time starving other tasks.

Make this optional at compile time, since if required
we can always write to sysfs entry and enable this option.

Change-Id: Ie30447861c942337c7ff25ac269b6025a527e8eb
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2016-03-22 11:03:47 -07:00
Sujit Reddy Thumma
956d591558 scsi: ufs: Inject errors to verify error handling
Use fault-injection framework to simulate error conditions
in the controller and verify error handling mechanisms
implemented in UFS host controller driver.

This is used only during development and hence
guarded by CONFIG_UFS_FAULT_INJECTION debug config option.

Change-Id: Ia63c276c5e56d677a92332b42b670300ad82af7a
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22 10:55:56 -07:00
Colin Cross
55d35d82b7 hardlockup: detect hard lockups without NMIs using secondary cpus
Emulate NMIs on systems where they are not available by using timer
interrupts on other cpus.  Each cpu will use its softlockup hrtimer
to check that the next cpu is processing hrtimer interrupts by
verifying that a counter is increasing.

This patch is useful on systems where the hardlockup detector is not
available due to a lack of NMIs, for example most ARM SoCs.
Without this patch any cpu stuck with interrupts disabled can
cause a hardware watchdog reset with no debugging information,
but with this patch the kernel can detect the lockup and panic,
which can result in useful debugging info.

Change-Id: Ia5faf50243e19c1755201212e04c8892d929785a
Signed-off-by: Colin Cross <ccross@android.com>
2016-02-16 13:54:19 -08:00
Linus Torvalds
50c36504fc Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull module updates from Rusty Russell:
 "Nothing exciting, minor tweaks and cleanups"

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  scripts: [modpost] add new sections to white list
  modpost: Add flag -E for making section mismatches fatal
  params: don't ignore the rest of cmdline if parse_one() fails
  modpost: abort if a module symbol is too long
2015-11-09 15:53:39 -08:00
Rasmus Villemoes
707cc7280f test_printf: test printf family at runtime
This adds a simple module for testing the kernel's printf facilities.
Previously, some %p extensions have caused a wrong return value in case
the entire output didn't fit and/or been unusable in kasprintf().  This
should help catch such issues.  Also, it should help ensure that changes
to the formatting algorithms don't break anything.

I'm not sure if we have a struct dentry or struct file lying around at
boot time or if we can fake one, but most %p extensions should be
testable, as should the ordinary number and string formatting.

The nature of vararg functions means we can't use a more conventional
table-driven approach.

For now, this is mostly a skeleton; contributions are very
welcome. Some tests are/will be slightly annoying to write, since the
expected output depends on stuff like CONFIG_*, sizeof(long), runtime
values etc.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Martin Kletzander <mkletzan@redhat.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-11-06 17:50:42 -08:00
Andrey Ryabinin
3f181b4d86 lib/Kconfig.debug: disable -Wframe-larger-than warnings with KASAN=y
When the kernel compiled with KASAN=y, GCC adds redzones for each
variable on stack.  This enlarges function's stack frame and causes:

	'warning: the frame size of X bytes is larger than Y bytes'

The worst case I've seen for now is following:

   ../net/wireless/nl80211.c: In function `nl80211_send_wiphy':
   ../net/wireless/nl80211.c:1731:1: warning: the frame size of 5448 bytes is larger than 2048 bytes [-Wframe-larger-than=]

That kind of warning becomes useless with KASAN=y.  It doesn't
necessarily indicate that there is some problem in the code, thus we
should turn it off.

(The KASAN=y stack size in increased from 16k to 32k for this reason)

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Abylay Ospan <aospan@netup.ru>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Kozlov Sergey <serjk@netup.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-10-23 17:55:10 +09:00
Nicolas Boichat
47490ec141 modpost: Add flag -E for making section mismatches fatal
The section mismatch warning can be easy to miss during the kernel build
process. Allow it to be marked as fatal to be easily caught and prevent
bugs from slipping in.

Setting CONFIG_SECTION_MISMATCH_WARN_ONLY=y causes these warnings to be
non-fatal, since there are a number of section mismatches when using
allmodconfig on some architectures, and we do not want to break these
builds by default.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Change-Id: Ic346706e3297c9f0d790e3552aa94e5cff9897a6
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-06 10:46:21 +10:30
Linus Torvalds
ca520cab25 Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking and atomic updates from Ingo Molnar:
 "Main changes in this cycle are:

   - Extend atomic primitives with coherent logic op primitives
     (atomic_{or,and,xor}()) and deprecate the old partial APIs
     (atomic_{set,clear}_mask())

     The old ops were incoherent with incompatible signatures across
     architectures and with incomplete support.  Now every architecture
     supports the primitives consistently (by Peter Zijlstra)

   - Generic support for 'relaxed atomics':

       - _acquire/release/relaxed() flavours of xchg(), cmpxchg() and {add,sub}_return()
       - atomic_read_acquire()
       - atomic_set_release()

     This came out of porting qwrlock code to arm64 (by Will Deacon)

   - Clean up the fragile static_key APIs that were causing repeat bugs,
     by introducing a new one:

       DEFINE_STATIC_KEY_TRUE(name);
       DEFINE_STATIC_KEY_FALSE(name);

     which define a key of different types with an initial true/false
     value.

     Then allow:

       static_branch_likely()
       static_branch_unlikely()

     to take a key of either type and emit the right instruction for the
     case.  To be able to know the 'type' of the static key we encode it
     in the jump entry (by Peter Zijlstra)

   - Static key self-tests (by Jason Baron)

   - qrwlock optimizations (by Waiman Long)

   - small futex enhancements (by Davidlohr Bueso)

   - ... and misc other changes"

* 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (63 commits)
  jump_label/x86: Work around asm build bug on older/backported GCCs
  locking, ARM, atomics: Define our SMP atomics in terms of _relaxed() operations
  locking, include/llist: Use linux/atomic.h instead of asm/cmpxchg.h
  locking/qrwlock: Make use of _{acquire|release|relaxed}() atomics
  locking/qrwlock: Implement queue_write_unlock() using smp_store_release()
  locking/lockref: Remove homebrew cmpxchg64_relaxed() macro definition
  locking, asm-generic: Add _{relaxed|acquire|release}() variants for 'atomic_long_t'
  locking, asm-generic: Rework atomic-long.h to avoid bulk code duplication
  locking/atomics: Add _{acquire|release|relaxed}() variants of some atomic operations
  locking, compiler.h: Cast away attributes in the WRITE_ONCE() magic
  locking/static_keys: Make verify_keys() static
  jump label, locking/static_keys: Update docs
  locking/static_keys: Provide a selftest
  jump_label: Provide a self-test
  s390/uaccess, locking/static_keys: employ static_branch_likely()
  x86, tsc, locking/static_keys: Employ static_branch_likely()
  locking/static_keys: Add selftest
  locking/static_keys: Add a new static_key interface
  locking/static_keys: Rework update logic
  locking/static_keys: Add static_key_{en,dis}able() helpers
  ...
2015-09-03 15:46:07 -07:00
Paul E. McKenney
8ff4fbfd69 Merge branches 'fixes.2015.07.22a' and 'initexp.2015.08.04a' into HEAD
fixes.2015.07.22a: Miscellaneous fixes.
initexp.2015.08.04a: Initialization and expedited updates.
	(Single branch due to conflicts.)
2015-08-04 08:40:58 -07:00