18 Oct, 2020

4 commits

  • Pull rdma updates from Jason Gunthorpe:
    "A usual cycle for RDMA with a typical mix of driver and core subsystem
    updates:

    - Driver minor changes and bug fixes for mlx5, efa, rxe, vmw_pvrdma,
    hns, usnic, qib, qedr, cxgb4, hns, bnxt_re

    - Various rtrs fixes and updates

    - Bug fix for mlx4 CM emulation for virtualization scenarios where
    MRA wasn't working right

    - Use tracepoints instead of pr_debug in the CM code

    - Scrub the locking in ucma and cma to close more syzkaller bugs

    - Use tasklet_setup in the subsystem

    - Revert the idea that 'destroy' operations are not allowed to fail
    at the driver level. This proved unworkable from a HW perspective.

    - Revise how the umem API works so drivers make fewer mistakes using
    it

    - XRC support for qedr

    - Convert uverbs objects RWQ and MW to new the allocation scheme

    - Large queue entry sizes for hns

    - Use hmm_range_fault() for mlx5 On Demand Paging

    - uverbs APIs to inspect the GID table instead of sysfs

    - Move some of the RDMA code for building large page SGLs into
    lib/scatterlist"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (191 commits)
    RDMA/ucma: Fix use after free in destroy id flow
    RDMA/rxe: Handle skb_clone() failure in rxe_recv.c
    RDMA/rxe: Move the definitions for rxe_av.network_type to uAPI
    RDMA: Explicitly pass in the dma_device to ib_register_device
    lib/scatterlist: Do not limit max_segment to PAGE_ALIGNED values
    IB/mlx4: Convert rej_tmout radix-tree to XArray
    RDMA/rxe: Fix bug rejecting all multicast packets
    RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()
    RDMA/rxe: Remove duplicate entries in struct rxe_mr
    IB/hfi,rdmavt,qib,opa_vnic: Update MAINTAINERS
    IB/rdmavt: Fix sizeof mismatch
    MAINTAINERS: CISCO VIC LOW LATENCY NIC DRIVER
    RDMA/bnxt_re: Fix sizeof mismatch for allocation of pbl_tbl.
    RDMA/bnxt_re: Use rdma_umem_for_each_dma_block()
    RDMA/umem: Move to allocate SG table from pages
    lib/scatterlist: Add support in dynamic allocation of SG table from pages
    tools/testing/scatterlist: Show errors in human readable form
    tools/testing/scatterlist: Rejuvenate bit-rotten test
    RDMA/ipoib: Set rtnl_link_ops for ipoib interfaces
    RDMA/uverbs: Expose the new GID query API to user space
    ...

    Linus Torvalds
     
  • Pull i3c updates from Boris Brezillon:

    - Fix DAA for the pre-reserved address case

    - Fix an error path in the cadence driver

    * tag 'i3c/for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux:
    i3c: master: Fix error return in cdns_i3c_master_probe()
    i3c: master: fix for SETDASA and DAA process
    i3c: master add i3c_master_attach_boardinfo to preserve boardinfo

    Linus Torvalds
     
  • Pull MTD updates from Richard Weinberger:
    "NAND core changes:
    - Drop useless 'depends on' in Kconfig
    - Add an extra level in the Kconfig hierarchy
    - Trivial spellings
    - Dynamic allocation of the interface configurations
    - Dropping the default ONFI timing mode
    - Various cleanup (types, structures, naming, comments)
    - Hide the chip->data_interface indirection
    - Add the generic rb-gpios property
    - Add the ->choose_interface_config() hook
    - Introduce nand_choose_best_sdr_timings()
    - Use default values for tPROG_max and tBERS_max
    - Avoid redefining tR_max and tCCS_min
    - Add a helper to find the closest ONFI mode
    - bcm63xx MTD parsers: simplify CFE detection

    Raw NAND controller drivers changes:
    - fsl-upm: Deprecation of specific DT properties
    - fsl_upm: Driver rework and cleanup in favor of ->exec_op()
    - Ingenic: Cleanup ARRAY_SIZE() vs sizeof() use
    - brcmnand: ECC error handling on EDU transfers
    - brcmnand: Don't default to EDU transfers
    - qcom: Set BAM mode only if not set already
    - qcom: Avoid write to unavailable register
    - gpio: Driver rework in favor of ->exec_op()
    - tango: ->exec_op() conversion
    - mtk: ->exec_op() conversion

    Raw NAND chip drivers changes:
    - toshiba: Implement ->choose_interface_config() for TH58NVG2S3HBAI4
    - toshiba: Implement ->choose_interface_config() for TC58NVG0S3E
    - toshiba: Implement ->choose_interface_config() for TC58TEG5DCLTA00
    - hynix: Implement ->choose_interface_config() for H27UCG8T2ATR-BC

    HyperBus changes:
    - DMA support for TI's AM654 HyperBus controller driver.
    - HyperBus frontend driver for Renesas RPC-IF driver.

    SPI NOR core changes:
    - Support for Winbond w25q64jwm flash
    - Enable 4K sector support for mx25l12805d

    SPI NOR controller drivers changes:
    - intel-spi Add Alder Lake-S PCI ID

    MTD Core changes:
    - mtdoops: Don't run panic write twice
    - mtdconcat: Correctly handle panic write
    - Use DEFINE_SHOW_ATTRIBUTE"

    * tag 'mtd/for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (76 commits)
    mtd: hyperbus: Fix build failure when only RPCIF_HYPERBUS is enabled
    mtd: hyperbus: add Renesas RPC-IF driver
    Revert "mtd: spi-nor: Prefer asynchronous probe"
    mtd: parsers: bcm63xx: Do not make it modular
    mtd: spear_smi: Enable compile testing
    mtd: maps: vmu-flash: fix typos for struct memcard
    mtd: physmap: Add Baikal-T1 physically mapped ROM support
    mtd: maps: vmu-flash: simplify the return expression of probe_maple_vmu
    mtd: onenand: simplify the return expression of onenand_transfer_auto_oob
    mtd: rawnand: cadence: remove a redundant dev_err call
    mtd: rawnand: ams-delta: Fix non-OF build warning
    mtd: rawnand: Don't overwrite the error code from nand_set_ecc_soft_ops()
    mtd: rawnand: Introduce nand_set_ecc_on_host_ops()
    mtd: rawnand: atmel: Check return values for nand_read_data_op
    mtd: rawnand: vf610: Remove unused function vf610_nfc_transfer_size()
    mtd: rawnand: qcom: Simplify with dev_err_probe()
    mtd: rawnand: marvell: Fix and update kerneldoc
    mtd: rawnand: marvell: Simplify with dev_err_probe()
    mtd: rawnand: gpmi: Simplify with dev_err_probe()
    mtd: rawnand: atmel: Simplify with dev_err_probe()
    ...

    Linus Torvalds
     
  • Pull thermal updates from Daniel Lezcano:

    - Fix Kconfig typo "acces" -> "access" (Colin Ian King)

    - Use dev_error_probe() to simplify the error handling on imx and imx8
    platforms (Anson Huang)

    - Use dedicated kobj_to_dev() instead of container_of() in the sysfs
    core code (Tian Tao)

    - Fix coding style by adding braces to a one line conditional statement
    on rcar (Geert Uytterhoeven)

    - Add DT binding documentation for the r8a774e1 platform and update the
    Kconfig description supporting RZ/G2 SoCs (Lad Prabhakar)

    - Simplify the return expression of stm_thermal_prepare on the stm32
    platform (Qinglang Miao)

    - Fix the unit in the function documentation for the idle injection
    cooling device (Zhuguang Qing)

    - Remove an unecessary mutex_init() in the core code (Qinglang Miao)

    - Add support for keep alive events in the core code and the specific
    int340x (Srinivas Pandruvada)

    - Remove unused thermal zone variable in devfreq and cpufreq cooling
    devices (Zhuguang Qing)

    - Add the A100's THS controller support (Yangtao Li)

    - Add power management on the omap3's bandgap sensor (Adam Ford)

    - Fix a missing nlmsg_free in the netlink core error path (Jing
    Xiangfeng)

    * tag 'thermal-v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux:
    thermal: core: Adding missing nlmsg_free() in thermal_genl_sampling_temp()
    thermal: ti-soc-thermal: Enable addition power management
    thermal: sun8i: Add A100's THS controller support
    thermal: sun8i: add TEMP_CALIB_MASK for calibration data in sun50i_h6_ths_calibrate
    dt-bindings: thermal: sun8i: Add binding for A100's THS controller
    thermal: cooling: Remove unused variable *tz
    thermal: int340x: Add keep alive response method
    thermal: core: Add new event for sending keep alive notifications
    thermal: int340x: Provide notification for OEM variable change
    thermal: core: remove unnecessary mutex_init()
    thermal/idle_inject: Fix comment of idle_duration_us and name of latency_ns
    thermal: Kconfig: Update description for RCAR_GEN3_THERMAL config
    thermal: stm32: simplify the return expression of stm_thermal_prepare()
    dt-bindings: thermal: rcar-gen3-thermal: Add r8a774e1 support
    thermal: rcar_thermal: Add missing braces to conditional statement
    thermal: Use kobj_to_dev() instead of container_of()
    thermal: imx8mm: Use dev_err_probe() to simplify error handling
    thermal: imx: Use dev_err_probe() to simplify error handling
    drivers: thermal: Kconfig: fix spelling mistake "acces" -> "access"

    Linus Torvalds
     

17 Oct, 2020

36 commits

  • Pull overlayfs updates from Miklos Szeredi:

    - Improve performance for certain container setups by introducing a
    "volatile" mode

    - ioctl improvements

    - continue preparation for unprivileged overlay mounts

    * tag 'ovl-update-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
    ovl: use generic vfs_ioc_setflags_prepare() helper
    ovl: support [S|G]ETFLAGS and FS[S|G]ETXATTR ioctls for directories
    ovl: rearrange ovl_can_list()
    ovl: enumerate private xattrs
    ovl: pass ovl_fs down to functions accessing private xattrs
    ovl: drop flags argument from ovl_do_setxattr()
    ovl: adhere to the vfs_ vs. ovl_do_ conventions for xattrs
    ovl: use ovl_do_getxattr() for private xattr
    ovl: fold ovl_getxattr() into ovl_get_redirect_xattr()
    ovl: clean up ovl_getxattr() in copy_up.c
    duplicate ovl_getxattr()
    ovl: provide a mount option "volatile"
    ovl: check for incompatible features in work dir

    Linus Torvalds
     
  • Pull afs updates from David Howells:
    "A collection of fixes to fix afs_cell struct refcounting, thereby
    fixing a slew of related syzbot bugs:

    - Fix the cell tree in the netns to use an rwsem rather than RCU.

    There seem to be some problems deriving from the use of RCU and a
    seqlock to walk the rbtree, but it's not entirely clear what since
    there are several different failures being seen.

    Changing things to use an rwsem instead makes it more robust. The
    extra performance derived from using RCU isn't necessary in this
    case since the only time we're looking up a cell is during mount or
    when cells are being manually added.

    - Fix the refcounting by splitting the usage counter into a memory
    refcount and an active users counter. The usage counter was doing
    double duty, keeping track of whether a cell is still in use and
    keeping track of when it needs to be destroyed - but this makes the
    clean up tricky. Separating these out simplifies the logic.

    - Fix purging a cell that has an alias. A cell alias pins the cell
    it's an alias of, but the alias is always later in the list. Trying
    to purge in a single pass causes rmmod to hang in such a case.

    - Fix cell removal. If a cell's manager is requeued whilst it's
    removing itself, the manager will run again and re-remove itself,
    causing problems in various places. Follow Hillf Danton's
    suggestion to insert a more terminal state that causes the manager
    to do nothing post-removal.

    In additional to the above, two other changes:

    - Add a tracepoint for the cell refcount and active users count. This
    helped with debugging the above and may be useful again in future.

    - Downgrade an assertion to a print when a still-active server is
    seen during purging. This was happening as a consequence of
    incomplete cell removal before the servers were cleaned up"

    * tag 'afs-fixes-20201016' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
    afs: Don't assert on unpurgeable server records
    afs: Add tracing for cell refcount and active user count
    afs: Fix cell removal
    afs: Fix cell purging with aliases
    afs: Fix cell refcounting by splitting the usage counter
    afs: Fix rapid cell addition/removal by not using RCU on cells tree

    Linus Torvalds
     
  • Pull f2fs updates from Jaegeuk Kim:
    "In this round, we've added new features such as zone capacity for ZNS
    and a new GC policy, ATGC, along with in-memory segment management. In
    addition, we could improve the decompression speed significantly by
    changing virtual mapping method. Even though we've fixed lots of small
    bugs in compression support, I feel that it becomes more stable so
    that I could give it a try in production.

    Enhancements:
    - suport zone capacity in NVMe Zoned Namespace devices
    - introduce in-memory current segment management
    - add standart casefolding support
    - support age threshold based garbage collection
    - improve decompression speed by changing virtual mapping method

    Bug fixes:
    - fix condition checks in some ioctl() such as compression, move_range, etc
    - fix 32/64bits support in data structures
    - fix memory allocation in zstd decompress
    - add some boundary checks to avoid kernel panic on corrupted image
    - fix disallowing compression for non-empty file
    - fix slab leakage of compressed block writes

    In addition, it includes code refactoring for better readability and
    minor bug fixes for compression and zoned device support"

    * tag 'f2fs-for-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (51 commits)
    f2fs: code cleanup by removing unnecessary check
    f2fs: wait for sysfs kobject removal before freeing f2fs_sb_info
    f2fs: fix writecount false positive in releasing compress blocks
    f2fs: introduce check_swap_activate_fast()
    f2fs: don't issue flush in f2fs_flush_device_cache() for nobarrier case
    f2fs: handle errors of f2fs_get_meta_page_nofail
    f2fs: fix to set SBI_NEED_FSCK flag for inconsistent inode
    f2fs: reject CASEFOLD inode flag without casefold feature
    f2fs: fix memory alignment to support 32bit
    f2fs: fix slab leak of rpages pointer
    f2fs: compress: fix to disallow enabling compress on non-empty file
    f2fs: compress: introduce cic/dic slab cache
    f2fs: compress: introduce page array slab cache
    f2fs: fix to do sanity check on segment/section count
    f2fs: fix to check segment boundary during SIT page readahead
    f2fs: fix uninit-value in f2fs_lookup
    f2fs: remove unneeded parameter in find_in_block()
    f2fs: fix wrong total_sections check and fsmeta check
    f2fs: remove duplicated code in sanity_check_area_boundary
    f2fs: remove unused check on version_bitmap
    ...

    Linus Torvalds
     
  • Pull documentation updates from Mauro Carvalho Chehab:
    "A series of patches addressing warnings produced by make htmldocs.
    This includes:

    - kernel-doc markup fixes

    - ReST fixes

    - Updates at the build system in order to support newer versions of
    the docs build toolchain (Sphinx)

    After this series, the number of html build warnings should reduce
    significantly, and building with Sphinx 3.1 or later should now be
    supported (although it is still recommended to use Sphinx 2.4.4).

    As agreed with Jon, I should be sending you a late pull request by the
    end of the merge window addressing remaining issues with docs build,
    as there are a number of warning fixes that depends on pull requests
    that should be happening along the merge window.

    The end goal is to have a clean htmldocs build on Kernel 5.10.

    PS. It should be noticed that Sphinx 3.0 is not currently supported,
    as it lacks support for C domain namespaces. Such feature, needed in
    order to document uAPI system calls with Sphinx 3.x, was added only on
    Sphinx 3.1"

    * tag 'docs/v5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (75 commits)
    PM / devfreq: remove a duplicated kernel-doc markup
    mm/doc: fix a literal block markup
    workqueue: fix a kernel-doc warning
    docs: virt: user_mode_linux_howto_v2.rst: fix a literal block markup
    Input: sparse-keymap: add a description for @sw
    rcu/tree: docs: document bkvcache new members at struct kfree_rcu_cpu
    nl80211: docs: add a description for s1g_cap parameter
    usb: docs: document altmode register/unregister functions
    kunit: test.h: fix a bad kernel-doc markup
    drivers: core: fix kernel-doc markup for dev_err_probe()
    docs: bio: fix a kerneldoc markup
    kunit: test.h: solve kernel-doc warnings
    block: bio: fix a warning at the kernel-doc markups
    docs: powerpc: syscall64-abi.rst: fix a malformed table
    drivers: net: hamradio: fix document location
    net: appletalk: Kconfig: Fix docs location
    dt-bindings: fix references to files converted to yaml
    memblock: get rid of a :c:type leftover
    math64.h: kernel-docs: Convert some markups into normal comments
    media: uAPI: buffer.rst: remove a left-over documentation
    ...

    Linus Torvalds
     
  • Pull tracing fix from Steven Rostedt:
    "Fix mismatch section of adding early trace events.

    Fixes the issue of a mismatch section that was missed due to gcc
    inlining the offending function, while clang did not (and reported the
    issue)"

    * tag 'trace-v5.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    tracing: Remove __init from __trace_early_add_new_event()

    Linus Torvalds
     
  • Pull printk fix from Petr Mladek:
    "Prevent overflow in the new lockless ringbuffer"

    * tag 'printk-for-5.10-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
    printk: ringbuffer: Wrong data pointer when appending small string

    Linus Torvalds
     
  • Pull kgdb updates from Daniel Thompson:
    "A fairly modest set of changes for this cycle.

    Of particular note are an earlycon fix from Doug Anderson and my own
    changes to get kgdb/kdb to honour the kprobe blocklist. The later
    creates a safety rail that strongly encourages developers not to place
    breakpoints in, for example, arch specific trap handling code.

    Also included are a couple of small fixes and tweaks: an API update,
    eliminate a coverity dead code warning, improved handling of search
    during multi-line printk and a couple of typo corrections"

    * tag 'kgdb-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux:
    kdb: Fix pager search for multi-line strings
    kernel: debug: Centralize dbg_[de]activate_sw_breakpoints
    kgdb: Add NOKPROBE labels on the trap handler functions
    kgdb: Honour the kprobe blocklist when setting breakpoints
    kernel/debug: Fix spelling mistake in debug_core.c
    kdb: Use newer api for tasklist scanning
    kgdb: Make "kgdbcon" work properly with "kgdb_earlycon"
    kdb: remove unnecessary null check of dbg_io_ops

    Linus Torvalds
     
  • Pull MIPS updates from Thomas Bogendoerfer:

    - removed support for PNX833x alias NXT_STB22x

    - included Ingenic SoC support into generic MIPS kernels

    - added support for new Ingenic SoCs

    - converted workaround selection to use Kconfig

    - replaced old boot mem functions by memblock_*

    - enabled COP2 usage in kernel for Loongson64 to make use
    of 16byte load/stores possible

    - cleanups and fixes

    * tag 'mips_5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (92 commits)
    MIPS: DEC: Restore bootmem reservation for firmware working memory area
    MIPS: dec: fix section mismatch
    bcm963xx_tag.h: fix duplicated word
    mips: ralink: enable zboot support
    MIPS: ingenic: Remove CPU_SUPPORTS_HUGEPAGES
    MIPS: cpu-probe: remove MIPS_CPU_BP_GHIST option bit
    MIPS: cpu-probe: introduce exclusive R3k CPU probe
    MIPS: cpu-probe: move fpu probing/handling into its own file
    MIPS: replace add_memory_region with memblock
    MIPS: Loongson64: Clean up numa.c
    MIPS: Loongson64: Select SMP in Kconfig to avoid build error
    mips: octeon: Add Ubiquiti E200 and E220 boards
    MIPS: SGI-IP28: disable use of ll/sc in kernel
    MIPS: tx49xx: move tx4939_add_memory_regions into only user
    MIPS: pgtable: Remove used PAGE_USERIO define
    MIPS: alchemy: Share prom_init implementation
    MIPS: alchemy: Fix build breakage, if TOUCHSCREEN_WM97XX is disabled
    MIPS: process: include exec.h header in process.c
    MIPS: process: Add prototype for function arch_dup_task_struct
    MIPS: idle: Add prototype for function check_wait
    ...

    Linus Torvalds
     
  • Pull s390 updates from Vasily Gorbik:

    - Remove address space overrides using set_fs()

    - Convert to generic vDSO

    - Convert to generic page table dumper

    - Add ARCH_HAS_DEBUG_WX support

    - Add leap seconds handling support

    - Add NVMe firmware-assisted kernel dump support

    - Extend NVMe boot support with memory clearing control and addition of
    kernel parameters

    - AP bus and zcrypt api code rework. Add adapter configure/deconfigure
    interface. Extend debug features. Add failure injection support

    - Add ECC secure private keys support

    - Add KASan support for running protected virtualization host with
    4-level paging

    - Utilize destroy page ultravisor call to speed up secure guests
    shutdown

    - Implement ioremap_wc() and ioremap_prot() with MIO in PCI code

    - Various checksum improvements

    - Other small various fixes and improvements all over the code

    * tag 's390-5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (85 commits)
    s390/uaccess: fix indentation
    s390/uaccess: add default cases for __put_user_fn()/__get_user_fn()
    s390/zcrypt: fix wrong format specifications
    s390/kprobes: move insn_page to text segment
    s390/sie: fix typo in SIGP code description
    s390/lib: fix kernel doc for memcmp()
    s390/zcrypt: Introduce Failure Injection feature
    s390/zcrypt: move ap_msg param one level up the call chain
    s390/ap/zcrypt: revisit ap and zcrypt error handling
    s390/ap: Support AP card SCLP config and deconfig operations
    s390/sclp: Add support for SCLP AP adapter config/deconfig
    s390/ap: add card/queue deconfig state
    s390/ap: add error response code field for ap queue devices
    s390/ap: split ap queue state machine state from device state
    s390/zcrypt: New config switch CONFIG_ZCRYPT_DEBUG
    s390/zcrypt: introduce msg tracking in zcrypt functions
    s390/startup: correct early pgm check info formatting
    s390: remove orphaned extern variables declarations
    s390/kasan: make sure int handler always run with DAT on
    s390/ipl: add support to control memory clearing for nvme re-IPL
    ...

    Linus Torvalds
     
  • Pull powerpc updates from Michael Ellerman:

    - A series from Nick adding ARCH_WANT_IRQS_OFF_ACTIVATE_MM & selecting
    it for powerpc, as well as a related fix for sparc.

    - Remove support for PowerPC 601.

    - Some fixes for watchpoints & addition of a new ptrace flag for
    detecting ISA v3.1 (Power10) watchpoint features.

    - A fix for kernels using 4K pages and the hash MMU on bare metal
    Power9 systems with > 16TB of RAM, or RAM on the 2nd node.

    - A basic idle driver for shallow stop states on Power10.

    - Tweaks to our sched domains code to better inform the scheduler about
    the hardware topology on Power9/10, where two SMT4 cores can be
    presented by firmware as an SMT8 core.

    - A series doing further reworks & cleanups of our EEH code.

    - Addition of a filter for RTAS (firmware) calls done via sys_rtas(),
    to prevent root from overwriting kernel memory.

    - Other smaller features, fixes & cleanups.

    Thanks to: Alexey Kardashevskiy, Andrew Donnellan, Aneesh Kumar K.V,
    Athira Rajeev, Biwen Li, Cameron Berkenpas, Cédric Le Goater, Christophe
    Leroy, Christoph Hellwig, Colin Ian King, Daniel Axtens, David Dai, Finn
    Thain, Frederic Barrat, Gautham R. Shenoy, Greg Kurz, Gustavo Romero,
    Ira Weiny, Jason Yan, Joel Stanley, Jordan Niethe, Kajol Jain, Konrad
    Rzeszutek Wilk, Laurent Dufour, Leonardo Bras, Liu Shixin, Luca
    Ceresoli, Madhavan Srinivasan, Mahesh Salgaonkar, Nathan Lynch, Nicholas
    Mc Guire, Nicholas Piggin, Nick Desaulniers, Oliver O'Halloran, Pedro
    Miraglia Franco de Carvalho, Pratik Rajesh Sampat, Qian Cai, Qinglang
    Miao, Ravi Bangoria, Russell Currey, Satheesh Rajendran, Scott Cheloha,
    Segher Boessenkool, Srikar Dronamraju, Stan Johnson, Stephen Kitt,
    Stephen Rothwell, Thiago Jung Bauermann, Tyrel Datwyler, Vaibhav Jain,
    Vaidyanathan Srinivasan, Vasant Hegde, Wang Wensheng, Wolfram Sang, Yang
    Yingliang, zhengbin.

    * tag 'powerpc-5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (228 commits)
    Revert "powerpc/pci: unmap legacy INTx interrupts when a PHB is removed"
    selftests/powerpc: Fix eeh-basic.sh exit codes
    cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier
    powerpc/time: Make get_tb() common to PPC32 and PPC64
    powerpc/time: Make get_tbl() common to PPC32 and PPC64
    powerpc/time: Remove get_tbu()
    powerpc/time: Avoid using get_tbl() and get_tbu() internally
    powerpc/time: Make mftb() common to PPC32 and PPC64
    powerpc/time: Rename mftbl() to mftb()
    powerpc/32s: Remove #ifdef CONFIG_PPC_BOOK3S_32 in head_book3s_32.S
    powerpc/32s: Rename head_32.S to head_book3s_32.S
    powerpc/32s: Setup the early hash table at all time.
    powerpc/time: Remove ifdef in get_dec() and set_dec()
    powerpc: Remove get_tb_or_rtc()
    powerpc: Remove __USE_RTC()
    powerpc: Tidy up a bit after removal of PowerPC 601.
    powerpc: Remove support for PowerPC 601
    powerpc: Remove PowerPC 601
    powerpc: Drop SYNC_601() ISYNC_601() and SYNC()
    powerpc: Remove CONFIG_PPC601_SYNC_FIX
    ...

    Linus Torvalds
     
  • Merge more updates from Andrew Morton:
    "155 patches.

    Subsystems affected by this patch series: mm (dax, debug, thp,
    readahead, page-poison, util, memory-hotplug, zram, cleanups), misc,
    core-kernel, get_maintainer, MAINTAINERS, lib, bitops, checkpatch,
    binfmt, ramfs, autofs, nilfs, rapidio, panic, relay, kgdb, ubsan,
    romfs, and fault-injection"

    * emailed patches from Andrew Morton : (155 commits)
    lib, uaccess: add failure injection to usercopy functions
    lib, include/linux: add usercopy failure capability
    ROMFS: support inode blocks calculation
    ubsan: introduce CONFIG_UBSAN_LOCAL_BOUNDS for Clang
    sched.h: drop in_ubsan field when UBSAN is in trap mode
    scripts/gdb/tasks: add headers and improve spacing format
    scripts/gdb/proc: add struct mount & struct super_block addr in lx-mounts command
    kernel/relay.c: drop unneeded initialization
    panic: dump registers on panic_on_warn
    rapidio: fix the missed put_device() for rio_mport_add_riodev
    rapidio: fix error handling path
    nilfs2: fix some kernel-doc warnings for nilfs2
    autofs: harden ioctl table
    ramfs: fix nommu mmap with gaps in the page cache
    mm: remove the now-unnecessary mmget_still_valid() hack
    mm/gup: take mmap_lock in get_dump_page()
    binfmt_elf, binfmt_elf_fdpic: use a VMA list snapshot
    coredump: rework elf/elf_fdpic vma_dump_size() into common helper
    coredump: refactor page range dumping into common helper
    coredump: let dump_emit() bail out on short writes
    ...

    Linus Torvalds
     
  • To test fault-tolerance of user memory access functions, introduce fault
    injection to usercopy functions.

    If a failure is expected return either -EFAULT or the total amount of
    bytes that were not copied.

    Signed-off-by: Albert van der Linde
    Signed-off-by: Andrew Morton
    Reviewed-by: Akinobu Mita
    Reviewed-by: Alexander Potapenko
    Cc: Al Viro
    Cc: Andrey Konovalov
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Dmitry Vyukov
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Jonathan Corbet
    Cc: Marco Elver
    Cc: Peter Zijlstra (Intel)
    Cc: Thomas Gleixner
    Cc: Christoph Hellwig
    Link: http://lkml.kernel.org/r/20200831171733.955393-3-alinde@google.com
    Signed-off-by: Linus Torvalds

    Albert van der Linde
     
  • Patch series "add fault injection to user memory access", v3.

    The goal of this series is to improve testing of fault-tolerance in usages
    of user memory access functions, by adding support for fault injection.

    syzkaller/syzbot are using the existing fault injection modes and will use
    this particular feature also.

    The first patch adds failure injection capability for usercopy functions.
    The second changes usercopy functions to use this new failure capability
    (copy_from_user, ...). The third patch adds get/put/clear_user failures
    to x86.

    This patch (of 3):

    Add a failure injection capability to improve testing of fault-tolerance
    in usages of user memory access functions.

    Add CONFIG_FAULT_INJECTION_USERCOPY to enable faults in usercopy
    functions. The should_fail_usercopy function is to be called by these
    functions (copy_from_user, get_user, ...) in order to fail or not.

    Signed-off-by: Albert van der Linde
    Signed-off-by: Andrew Morton
    Reviewed-by: Akinobu Mita
    Reviewed-by: Alexander Potapenko
    Cc: Borislav Petkov
    Cc: Ingo Molnar
    Cc: Jonathan Corbet
    Cc: Thomas Gleixner
    Cc: Arnd Bergmann
    Cc: Peter Zijlstra (Intel)
    Cc: "H. Peter Anvin"
    Cc: Al Viro
    Cc: Andrey Konovalov
    Cc: Dmitry Vyukov
    Cc: Marco Elver
    Cc: Christoph Hellwig
    Link: http://lkml.kernel.org/r/20200831171733.955393-1-alinde@google.com
    Link: http://lkml.kernel.org/r/20200831171733.955393-2-alinde@google.com
    Signed-off-by: Linus Torvalds

    Albert van der Linde
     
  • When use 'stat' tool to display file status, the 'Blocks' field always in
    '0', this is not good for tool 'du'(e.g.: busybox 'du'), it always output
    '0' size for the files under ROMFS since such tool calculates number of
    512B Blocks.

    This patch calculates approx. number of 512B blocks based on inode size.

    Signed-off-by: Libing Zhou
    Signed-off-by: Andrew Morton
    Cc: David Howells
    Cc: Al Viro
    Link: http://lkml.kernel.org/r/20200811052606.4243-1-libing.zhou@nokia-sbell.com
    Signed-off-by: Linus Torvalds

    Libing Zhou
     
  • When the kernel is compiled with Clang, -fsanitize=bounds expands to
    -fsanitize=array-bounds and -fsanitize=local-bounds.

    Enabling -fsanitize=local-bounds with Clang has the unfortunate
    side-effect of inserting traps; this goes back to its original intent,
    which was as a hardening and not a debugging feature [1]. The same
    feature made its way into -fsanitize=bounds, but the traps remained. For
    that reason, -fsanitize=bounds was split into 'array-bounds' and
    'local-bounds' [2].

    Since 'local-bounds' doesn't behave like a normal sanitizer, enable it
    with Clang only if trapping behaviour was requested by
    CONFIG_UBSAN_TRAP=y.

    Add the UBSAN_BOUNDS_LOCAL config to Kconfig.ubsan to enable the
    'local-bounds' option by default when UBSAN_TRAP is enabled.

    [1] http://lists.llvm.org/pipermail/llvm-dev/2012-May/049972.html
    [2] http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20131021/091536.html

    Suggested-by: Marco Elver
    Signed-off-by: George Popescu
    Signed-off-by: Andrew Morton
    Reviewed-by: David Brazdil
    Reviewed-by: Marco Elver
    Cc: Masahiro Yamada
    Cc: Michal Marek
    Cc: Nathan Chancellor
    Cc: Nick Desaulniers
    Cc: Kees Cook
    Cc: Dmitry Vyukov
    Cc: Arnd Bergmann
    Cc: Peter Zijlstra
    Link: https://lkml.kernel.org/r/20200922074330.2549523-1-georgepope@google.com
    Signed-off-by: Linus Torvalds

    George Popescu
     
  • in_ubsan field of task_struct is only used in lib/ubsan.c, which in its
    turn is used only `ifneq ($(CONFIG_UBSAN_TRAP),y)`.

    Removing unnecessary field from a task_struct will help preserve the ABI
    between vanilla and CONFIG_UBSAN_TRAP'ed kernels. In particular, this
    will help enabling bounds sanitizer transparently for Android's GKI.

    Signed-off-by: Elena Petrova
    Signed-off-by: Andrew Morton
    Acked-by: Kees Cook
    Cc: Jann Horn
    Link: https://lkml.kernel.org/r/20200910134802.3160311-1-lenaptr@google.com
    Signed-off-by: Linus Torvalds

    Elena Petrova
     
  • With the patch.

    TASK PID COMM
    0xffffffff82c2b8c0 0 swapper/0
    0xffff888a0ba20040 1 systemd
    0xffff888a0ba24040 2 kthreadd
    0xffff888a0ba28040 3 rcu_gp

    w/o
    0xffffffff82c2b8c0 0 swapper/0
    0xffff888a0ba20040 1 systemd
    0xffff888a0ba24040 2 kthreadd
    0xffff888a0ba28040 3 rcu_gp

    Signed-off-by: Ritesh Harjani
    Signed-off-by: Andrew Morton
    Reviewed-by: Jan Kiszka
    Cc: Kieran Bingham
    Link: http://lkml.kernel.org/r/54c868c79b5fc364a8be7799891934a6fe6d1464.1597742951.git.riteshh@linux.ibm.com
    Signed-off-by: Linus Torvalds

    Ritesh Harjani
     
  • This is many times found useful while debugging some FS related
    issue.

    mount super_block devname pathname fstype options
    0xffff888a0bfa4b40 0xffff888a0bfc1000 none / rootfs rw 0 0
    0xffff888a033f75c0 0xffff8889fcf65000 /dev/root / ext4 rw,relatime 0 0
    0xffff8889fc8ce040 0xffff888a0bb51000 devtmpfs /dev devtmpfs rw,relatime 0 0

    Signed-off-by: Ritesh Harjani
    Signed-off-by: Andrew Morton
    Reviewed-by: Jan Kiszka
    Cc: Kieran Bingham
    Link: http://lkml.kernel.org/r/a3c4177e1597b3e06d66d55e07d72c0c46a03571.1597742951.git.riteshh@linux.ibm.com
    Signed-off-by: Linus Torvalds

    Ritesh Harjani
     
  • The variable 'consumed' is initialized with the consumed count but
    immediately after that the consumed count is updated and assigned to
    'consumed' again thus overwriting the previous value. So, drop the
    unneeded initialization.

    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Andrew Morton
    Reviewed-by: Andrew Morton
    Link: https://lkml.kernel.org/r/20201005205727.1147-1-sudipm.mukherjee@gmail.com
    Signed-off-by: Linus Torvalds

    Sudip Mukherjee
     
  • Currently we print stack and registers for ordinary warnings but we do not
    for panic_on_warn which looks as oversight - panic() will reboot the
    machine but won't print registers.

    This moves printing of registers and modules earlier.

    This does not move the stack dumping as panic() dumps it.

    Signed-off-by: Alexey Kardashevskiy
    Signed-off-by: Andrew Morton
    Reviewed-by: Kees Cook
    Cc: Douglas Anderson
    Cc: Ingo Molnar
    Cc: Kees Cook
    Cc: Rafael Aquini
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: Nicholas Piggin
    Link: https://lkml.kernel.org/r/20200804095054.68724-1-aik@ozlabs.ru
    Signed-off-by: Linus Torvalds

    Alexey Kardashevskiy
     
  • rio_mport_add_riodev() misses to call put_device() when the device already
    exists. Add the missed function call to fix it.

    Fixes: e8de370188d0 ("rapidio: add mport char device driver")
    Signed-off-by: Jing Xiangfeng
    Signed-off-by: Andrew Morton
    Reviewed-by: Dan Carpenter
    Cc: Matt Porter
    Cc: Alexandre Bounine
    Cc: Gustavo A. R. Silva
    Cc: John Hubbard
    Cc: Kees Cook
    Cc: Madhuparna Bhowmik
    Link: https://lkml.kernel.org/r/20200922072525.42330-1-jingxiangfeng@huawei.com
    Signed-off-by: Linus Torvalds

    Jing Xiangfeng
     
  • rio_dma_transfer() attempts to clamp the return value of
    pin_user_pages_fast() to be >= 0. However, the attempt fails because
    nr_pages is overridden a few lines later, and restored to the undesirable
    -ERRNO value.

    The return value is ultimately stored in nr_pages, which in turn is passed
    to unpin_user_pages(), which expects nr_pages >= 0, else, disaster.

    Fix this by fixing the nesting of the assignment to nr_pages: nr_pages
    should be clamped to zero if pin_user_pages_fast() returns -ERRNO, or set
    to the return value of pin_user_pages_fast(), otherwise.

    [jhubbard@nvidia.com: new changelog]

    Fixes: e8de370188d09 ("rapidio: add mport char device driver")
    Signed-off-by: Souptick Joarder
    Signed-off-by: Andrew Morton
    Reviewed-by: Ira Weiny
    Reviewed-by: John Hubbard
    Cc: Matthew Wilcox
    Cc: Matt Porter
    Cc: Alexandre Bounine
    Cc: Gustavo A. R. Silva
    Cc: Madhuparna Bhowmik
    Cc: Dan Carpenter
    Link: https://lkml.kernel.org/r/1600227737-20785-1-git-send-email-jrdr.linux@gmail.com
    Signed-off-by: Linus Torvalds

    Souptick Joarder
     
  • Fixes the following W=1 kernel build warning(s):

    fs/nilfs2/bmap.c:378: warning: Excess function parameter 'bhp' description in 'nilfs_bmap_assign'
    fs/nilfs2/cpfile.c:907: warning: Excess function parameter 'status' description in 'nilfs_cpfile_change_cpmode'
    fs/nilfs2/cpfile.c:946: warning: Excess function parameter 'stat' description in 'nilfs_cpfile_get_stat'
    fs/nilfs2/page.c:76: warning: Excess function parameter 'inode' description in 'nilfs_forget_buffer'
    fs/nilfs2/sufile.c:563: warning: Excess function parameter 'stat' description in 'nilfs_sufile_get_stat'

    Signed-off-by: Wang Hai
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Link: https://lkml.kernel.org/r/1601386269-2423-1-git-send-email-konishi.ryusuke@gmail.com
    Signed-off-by: Linus Torvalds

    Wang Hai
     
  • The table of ioctl functions should be marked const in order to put them
    in read-only memory, and we should use array_index_nospec() to avoid
    speculation disclosing the contents of kernel memory to userspace.

    Signed-off-by: Matthew Wilcox (Oracle)
    Signed-off-by: Andrew Morton
    Acked-by: Ian Kent
    Link: https://lkml.kernel.org/r/20200818122203.GO17456@casper.infradead.org
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     
  • ramfs needs to check that pages are both physically contiguous and
    contiguous in the file. If the page cache happens to have, eg, page A for
    index 0 of the file, no page for index 1, and page A+1 for index 2, then
    an mmap of the first two pages of the file will succeed when it should
    fail.

    Fixes: 642fb4d1f1dd ("[PATCH] NOMMU: Provide shared-writable mmap support on ramfs")
    Signed-off-by: Matthew Wilcox (Oracle)
    Signed-off-by: Andrew Morton
    Cc: David Howells
    Link: https://lkml.kernel.org/r/20200914122239.GO6583@casper.infradead.org
    Signed-off-by: Linus Torvalds

    Matthew Wilcox (Oracle)
     
  • The preceding patches have ensured that core dumping properly takes the
    mmap_lock. Thanks to that, we can now remove mmget_still_valid() and all
    its users.

    Signed-off-by: Jann Horn
    Signed-off-by: Andrew Morton
    Acked-by: Linus Torvalds
    Cc: Christoph Hellwig
    Cc: Alexander Viro
    Cc: "Eric W . Biederman"
    Cc: Oleg Nesterov
    Cc: Hugh Dickins
    Link: http://lkml.kernel.org/r/20200827114932.3572699-8-jannh@google.com
    Signed-off-by: Linus Torvalds

    Jann Horn
     
  • Properly take the mmap_lock before calling into the GUP code from
    get_dump_page(); and play nice, allowing the GUP code to drop the
    mmap_lock if it has to sleep.

    As Linus pointed out, we don't actually need the VMA because
    __get_user_pages() will flush the dcache for us if necessary.

    Signed-off-by: Jann Horn
    Signed-off-by: Andrew Morton
    Acked-by: Linus Torvalds
    Cc: Christoph Hellwig
    Cc: Alexander Viro
    Cc: "Eric W . Biederman"
    Cc: Oleg Nesterov
    Cc: Hugh Dickins
    Link: http://lkml.kernel.org/r/20200827114932.3572699-7-jannh@google.com
    Signed-off-by: Linus Torvalds

    Jann Horn
     
  • In both binfmt_elf and binfmt_elf_fdpic, use a new helper
    dump_vma_snapshot() to take a snapshot of the VMA list (including the gate
    VMA, if we have one) while protected by the mmap_lock, and then use that
    snapshot instead of walking the VMA list without locking.

    An alternative approach would be to keep the mmap_lock held across the
    entire core dumping operation; however, keeping the mmap_lock locked while
    we may be blocked for an unbounded amount of time (e.g. because we're
    dumping to a FUSE filesystem or so) isn't really optimal; the mmap_lock
    blocks things like the ->release handler of userfaultfd, and we don't
    really want critical system daemons to grind to a halt just because
    someone "gifted" them SCM_RIGHTS to an eternally-locked userfaultfd, or
    something like that.

    Since both the normal ELF code and the FDPIC ELF code need this
    functionality (and if any other binfmt wants to add coredump support in
    the future, they'd probably need it, too), implement this with a common
    helper in fs/coredump.c.

    A downside of this approach is that we now need a bigger amount of kernel
    memory per userspace VMA in the normal ELF case, and that we need O(n)
    kernel memory in the FDPIC ELF case at all; but 40 bytes per VMA shouldn't
    be terribly bad.

    There currently is a data race between stack expansion and anything that
    reads ->vm_start or ->vm_end under the mmap_lock held in read mode; to
    mitigate that for core dumping, take the mmap_lock in write mode when
    taking a snapshot of the VMA hierarchy. (If we only took the mmap_lock in
    read mode, we could end up with a corrupted core dump if someone does
    get_user_pages_remote() concurrently. Not really a major problem, but
    taking the mmap_lock either way works here, so we might as well avoid the
    issue.) (This doesn't do anything about the existing data races with stack
    expansion in other mm code.)

    Signed-off-by: Jann Horn
    Signed-off-by: Andrew Morton
    Acked-by: Linus Torvalds
    Cc: Christoph Hellwig
    Cc: Alexander Viro
    Cc: "Eric W . Biederman"
    Cc: Oleg Nesterov
    Cc: Hugh Dickins
    Link: http://lkml.kernel.org/r/20200827114932.3572699-6-jannh@google.com
    Signed-off-by: Linus Torvalds

    Jann Horn
     
  • At the moment, the binfmt_elf and binfmt_elf_fdpic code have slightly
    different code to figure out which VMAs should be dumped, and if so,
    whether the dump should contain the entire VMA or just its first page.

    Eliminate duplicate code by reworking the binfmt_elf version into a
    generic core dumping helper in coredump.c.

    As part of that, change the heuristic for detecting executable/library
    header pages to check whether the inode is executable instead of looking
    at the file mode.

    This is less problematic in terms of locking because it lets us avoid
    get_user() under the mmap_sem. (And arguably it looks nicer and makes
    more sense in generic code.)

    Adjust a little bit based on the binfmt_elf_fdpic version: ->anon_vma is
    only meaningful under CONFIG_MMU, otherwise we have to assume that the VMA
    has been written to.

    Suggested-by: Linus Torvalds
    Signed-off-by: Jann Horn
    Signed-off-by: Andrew Morton
    Acked-by: Linus Torvalds
    Cc: Christoph Hellwig
    Cc: Alexander Viro
    Cc: "Eric W . Biederman"
    Cc: Oleg Nesterov
    Cc: Hugh Dickins
    Link: http://lkml.kernel.org/r/20200827114932.3572699-5-jannh@google.com
    Signed-off-by: Linus Torvalds

    Jann Horn
     
  • Both fs/binfmt_elf.c and fs/binfmt_elf_fdpic.c need to dump ranges of
    pages into the coredump file. Extract that logic into a common helper.

    Signed-off-by: Jann Horn
    Signed-off-by: Andrew Morton
    Acked-by: Linus Torvalds
    Cc: Christoph Hellwig
    Cc: Alexander Viro
    Cc: "Eric W . Biederman"
    Cc: Oleg Nesterov
    Cc: Hugh Dickins
    Link: http://lkml.kernel.org/r/20200827114932.3572699-4-jannh@google.com
    Signed-off-by: Linus Torvalds

    Jann Horn
     
  • dump_emit() has a retry loop, but there seems to be no way for that retry
    logic to actually be used; and it was also buggy, writing the same data
    repeatedly after a short write.

    Let's just bail out on a short write.

    Suggested-by: Linus Torvalds
    Signed-off-by: Jann Horn
    Signed-off-by: Andrew Morton
    Acked-by: Linus Torvalds
    Cc: Christoph Hellwig
    Cc: Alexander Viro
    Cc: "Eric W . Biederman"
    Cc: Oleg Nesterov
    Cc: Hugh Dickins
    Link: http://lkml.kernel.org/r/20200827114932.3572699-3-jannh@google.com
    Signed-off-by: Linus Torvalds

    Jann Horn
     
  • Patch series "Fix ELF / FDPIC ELF core dumping, and use mmap_lock properly in there", v5.

    At the moment, we have that rather ugly mmget_still_valid() helper to work
    around : ELF core dumping doesn't
    take the mmap_sem while traversing the task's VMAs, and if anything (like
    userfaultfd) then remotely messes with the VMA tree, fireworks ensue. So
    at the moment we use mmget_still_valid() to bail out in any writers that
    might be operating on a remote mm's VMAs.

    With this series, I'm trying to get rid of the need for that as cleanly as
    possible. ("cleanly" meaning "avoid holding the mmap_lock across
    unbounded sleeps".)

    Patches 1, 2, 3 and 4 are relatively unrelated cleanups in the core
    dumping code.

    Patches 5 and 6 implement the main change: Instead of repeatedly accessing
    the VMA list with sleeps in between, we snapshot it at the start with
    proper locking, and then later we just use our copy of the VMA list. This
    ensures that the kernel won't crash, that VMA metadata in the coredump is
    consistent even in the presence of concurrent modifications, and that any
    virtual addresses that aren't being concurrently modified have their
    contents show up in the core dump properly.

    The disadvantage of this approach is that we need a bit more memory during
    core dumping for storing metadata about all VMAs.

    At the end of the series, patch 7 removes the old workaround for this
    issue (mmget_still_valid()).

    I have tested:

    - Creating a simple core dump on X86-64 still works.
    - The created coredump on X86-64 opens in GDB and looks plausible.
    - X86-64 core dumps contain the first page for executable mappings at
    offset 0, and don't contain the first page for non-executable file
    mappings or executable mappings at offset !=0.
    - NOMMU 32-bit ARM can still generate plausible-looking core dumps
    through the FDPIC implementation. (I can't test this with GDB because
    GDB is missing some structure definition for nommu ARM, but I've
    poked around in the hexdump and it looked decent.)

    This patch (of 7):

    dump_emit() is for kernel pointers, and VMAs describe userspace memory.
    Let's be tidy here and avoid accessing userspace pointers under KERNEL_DS,
    even if it probably doesn't matter much on !MMU systems - especially given
    that it looks like we can just use the same get_dump_page() as on MMU if
    we move it out of the CONFIG_MMU block.

    One small change we have to make in get_dump_page() is to use
    __get_user_pages_locked() instead of __get_user_pages(), since the latter
    doesn't exist on nommu. On mmu builds, __get_user_pages_locked() will
    just call __get_user_pages() for us.

    Signed-off-by: Jann Horn
    Signed-off-by: Andrew Morton
    Acked-by: Linus Torvalds
    Cc: Christoph Hellwig
    Cc: Alexander Viro
    Cc: "Eric W . Biederman"
    Cc: Oleg Nesterov
    Cc: Hugh Dickins
    Link: http://lkml.kernel.org/r/20200827114932.3572699-1-jannh@google.com
    Link: http://lkml.kernel.org/r/20200827114932.3572699-2-jannh@google.com
    Signed-off-by: Linus Torvalds

    Jann Horn
     
  • This produces a PIE binary with a variety of p_align requirements,
    suitable for verifying that the load address meets that alignment
    requirement.

    Signed-off-by: Chris Kennelly
    Signed-off-by: Andrew Morton
    Cc: Shuah Khan
    Cc: Alexander Viro
    Cc: Alexey Dobriyan
    Cc: David Rientjes
    Cc: Fangrui Song
    Cc: Hugh Dickens
    Cc: Ian Rogers
    Cc: "Kirill A. Shutemov"
    Cc: Mike Kravetz
    Cc: Nick Desaulniers
    Cc: Sandeep Patil
    Cc: Song Liu
    Cc: Suren Baghdasaryan
    Link: https://lkml.kernel.org/r/20200820170541.1132271-3-ckennelly@google.com
    Link: https://lkml.kernel.org/r/20200821233848.3904680-3-ckennelly@google.com
    Signed-off-by: Linus Torvalds

    Chris Kennelly
     
  • Patch series "Selecting Load Addresses According to p_align", v3.

    The current ELF loading mechancism provides page-aligned mappings. This
    can lead to the program being loaded in a way unsuitable for file-backed,
    transparent huge pages when handling PIE executables.

    While specifying -z,max-page-size=0x200000 to the linker will generate
    suitably aligned segments for huge pages on x86_64, the executable needs
    to be loaded at a suitably aligned address as well. This alignment
    requires the binary's cooperation, as distinct segments need to be
    appropriately paddded to be eligible for THP.

    For binaries built with increased alignment, this limits the number of
    bits usable for ASLR, but provides some randomization over using fixed
    load addresses/non-PIE binaries.

    This patch (of 2):

    The current ELF loading mechancism provides page-aligned mappings. This
    can lead to the program being loaded in a way unsuitable for file-backed,
    transparent huge pages when handling PIE executables.

    For binaries built with increased alignment, this limits the number of
    bits usable for ASLR, but provides some randomization over using fixed
    load addresses/non-PIE binaries.

    Tested by verifying program with -Wl,-z,max-page-size=0x200000 loading.

    [akpm@linux-foundation.org: fix max() warning]
    [ckennelly@google.com: augment comment]
    Link: https://lkml.kernel.org/r/20200821233848.3904680-2-ckennelly@google.com

    Signed-off-by: Chris Kennelly
    Signed-off-by: Andrew Morton
    Cc: Alexander Viro
    Cc: Alexey Dobriyan
    Cc: Song Liu
    Cc: David Rientjes
    Cc: Ian Rogers
    Cc: Hugh Dickens
    Cc: Suren Baghdasaryan
    Cc: Sandeep Patil
    Cc: Fangrui Song
    Cc: Nick Desaulniers
    Cc: "Kirill A. Shutemov"
    Cc: Mike Kravetz
    Cc: Shuah Khan
    Link: https://lkml.kernel.org/r/20200820170541.1132271-1-ckennelly@google.com
    Link: https://lkml.kernel.org/r/20200820170541.1132271-2-ckennelly@google.com
    Signed-off-by: Linus Torvalds

    Chris Kennelly
     
  • The author signed-off-by checks are currently very vague. Cases like same
    name or same address are not handled separately.

    For example, running checkpatch on commit be6577af0cef ("parisc: Add
    atomic64_set_release() define to avoid CPU soft lockups"), gives:

    WARNING: Missing Signed-off-by: line by nominal patch author
    'John David Anglin '

    The signoff line was:
    "Signed-off-by: Dave Anglin "

    Clearly the author has signed off but with a slightly different version
    of his name. A more appropriate warning would have been to point out
    at the name mismatch instead.

    Previously, the values assumed by $authorsignoff were either 0 or 1
    to indicate whether a proper sign off by author is present.
    Extended the checks to handle four new cases.

    $authorsignoff values now denote the following:

    0: Missing sign off by patch author.

    1: Sign off present and identical.

    2: Addresses and names match, but comments differ.
    "James Watson(JW) ", "James Watson "

    3: Addresses match, but names are different.
    "James Watson ", "James "

    4: Names match, but addresses are different.
    "James Watson ", "James Watson "

    5: Names match, addresses excluding subaddress details (RFC 5233) match.
    "James Watson ", "James Watson "

    Also introduced a new message type FROM_SIGN_OFF_MISMATCH
    for cases 2, 3, 4 and 5.

    Suggested-by: Joe Perches
    Signed-off-by: Dwaipayan Ray
    Signed-off-by: Andrew Morton
    Acked-by: Joe Perches
    Link: https://lore.kernel.org/linux-kernel-mentees/c1ca28e77e8e3bfa7aadf3efa8ed70f97a9d369c.camel@perches.com/
    Link: https://lkml.kernel.org/r/20201007192029.551744-1-dwaipayanray1@gmail.com
    Signed-off-by: Linus Torvalds

    Dwaipayan Ray
     
  • To avoid false positives in presence of SPDX-License-Identifier in
    networking files it is required to increase the leeway for empty block
    comment lines by one line.

    For example, checking drivers/net/loopback.c which starts with

    // SPDX-License-Identifier: GPL-2.0-or-later
    /*
    * INET An implementation of the TCP/IP protocol suite for the LINUX

    rsults in an unnecessary warning

    WARNING: networking block comments don't use an empty /* line, use /* Comment...
    +/*
    + * INET An implementation of the TCP/IP protocol suite for the LINUX

    Signed-off-by: Łukasz Stelmach
    Signed-off-by: Andrew Morton
    Acked-by: Joe Perches
    Cc: Bartłomiej Żolnierkiewicz
    Cc: Marek Szyprowski
    Link: https://lkml.kernel.org/r/20201006083509.19934-1-l.stelmach@samsung.com
    Signed-off-by: Linus Torvalds

    Łukasz Stelmach