Commit Graph

23 Commits

Author SHA1 Message Date
Li Li
d7f76d7aaf BACKPORT: FROMGIT: Binder: add TF_UPDATE_TXN to replace outdated txn
When the target process is busy, incoming oneway transactions are
queued in the async_todo list. If the clients continue sending extra
oneway transactions while the target process is frozen, this queue can
become too large to accommodate new transactions. That's why binder
driver introduced ONEWAY_SPAM_DETECTION to detect this situation. It's
helpful to debug the async binder buffer exhausting issue, but the
issue itself isn't solved directly.

In real cases applications are designed to send oneway transactions
repeatedly, delivering updated inforamtion to the target process.
Typical examples are Wi-Fi signal strength and some real time sensor
data. Even if the apps might only care about the lastet information,
all outdated oneway transactions are still accumulated there until the
frozen process is thawed later. For this kind of situations, there's
no existing method to skip those outdated transactions and deliver the
latest one only.

This patch introduces a new transaction flag TF_UPDATE_TXN. To use it,
use apps can set this new flag along with TF_ONE_WAY. When such an
oneway transaction is to be queued into the async_todo list of a frozen
process, binder driver will check if any previous pending transactions
can be superseded by comparing their code, flags and target node. If
such an outdated pending transaction is found, the latest transaction
will supersede that outdated one. This effectively prevents the async
binder buffer running out and saves unnecessary binder read workloads.

Acked-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Li Li <dualli@google.com>
Link: https://lore.kernel.org/r/20220526220018.3334775-2-dualli@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 231624308
Test: manually check async binder buffer size of frozen apps
Test: stress test with kernel 4.14/4.19/5.10/5.15
(cherry picked from commit 9864bb4801331daa48514face9d0f4861e4d485b
 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
  char-misc-next)
Change-Id: I1c4bff1eda1ca15aaaad5bf696c8fc00be743176
2022-07-12 04:15:34 +00:00
Lucas Wei
a452d64169 Merge android-4.19-stable (4.19.239) into android-msm-pixel-4.19-lts
Merge 4.19.239 into android-4.19-stable
Linux 4.19.239
    i2c: pasemi: Wait for write xfers to finish
  * smp: Fix offline cpu check in flush_smp_call_function_queue()
      kernel/smp.c
    ARM: davinci: da850-evm: Avoid NULL pointer dereference
  * ipv6: fix panic when forwarding a pkt with no in6 dev
      net/ipv6/ip6_output.c
  * ALSA: pcm: Test for "silence" field in struct "pcm_format_data"
      sound/core/pcm_misc.c
    ALSA: hda/realtek: Add quirk for Clevo PD50PNT
    gcc-plugins: latent_entropy: use /dev/urandom
    mm: kmemleak: take a full lowmem check in kmemleak_*_phys()
  * mm, page_alloc: fix build_zonerefs_node()
      mm/page_alloc.c
    drivers: net: slip: fix NPD bug in sl_tx_timeout()
    scsi: mvsas: Add PCI ID of RocketRaid 2640
    drm/amd/display: Fix allocate_mst_payload assert on resume
  * arm64: alternatives: mark patch_alternative() as `noinstr`
      arch/arm64/kernel/alternative.c
    gpu: ipu-v3: Fix dev_dbg frequency output
    ata: libata-core: Disable READ LOG DMA EXT for Samsung 840 EVOs
  * net: micrel: fix KS8851_MLL Kconfig
      drivers/net/ethernet/micrel/Kconfig
    scsi: ibmvscsis: Increase INITIAL_SRP_LIMIT to 1024
    scsi: target: tcmu: Fix possible page UAF
    Drivers: hv: vmbus: Prevent load re-ordering when reading ring buffer
    drm/amdkfd: Check for potential null return of kmalloc_array()
    drm/amd: Add USBC connector ID
    cifs: potential buffer overflow in handling symlinks
    nfc: nci: add flush_workqueue to prevent uaf
    testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu set
  * sctp: Initialize daddr on peeled off socket
      net/sctp/socket.c
    net: ethernet: stmmac: fix altr_tse_pcs function when using a fixed-link
    mlxsw: i2c: Fix initialization error flow
    gpiolib: acpi: use correct format characters
  * veth: Ensure eth header is in skb's linear part
      drivers/net/veth.c
  * net/sched: flower: fix parsing of ethertype following VLAN header
      include/net/flow_dissector.h
      net/core/flow_dissector.c
    memory: atmel-ebi: Fix missing of_node_put in atmel_ebi_probe
  * ANDROID: GKI: fix crc issue with commit 6281beee5b ("block: don't merge across cgroup boundaries if blkcg is enabled")
      block/blk-merge.c
      include/linux/blk-cgroup.h
  * Revert "PCI: Reduce warnings on possible RW1C corruption"
      drivers/pci/access.c
      include/linux/pci.h
    Merge 4.19.238 into android-4.19-stable
Linux 4.19.238
    drm/amdkfd: Use drm_priv to pass VM from KFD to amdgpu
    drm/amdgpu: Check if fd really is an amdgpu fd.
  * xfrm: policy: match with both mark and mask on user interfaces
      include/net/xfrm.h
      net/key/af_key.c
      net/xfrm/xfrm_policy.c
      net/xfrm/xfrm_user.c
    selftests: cgroup: Test open-time cgroup namespace usage for migration checks
    selftests: cgroup: Test open-time credential usage for migration checks
    selftests: cgroup: Make cg_create() use 0755 for permission instead of 0644
  * cgroup: Use open-time cgroup namespace for process migration perm checks
      kernel/cgroup/cgroup-internal.h
      kernel/cgroup/cgroup.c
  * cgroup: Allocate cgroup_file_ctx for kernfs_open_file->priv
      kernel/cgroup/cgroup-internal.h
      kernel/cgroup/cgroup-v1.c
      kernel/cgroup/cgroup.c
  * cgroup: Use open-time credentials for process migraton perm checks
      kernel/cgroup/cgroup-v1.c
      kernel/cgroup/cgroup.c
  * mm/sparsemem: fix 'mem_section' will never be NULL gcc 12 warning
      include/linux/mmzone.h
  * arm64: module: remove (NOLOAD) from linker script
      arch/arm64/kernel/module.lds
  * mm: don't skip swap entry even if zap_details specified
      mm/memory.c
    dmaengine: Revert "dmaengine: shdma: Fix runtime PM imbalance on error"
    tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts
    tools build: Filter out options and warnings not supported by clang
  * irqchip/gic-v3: Fix GICR_CTLR.RWP polling
      drivers/irqchip/irq-gic-v3.c
    perf: qcom_l2_pmu: fix an incorrect NULL check on list iterator
    ata: sata_dwc_460ex: Fix crash due to OOB write
  * arm64: patch_text: Fixup last cpu should be master
      arch/arm64/kernel/insn.c
    btrfs: fix qgroup reserve overflow the qgroup limit
    x86/speculation: Restore speculation related MSRs during S3 resume
    x86/pm: Save the MSR validity status at context setup
    mm/mempolicy: fix mpol_new leak in shared_policy_replace
  * mmmremap.c: avoid pointless invalidate_range_start/end on mremap(old_size=0)
      mm/mremap.c
    mmc: renesas_sdhi: don't overwrite TAP settings when HS400 tuning is complete
    Revert "mmc: sdhci-xenon: fix annoying 1.8V regulator warning"
    drbd: Fix five use after free bugs in get_initial_state
    spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op()
    qede: confirm skb is allocated before using
    rxrpc: fix a race in rxrpc_exit_net()
    net: openvswitch: don't send internal clone attribute to the userspace.
    drm/imx: Fix memory leak in imx_pd_connector_get_modes
    net: stmmac: Fix unset max_speed difference between DT and non-DT platforms
    scsi: zorro7xx: Fix a resource leak in zorro7xx_remove_one()
    Drivers: hv: vmbus: Fix potential crash on module unload
    drm/amdgpu: fix off by one in amdgpu_gfx_kiq_acquire()
  * KVM: arm64: Check arm64_get_bp_hardening_data() didn't return NULL
      arch/arm64/include/asm/kvm_mmu.h
  * mm: fix race between MADV_FREE reclaim and blkdev direct IO read
      mm/rmap.c
  * net: add missing SOF_TIMESTAMPING_OPT_ID support
      include/net/sock.h
      net/ipv4/raw.c
      net/ipv6/raw.c
      net/packet/af_packet.c
    parisc: Fix CPU affinity for Lasi, WAX and Dino chips
    jfs: prevent NULL deref in diFree
    virtio_console: eliminate anonymous module_init & module_exit
    serial: samsung_tty: do not unlock port->lock for uart_write_wakeup()
    NFS: swap-out must always use STABLE writes.
  * NFS: swap IO handling is slightly different for O_DIRECT IO
      include/linux/nfs_fs.h
    SUNRPC/call_alloc: async tasks mustn't block waiting for memory
  * clk: Enforce that disjoints limits are invalid
      drivers/clk/clk.c
    xen: delay xen_hvm_init_time_ops() if kdump is boot on vcpu>=32
    NFSv4: Protect the state recovery thread against direct reclaim
    w1: w1_therm: fixes w1_seq for ds28ea00 sensors
    minix: fix bug when opening a file with O_DIRECT
  * init/main.c: return 1 from handled __setup() functions
      init/main.c
  * Bluetooth: Fix use after free in hci_send_acl
      net/bluetooth/hci_event.c
    xtensa: fix DTC warning unit_address_format
    usb: dwc3: omap: fix "unbalanced disables for smps10_out1" on omap5evm
    scsi: libfc: Fix use after free in fc_exch_abts_resp()
    MIPS: fix fortify panic when copying asm exception handlers
    bnxt_en: Eliminate unintended link toggle during FW reset
    macvtap: advertise link netns via netlink
    net/smc: correct settings of RMB window update limit
    scsi: aha152x: Fix aha152x_setup() __setup handler return value
    scsi: pm8001: Fix pm8001_mpi_task_abort_resp()
    drm/amdkfd: make CRAT table missing message informational only
  * dm ioctl: prevent potential spectre v1 gadget
      drivers/md/dm-ioctl.c
  * ipv4: Invalidate neighbour for broadcast address upon address addition
      include/net/arp.h
      net/ipv4/arp.c
      net/ipv4/fib_frontend.c
    PCI: pciehp: Add Qualcomm quirk for Command Completed erratum
  * usb: ehci: add pci device support for Aspeed platforms
      drivers/usb/host/ehci-pci.c
    iommu/arm-smmu-v3: fix event handling soft lockup
    PCI: aardvark: Fix support for MSI interrupts
    powerpc: Set crashkernel offset to mid of RMA region
    power: supply: axp20x_battery: properly report current when discharging
    scsi: bfa: Replace snprintf() with sysfs_emit()
    scsi: mvsas: Replace snprintf() with sysfs_emit()
    powerpc: dts: t104xrdb: fix phy type for FMAN 4/5
  * ptp: replace snprintf with sysfs_emit
      drivers/ptp/ptp_sysfs.c
    drm/amd/amdgpu/amdgpu_cs: fix refcount leak of a dma_fence obj
    ath5k: fix OOB in ath5k_eeprom_read_pcal_info_5111
  * drm: Add orientation quirk for GPD Win Max
      drivers/gpu/drm/drm_panel_orientation_quirks.c
    KVM: x86/svm: Clear reserved bits written to PerfEvtSeln MSRs
    ARM: 9187/1: JIVE: fix return value of __setup handler
    riscv module: remove (NOLOAD)
    rtc: wm8350: Handle error for wm8350_register_irq
    ubifs: Rectify space amount budget for mkdir/tmpfile operations
    KVM: x86: Forbid VMM to set SYNIC/STIMER MSRs when SynIC wasn't activated
    openvswitch: Fixed nd target mask field in the flow dump.
    um: Fix uml_mconsole stop/go
    ARM: dts: spear13xx: Update SPI dma properties
    ARM: dts: spear1340: Update serial node properties
    ASoC: topology: Allow TLV control to be either read or write
    ubi: fastmap: Return error code if memory allocation fails in add_aeb()
  * bpf: Fix comment for helper bpf_current_task_under_cgroup()
      include/uapi/linux/bpf.h
  * mm/usercopy: return 1 from hardened_usercopy __setup() handler
      mm/usercopy.c
  * mm/memcontrol: return 1 from cgroup.memory __setup() handler
      mm/memcontrol.c
  * mm/mmap: return 1 from stack_guard_gap __setup() handler
      mm/mmap.c
    ACPI: CPPC: Avoid out of bounds access when parsing _CPC data
    ubi: Fix race condition between ctrl_cdev_ioctl and ubi_cdev_ioctl
  * pinctrl: pinconf-generic: Print arguments for bias-pull-*
      drivers/pinctrl/pinconf-generic.c
    gfs2: Make sure FITRIM minlen is rounded up to fs block size
    can: mcba_usb: properly check endpoint type
    can: mcba_usb: mcba_usb_start_xmit(): fix double dev_kfree_skb in error path
    ubifs: rename_whiteout: correct old_dir size computing
    ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock()
    ubifs: setflags: Make dirtied_ino_d 8 bytes aligned
    ubifs: Add missing iput if do_tmpfile() failed in rename whiteout
    ubifs: Fix deadlock in concurrent rename whiteout and inode writeback
    ubifs: rename_whiteout: Fix double free for whiteout_ui->data
    KVM: x86: fix sending PV IPI
    KVM: Prevent module exit until all VMs are freed
    scsi: qla2xxx: Use correct feature type field during RFF_ID processing
    scsi: qla2xxx: Reduce false trigger to login
    scsi: qla2xxx: Fix hang due to session stuck
    scsi: qla2xxx: Fix incorrect reporting of task management failure
    scsi: qla2xxx: Suppress a kernel complaint in qla_create_qpair()
    scsi: qla2xxx: Check for firmware dump already collected
    scsi: qla2xxx: Fix warning for missing error code
    scsi: qla2xxx: Fix stuck session in gpdb
    powerpc: Fix build errors with newer binutils
    powerpc/lib/sstep: Fix build errors with newer binutils
    powerpc/lib/sstep: Fix 'sthcx' instruction
    mmc: host: Return an error when ->enable_sdio_irq() ops is missing
    media: hdpvr: initialize dev->worker at hdpvr_register_videodev
    media: Revert "media: em28xx: add missing em28xx_close_extension"
    video: fbdev: sm712fb: Fix crash in smtcfb_write()
    ARM: mmp: Fix failure to remove sram device
    ARM: tegra: tamonten: Fix I2C3 pad setting
    media: cx88-mpeg: clear interrupt status register before streaming video
  * ASoC: soc-core: skip zero num_dai component in searching dai name
      sound/soc/soc-core.c
    video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit
    video: fbdev: omapfb: panel-tpo-td043mtea1: Use sysfs_emit() instead of snprintf()
    video: fbdev: omapfb: panel-dsi-cm: Use sysfs_emit() instead of snprintf()
    ARM: dts: bcm2837: Add the missing L1/L2 cache information
    ARM: dts: qcom: fix gic_irq_domain_translate warnings for msm8960
    video: fbdev: omapfb: acx565akm: replace snprintf with sysfs_emit
    video: fbdev: cirrusfb: check pixclock to avoid divide by zero
    video: fbdev: w100fb: Reset global state
    video: fbdev: nvidiafb: Use strscpy() to prevent buffer overflow
    ntfs: add sanity check on allocation size
  * ext4: don't BUG if someone dirty pages without asking ext4 first
      fs/ext4/inode.c
    spi: tegra20: Use of_device_get_match_data()
  * PM: core: keep irq flags in device_pm_check_callbacks()
      drivers/base/power/main.c
    ACPI/APEI: Limit printable size of BERT table data
    Revert "Revert "block, bfq: honor already-setup queue merges""
    lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3
    ACPICA: Avoid walking the ACPI Namespace if it is not there
    bfq: fix use-after-free in bfq_dispatch_request
    irqchip/nvic: Release nvic_base upon failure
  * irqchip/qcom-pdc: Fix broken locking
      drivers/irqchip/qcom-pdc.c
    Fix incorrect type in assignment of ipv6 port for audit
  * loop: use sysfs_emit() in the sysfs xxx show()
      drivers/block/loop.c
    selinux: use correct type for context length
    lib/test: use after free in register_test_dev_kmod()
    NFSv4/pNFS: Fix another issue with a list iterator pointing to the head
    net/x25: Fix null-ptr-deref caused by x25_disconnect
    qlcnic: dcb: default to returning -EOPNOTSUPP
    net: phy: broadcom: Fix brcm_fet_config_init()
    xen: fix is_xen_pmu()
    clk: qcom: gcc-msm8994: Fix gpll4 width
  * netfilter: nf_conntrack_tcp: preserve liberal flag in tcp options
      net/netfilter/nf_conntrack_proto_tcp.c
    jfs: fix divide error in dbNextAG
    kgdbts: fix return value of __setup handler
    kgdboc: fix return value of __setup handler
    tty: hvc: fix return value of __setup handler
    pinctrl/rockchip: Add missing of_node_put() in rockchip_pinctrl_probe
    pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe
    pinctrl: mediatek: Fix missing of_node_put() in mtk_pctrl_init
    NFS: remove unneeded check in decode_devicenotify_args()
    clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver
    clk: clps711x: Terminate clk_div_table with sentinel element
    clk: loongson1: Terminate clk_div_table with sentinel element
    clk: actions: Terminate clk_div_table with sentinel element
    remoteproc: qcom_wcnss: Add missing of_node_put() in wcnss_alloc_memory_region
  * clk: qcom: clk-rcg2: Update the frac table for pixel clock
      drivers/clk/qcom/clk-rcg2.c
    dma-debug: fix return value of __setup handlers
    iio: adc: Add check for devm_request_threaded_irq
    serial: 8250: Fix race condition in RTS-after-send handling
    serial: 8250_mid: Balance reference count for PCI DMA device
    clk: qcom: ipq8074: Use floor ops for SDCC1 clock
    staging:iio:adc:ad7280a: Fix handing of device address bit reversing.
    pwm: lpc18xx-sct: Initialize driver data and hardware before pwmchip_add()
    mxser: fix xmit_buf leak in activate when LSR == 0xff
    mfd: asic3: Add missing iounmap() on error asic3_mfd_probe
  * tcp: ensure PMTU updates are processed during fastopen
      net/ipv4/tcp_output.c
    selftests/bpf/test_lirc_mode2.sh: Exit with proper code
    i2c: mux: demux-pinctrl: do not deactivate a master that is not active
  * af_netlink: Fix shift out of bounds in group mask calculation
      net/netlink/af_netlink.c
    USB: storage: ums-realtek: fix error code in rts51x_read_mem()
    mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init
    MIPS: RB532: fix return value of __setup handler
    vxcan: enable local echo for sent CAN frames
    mfd: mc13xxx: Add check for mc13xxx_irq_request
    powerpc/sysdev: fix incorrect use to determine if list is empty
  * PCI: Reduce warnings on possible RW1C corruption
      drivers/pci/access.c
      include/linux/pci.h
    power: supply: wm8350-power: Add missing free in free_charger_irq
    power: supply: wm8350-power: Handle error for wm8350_register_irq
    i2c: xiic: Make bus names unique
    hv_balloon: rate-limit "Unhandled message" warning
    KVM: x86/emulator: Defer not-present segment check in __load_segment_descriptor()
    KVM: x86: Fix emulation in writing cr8
    powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit
    drm/bridge: cdns-dsi: Make sure to to create proper aliases for dt
    power: supply: bq24190_charger: Fix bq24190_vbus_is_enabled() wrong false return
    drm/tegra: Fix reference leak in tegra_dsi_ganged_probe
    ext2: correct max file size computing
    TOMOYO: fix __setup handlers return values
    scsi: pm8001: Fix abort all task initialization
    scsi: pm8001: Fix payload initialization in pm80xx_set_thermal_config()
    scsi: pm8001: Fix command initialization in pm8001_chip_ssp_tm_req()
    scsi: pm8001: Fix command initialization in pm80XX_send_read_log()
    dm crypt: fix get_key_size compiler warning if !CONFIG_KEYS
    iwlwifi: Fix -EIO error code that is never returned
    HID: i2c-hid: fix GET/SET_REPORT for unnumbered reports
    power: supply: ab8500: Fix memory leak in ab8500_fg_sysfs_init
    ray_cs: Check ioremap return value
    power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe
    KVM: PPC: Fix vmx/vsx mixup in mmio emulation
    ath9k_htc: fix uninit value bugs
    drm/amd/display: Fix a NULL pointer dereference in amdgpu_dm_connector_add_common_modes()
  * drm/edid: Don't clear formats if using deep color
      drivers/gpu/drm/drm_edid.c
    mtd: onenand: Check for error irq
    Bluetooth: hci_serdev: call init_rwsem() before p->open()
    ath10k: fix memory overwrite of the WoWLAN wakeup packet pattern
    drm/bridge: Fix free wrong object in sii8620_init_rcp_input_dev
    mmc: davinci_mmc: Handle error for clk_enable
    ASoC: msm8916-wcd-digital: Fix missing clk_disable_unprepare() in msm8916_wcd_digital_probe
    ASoC: imx-es8328: Fix error return code in imx_es8328_probe()
    ASoC: mxs: Fix error handling in mxs_sgtl5000_probe
    ASoC: dmaengine: do not use a NULL prepare_slave_config() callback
    video: fbdev: omapfb: Add missing of_node_put() in dvic_probe_of
    ASoC: fsi: Add check for clk_enable
    ASoC: wm8350: Handle error for wm8350_register_irq
    ASoC: atmel: Add missing of_node_put() in at91sam9g20ek_audio_probe
    media: stk1160: If start stream fails, return buffers with VB2_BUF_STATE_QUEUED
    ALSA: firewire-lib: fix uninitialized flag for AV/C deferred transaction
    memory: emif: check the pointer temp in get_device_details()
    memory: emif: Add check for setup_interrupts
    ASoC: atmel_ssc_dai: Handle errors for clk_enable
    ASoC: mxs-saif: Handle errors for clk_enable
  * printk: fix return value of printk.devkmsg __setup handler
      kernel/printk/printk.c
    arm64: dts: broadcom: Fix sata nodename
    arm64: dts: ns2: Fix spi-cpol and spi-cpha property
    ALSA: spi: Add check for clk_enable()
    ASoC: ti: davinci-i2s: Add check for clk_enable()
    ASoC: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp()
    media: usb: go7007: s2250-board: fix leak in probe()
    media: em28xx: initialize refcount before kref_get
    soc: ti: wkup_m3_ipc: Fix IRQ check in wkup_m3_ipc_probe
    ARM: dts: qcom: ipq4019: fix sleep clock
    video: fbdev: fbcvt.c: fix printing in fb_cvt_print_name()
    video: fbdev: smscufx: Fix null-ptr-deref in ufx_usb_probe()
    media: coda: Fix missing put_device() call in coda_get_vdoa_data
    perf/x86/intel/pt: Fix address filter config for 32-bit kernel
  * perf/core: Fix address filter parser for multiple filters
      kernel/events/core.c
  * sched/debug: Remove mpol_get/put and task_lock/unlock from sched_show_numa
      kernel/sched/debug.c
    clocksource: acpi_pm: fix return value of __setup handler
    hwmon: (pmbus) Add Vin unit off handling
    crypto: ccp - ccp_dmaengine_unregister release dma channels
    ACPI: APEI: fix return value of __setup handlers
  * clocksource/drivers/timer-of: Check return value of of_iomap in timer_of_base_init()
      drivers/clocksource/timer-of.c
  * crypto: vmx - add missing dependencies
      drivers/crypto/vmx/Kconfig
    hwrng: atmel - disable trng on failure path
    PM: suspend: fix return value of __setup handler
    PM: hibernate: fix __setup handler error handling
  * block: don't delete queue kobject before its children
      block/blk-sysfs.c
    hwmon: (sch56xx-common) Replace WDOG_ACTIVE with WDOG_HW_RUNNING
    hwmon: (pmbus) Add mutex to regulator ops
    spi: pxa2xx-pci: Balance reference count for PCI DMA device
    selftests/x86: Add validity check and allow field splitting
    spi: tegra114: Add missing IRQ check in tegra_spi_probe
    crypto: mxs-dcp - Fix scatterlist processing
  * crypto: authenc - Fix sleep in atomic context in decrypt_tail
      crypto/authenc.c
    regulator: qcom_smd: fix for_each_child.cocci warnings
    PCI: pciehp: Clear cmd_busy bit in polling mode
    brcmfmac: pcie: Replace brcmf_pcie_copy_mem_todev with memcpy_toio
    brcmfmac: firmware: Allocate space for default boardrev in nvram
    media: davinci: vpif: fix unbalanced runtime PM get
    DEC: Limit PMAX memory probing to R3k systems
    lib/raid6/test: fix multiple definition linking error
    thermal: int340x: Increase bitmap size
    carl9170: fix missing bit-wise or operator for tx_params
    ARM: dts: exynos: add missing HDMI supplies on SMDK5420
    ARM: dts: exynos: add missing HDMI supplies on SMDK5250
    ARM: dts: exynos: fix UART3 pins configuration in Exynos5250
    ARM: dts: at91: sama5d2: Fix PMERRLOC resource size
    video: fbdev: atari: Atari 2 bpp (STe) palette bugfix
    video: fbdev: sm712fb: Fix crash in smtcfb_read()
  * drm/edid: check basic audio support on CEA extension block
      drivers/gpu/drm/drm_edid.c
  * block: don't merge across cgroup boundaries if blkcg is enabled
      block/blk-merge.c
      include/linux/blk-cgroup.h
    drivers: hamradio: 6pack: fix UAF bug caused by mod_timer()
    ACPI: properties: Consistently return -ENOENT if there are no more references
    powerpc/kvm: Fix kvm_use_magic_page
    drbd: fix potential silent data corruption
  * mm,hwpoison: unmap poisoned page before invalidation
      mm/memory.c
    ALSA: hda/realtek: Fix audio regression on Mi Notebook Pro 2020
    ALSA: cs4236: fix an incorrect NULL check on list iterator
  * Revert "Input: clear BTN_RIGHT/MIDDLE on buttonpads"
      drivers/input/input.c
    qed: validate and restrict untrusted VFs vlan promisc mode
    qed: display VF trust config
    scsi: libsas: Fix sas_ata_qc_issue() handling of NCQ NON DATA commands
    mempolicy: mbind_range() set_policy() after vma_merge()
  * mm: invalidate hwpoison page cache page in fault path
      mm/memory.c
  * mm/pages_alloc.c: don't create ZONE_MOVABLE beyond the end of a node
      mm/page_alloc.c
    jffs2: fix memory leak in jffs2_scan_medium
    jffs2: fix memory leak in jffs2_do_mount_fs
    jffs2: fix use-after-free in jffs2_clear_xattr_subsystem
    can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path
    pinctrl: samsung: drop pin banks references on error paths
  * f2fs: fix to unlock page correctly in error path of is_alive()
      fs/f2fs/gc.c
  * NFSD: prevent integer overflow on 32 bit systems
      include/linux/sunrpc/xdr.h
    NFSD: prevent underflow in nfssvc_decode_writeargs()
    SUNRPC: avoid race between mod_timer() and del_timer_sync()
    Documentation: update stable tree link
    Documentation: add link to stable release candidate tree
  * ptrace: Check PTRACE_O_SUSPEND_SECCOMP permission on PTRACE_SEIZE
      kernel/ptrace.c
    clk: uniphier: Fix fixed-rate initialization
  * iio: inkern: make a best effort on offset calculation
      drivers/iio/inkern.c
  * iio: inkern: apply consumer scale when no channel scale is available
      drivers/iio/inkern.c
  * iio: inkern: apply consumer scale on IIO_VAL_INT cases
      drivers/iio/inkern.c
    iio: afe: rescale: use s64 for temporary scale calculations
  * coresight: Fix TRCCONFIGR.QE sysfs interface
      drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
  * xhci: make xhci_handshake timeout for xhci_reset() adjustable
      drivers/usb/host/xhci-hub.c
      drivers/usb/host/xhci-mem.c
      drivers/usb/host/xhci.c
      drivers/usb/host/xhci.h
    USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c
    virtio-blk: Use blk_validate_block_size() to validate block size
  * block: Add a helper to validate the block size
      include/linux/blkdev.h
    tpm: fix reference counting for struct tpm_chip
  * fuse: fix pipe buffer lifetime for direct_io
      fs/fuse/dev.c
      fs/fuse/file.c
      fs/fuse/fuse_i.h
  * af_key: add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register
      net/key/af_key.c
  * spi: Fix erroneous sgs value with min_t()
      drivers/spi/spi.c
    net:mcf8390: Use platform_get_irq() to get the interrupt
  * spi: Fix invalid sgs value
      drivers/spi/spi.c
    ethernet: sun: Free the coherent when failing in probing
    virtio_console: break out of buf poll on remove
  * xfrm: fix tunnel model fragmentation behavior
      net/ipv6/xfrm6_output.c
      net/xfrm/xfrm_interface.c
  * netdevice: add the case if dev is NULL
      include/linux/netdevice.h
  * USB: serial: simple: add Nokia phone driver
      drivers/usb/serial/Kconfig
    USB: serial: pl2303: add IBM device IDs
  * ANDROID: incremental-fs: limit mount stack depth
      fs/incfs/data_mgmt.h
      fs/incfs/vfs.c
  * UPSTREAM: binderfs: use __u32 for device numbers
      include/uapi/linux/android/binderfs.h
    Revert "ANDROID: dm-bow: Protect Ranges fetched and erased from the RB tree"
    Merge 4.19.237 into android-4.19-stable
Linux 4.19.237
    llc: only change llc->dev when bind() succeeds
    nds32: fix access_ok() checks in get/put_user
    mac80211: fix potential double free on mesh join
    crypto: qat - disable registration of algorithms
    ACPI: video: Force backlight native for Clevo NL5xRU and NL5xNU
    ACPI: battery: Add device HID and quirk for Microsoft Surface Go 3
    ACPI / x86: Work around broken XSDT on Advantech DAC-BJ01 board
    netfilter: nf_tables: initialize registers in nft_do_chain()
    drivers: net: xgene: Fix regression in CRC stripping
    ALSA: pci: fix reading of swapped values from pcmreg in AC97 codec
    ALSA: cmipci: Restore aux vol on suspend/resume
  * ALSA: usb-audio: Add mute TLV for playback volumes on RODE NT-USB
      sound/usb/mixer_quirks.c
  * ALSA: pcm: Add stream lock during PCM reset ioctl operations
      sound/core/pcm_native.c
    ALSA: oss: Fix PCM OSS buffer allocation overflow
    ASoC: sti: Fix deadlock via snd_pcm_stop_xrun() call
    llc: fix netdevice reference leaks in llc_ui_bind()
    thermal: int340x: fix memory leak in int3400_notify()
    staging: fbtft: fb_st7789v: reset display before initialization
  * esp: Fix possible buffer overflow in ESP transformation
      include/net/esp.h
      include/net/sock.h
      net/core/sock.c
      net/ipv4/esp4.c
      net/ipv6/esp6.c
  * net: ipv6: fix skb_over_panic in __ip6_append_data
      net/ipv6/ip6_output.c
    nfc: st21nfca: Fix potential buffer overflows in EVT_TRANSACTION
    Merge 4.19.236 into android-4.19-stable
Linux 4.19.236
    perf symbols: Fix symbol size calculation condition
  * Input: aiptek - properly check endpoint type
      drivers/input/tablet/aiptek.c
  * usb: gadget: Fix use-after-free bug by not setting udc->dev.driver
      drivers/usb/gadget/udc/core.c
  * usb: gadget: rndis: prevent integer overflow in rndis_set_response()
      drivers/usb/gadget/function/rndis.c
    net: dsa: Add missing of_node_put() in dsa_port_parse_of
  * net: handle ARPHRD_PIMREG in dev_is_mac_header_xmit()
      include/linux/if_arp.h
    drm/panel: simple: Fix Innolux G070Y2-L01 BPP settings
    hv_netvsc: Add check for kvmalloc_array
    atm: eni: Add check for dma_map_single
  * net/packet: fix slab-out-of-bounds access in packet_recvmsg()
      net/packet/af_packet.c
    efi: fix return value of __setup handlers
    ocfs2: fix crash when initialize filecheck kobj fails
    crypto: qcom-rng - ensure buffer for generate is completely filled
  * arm64: Use the clearbhb instruction in mitigations
      arch/arm64/include/asm/assembler.h
      arch/arm64/include/asm/cpufeature.h
      arch/arm64/include/asm/sysreg.h
      arch/arm64/include/asm/vectors.h
      arch/arm64/kernel/cpu_errata.c
      arch/arm64/kernel/cpufeature.c
      arch/arm64/kernel/entry.S
  * arm64: add ID_AA64ISAR2_EL1 sys register
      arch/arm64/include/asm/cpu.h
      arch/arm64/include/asm/sysreg.h
      arch/arm64/kernel/cpufeature.c
      arch/arm64/kernel/cpuinfo.c
  * KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated
      arch/arm64/include/asm/kvm_host.h
  * arm64: Mitigate spectre style branch history side channels
      arch/arm64/Kconfig
      arch/arm64/include/asm/assembler.h
      arch/arm64/include/asm/cpufeature.h
      arch/arm64/include/asm/cputype.h
      arch/arm64/include/asm/sysreg.h
      arch/arm64/include/asm/vectors.h
      arch/arm64/kernel/cpu_errata.c
  * KVM: arm64: Add templates for BHB mitigation sequences
      arch/arm64/include/asm/cpucaps.h
      arch/arm64/include/asm/kvm_mmu.h
      arch/arm64/include/asm/mmu.h
      arch/arm64/kernel/cpu_errata.c
  * arm64: proton-pack: Report Spectre-BHB vulnerabilities as part of Spectre-v2
      arch/arm64/include/asm/cpufeature.h
      arch/arm64/kernel/cpu_errata.c
  * arm64: Add percpu vectors for EL1
      arch/arm64/include/asm/mmu.h
      arch/arm64/include/asm/vectors.h
      arch/arm64/kernel/cpufeature.c
      arch/arm64/kernel/entry.S
  * arm64: entry: Add macro for reading symbol addresses from the trampoline
      arch/arm64/kernel/entry.S
  * arm64: entry: Add vectors that have the bhb mitigation sequences
      arch/arm64/include/asm/assembler.h
      arch/arm64/include/asm/vectors.h
      arch/arm64/kernel/entry.S
      include/linux/arm-smccc.h
  * arm64: entry: Add non-kpti __bp_harden_el1_vectors for mitigations
      arch/arm64/kernel/entry.S
  * arm64: entry: Allow the trampoline text to occupy multiple pages
      arch/arm64/include/asm/fixmap.h
      arch/arm64/include/asm/sections.h
      arch/arm64/kernel/entry.S
      arch/arm64/kernel/vmlinux.lds.S
      arch/arm64/mm/mmu.c
  * arm64: entry: Make the kpti trampoline's kpti sequence optional
      arch/arm64/kernel/entry.S
  * arm64: entry: Move trampoline macros out of ifdef'd section
      arch/arm64/kernel/entry.S
  * arm64: entry: Don't assume tramp_vectors is the start of the vectors
      arch/arm64/kernel/entry.S
  * arm64: entry: Allow tramp_alias to access symbols after the 4K boundary
      arch/arm64/kernel/entry.S
  * arm64: entry: Move the trampoline data page before the text page
      arch/arm64/include/asm/fixmap.h
      arch/arm64/kernel/entry.S
  * arm64: entry: Free up another register on kpti's tramp_exit path
      arch/arm64/kernel/entry.S
  * arm64: entry: Make the trampoline cleanup optional
      arch/arm64/kernel/entry.S
  * arm64: entry.S: Add ventry overflow sanity checks
      arch/arm64/kernel/entry.S
  * arm64: Add Cortex-X2 CPU part definition
      arch/arm64/include/asm/cputype.h
  * arm64: Add Neoverse-N2, Cortex-A710 CPU part definition
      arch/arm64/include/asm/cputype.h
  * arm64: Add part number for Arm Cortex-A77
      arch/arm64/include/asm/cputype.h
  * fs: sysfs_emit: Remove PAGE_SIZE alignment check
      fs/sysfs/file.c
  * mm: fix dereference a null pointer in migrate[_huge]_page_move_mapping()
      mm/migrate.c
  * cpuset: Fix unsafe lock order between cpuset lock and cpuslock
      kernel/cgroup/cpuset.c
    ia64: ensure proper NUMA distance and possible map initialization
  * sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa()
      kernel/sched/topology.c
  * sched/topology: Make sched_init_numa() use a set for the deduplicating sort
      include/linux/topology.h
      kernel/sched/topology.c
    kselftest/vm: fix tests build with old libc
    sfc: extend the locking on mcdi->seqno
  * tcp: make tcp_read_sock() more robust
      net/ipv4/tcp.c
  * nl80211: Update bss channel on channel switch for P2P_CLIENT
      net/wireless/nl80211.c
    atm: firestream: check the return value of ioremap() in fs_init()
    can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready
  * ARM: 9178/1: fix unmet dependency on BITREVERSE for HAVE_ARCH_BITREVERSE
      lib/Kconfig
    MIPS: smp: fill in sibling and core maps earlier
    ARM: dts: rockchip: fix a typo on rk3288 crypto-controller
    arm64: dts: rockchip: reorder rk3399 hdmi clocks
    arm64: dts: rockchip: fix rk3399-puma eMMC HS400 signal integrity
  * xfrm: Fix xfrm migrate issues when address family changes
      net/xfrm/xfrm_state.c
  * xfrm: Check if_id in xfrm_migrate
      include/net/xfrm.h
      net/key/af_key.c
      net/xfrm/xfrm_policy.c
      net/xfrm/xfrm_state.c
      net/xfrm/xfrm_user.c
  * sctp: fix the processing for INIT_ACK chunk
      net/sctp/sm_statefuns.c
  * sctp: fix the processing for INIT chunk
      net/sctp/sm_statefuns.c
  * Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0"
      net/xfrm/xfrm_user.c
    Merge 4.19.235 into android-4.19-stable
Linux 4.19.235
    btrfs: unlock newly allocated extent buffer after error
  * ext4: add check to prevent attempting to resize an fs with sparse_super2
      fs/ext4/resize.c
    ARM: fix Thumb2 regression with Spectre BHB
  * virtio: acknowledge all features before access
      include/linux/virtio_config.h
  * virtio: unexport virtio_finalize_features
      include/linux/virtio.h
    riscv: Fix auipc+jalr relocation range checks
    net: macb: Fix lost RX packet wakeup race in NAPI receive
    staging: gdm724x: fix use after free in gdm_lte_rx()
    ARM: Spectre-BHB: provide empty stub for non-config
    selftests/memfd: clean up mapping in mfd_fail_write
  * tracing: Ensure trace buffer is at least 4096 bytes large
      kernel/trace/trace.c
    Revert "xen-netback: Check for hotplug-status existence before watching"
    Revert "xen-netback: remove 'hotplug-status' once it has served its purpose"
  * net-sysfs: add check for netdevice being present to speed_show
      net/core/net-sysfs.c
  * sctp: fix kernel-infoleak for SCTP sockets
      net/sctp/diag.c
    net: phy: DP83822: clear MISR2 register to disable interrupts
    gianfar: ethtool: Fix refcount leak in gfar_get_ts_info
    gpio: ts4900: Do not set DAT and OE together
    NFC: port100: fix use-after-free in port100_send_complete
  * net/mlx5: Fix size field in bufferx_reg struct
      include/linux/mlx5/mlx5_ifc.h
    ax25: Fix NULL pointer dereference in ax25_kill_by_device
    net: ethernet: lpc_eth: Handle error for clk_enable
    net: ethernet: ti: cpts: Handle error for clk_enable
    ethernet: Fix error handling in xemaclite_of_probe
    qed: return status of qed_iov_get_link
    net: qlogic: check the return value of dma_alloc_coherent() in qed_vf_hw_prepare()
    ANDROID: dm-bow: Protect Ranges fetched and erased from the RB tree

Bug: 229982346
Change-Id: I590f3a34c3672086a50ac0fba0b8514a4cc2016a
Signed-off-by: Lucas Wei <lucaswei@google.com>
2022-05-12 18:44:49 +08:00
Christian Brauner
b155e0447d UPSTREAM: binderfs: use __u32 for device numbers
We allow more then 255 binderfs binder devices to be created since there
are workloads that require more than that. If we use __u8 we'll overflow
after 255. So let's use a __u32.
Note that there's no released kernel with binderfs out there so this is
not a regression.

Signed-off-by: Christian Brauner <christian@brauner.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 7d0174065f4903fb0ce0bab3d5047284faa7226d)
Bug: 228263403
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: If143c0d6511946fac6349c5db7c013535950de4a
2022-04-07 00:27:35 +00:00
Li Li
fe0b3d3dc5 BACKPORT: FROMGIT: binder: fix freeze race
Currently cgroup freezer is used to freeze the application threads, and
BINDER_FREEZE is used to freeze the corresponding binder interface.
There's already a mechanism in ioctl(BINDER_FREEZE) to wait for any
existing transactions to drain out before actually freezing the binder
interface.

But freezing an app requires 2 steps, freezing the binder interface with
ioctl(BINDER_FREEZE) and then freezing the application main threads with
cgroupfs. This is not an atomic operation. The following race issue
might happen.

1) Binder interface is frozen by ioctl(BINDER_FREEZE);
2) Main thread A initiates a new sync binder transaction to process B;
3) Main thread A is frozen by "echo 1 > cgroup.freeze";
4) The response from process B reaches the frozen thread, which will
unexpectedly fail.

This patch provides a mechanism to check if there's any new pending
transaction happening between ioctl(BINDER_FREEZE) and freezing the
main thread. If there's any, the main thread freezing operation can
be rolled back to finish the pending transaction.

Furthermore, the response might reach the binder driver before the
rollback actually happens. That will still cause failed transaction.

As the other process doesn't wait for another response of the response,
the response transaction failure can be fixed by treating the response
transaction like an oneway/async one, allowing it to reach the frozen
thread. And it will be consumed when the thread gets unfrozen later.

NOTE: This patch reuses the existing definition of struct
binder_frozen_status_info but expands the bit assignments of __u32
member sync_recv.

To ensure backward compatibility, bit 0 of sync_recv still indicates
there's an outstanding sync binder transaction. This patch adds new
information to bit 1 of sync_recv, indicating the binder transaction
happens exactly when there's a race.

If an existing userspace app runs on a new kernel, a sync binder call
will set bit 0 of sync_recv so ioctl(BINDER_GET_FROZEN_INFO) still
return the expected value (true). The app just doesn't check bit 1
intentionally so it doesn't have the ability to tell if there's a race.
This behavior is aligned with what happens on an old kernel which
doesn't set bit 1 at all.

A new userspace app can 1) check bit 0 to know if there's a sync binder
transaction happened when being frozen - same as before; and 2) check
bit 1 to know if that sync binder transaction happened exactly when
there's a race - a new information for rollback decision.

Fixes: 432ff1e91694 ("binder: BINDER_FREEZE ioctl")
Acked-by: Todd Kjos <tkjos@google.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Li Li <dualli@google.com>
Test: stress test with apps being frozen and initiating binder calls at
the same time, confirmed the pending transactions succeeded.
Link: https://lore.kernel.org/r/20210910164210.2282716-2-dualli@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 198493121
(cherry picked from commit b564171ade70570b7f335fa8ed17adb28409e3ac
 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
 char-misc-linus)
Change-Id: I488ba75056f18bb3094ba5007027b76b5caebec9
2021-09-14 07:33:28 +00:00
Todd Kjos
ad65ce8cd1 UPSTREAM: binder: add flag to clear buffer on txn complete
Add a per-transaction flag to indicate that the buffer
must be cleared when the transaction is complete to
prevent copies of sensitive data from being preserved
in memory.

Signed-off-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20201120233743.3617529-1-tkjos@google.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 171501513
Change-Id: Ic9338c85cbe3b11ab6f2bda55dce9964bb48447a
(cherry picked from commit 0f966cba95c78029f491b433ea95ff38f414a761)
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2021-02-20 19:21:23 +00:00
Marco Ballesio
95763db10b binder: introduce the BINDER_GET_FROZEN_INFO ioctl
User space needs to know if binder transactions occurred to frozen
processes. Introduce a new BINDER_GET_FROZEN ioctl and keep track of
transactions occurring to frozen proceses. Also, allow async
transactions toward frozen processes and improve error hendling.

Bug: 143717177
Test: atest testBinderLib
Signed-off-by: Marco Ballesio <balejs@google.com>

Change-Id: I9ee1c2e5fe3d4ab31fc1a137d840bd4cd38a8704
2020-09-18 07:09:10 -07:00
Marco Ballesio
23fb7bbe4a binder: implement BINDER_FREEZE ioctl
Frozen tasks can't process binder transactions, so a way is required to
inform transmitting ends of communication failures due to the frozen
state of their receiving counterparts. Additionally, races are possible
between transitions to frozen state and binder transactions enqueued to a
specific process.

Implement BINDER_FREEZE ioctl for user space to inform the binder driver
about the intention to freeze or unfreeze a process. When the ioctl is
called, block the caller until any pending binder transactions toward the
target process are flushed. Return an error to transactions to processes
marked as frozen.

Bug: 143717177
Change-Id: Ie16f72b490bbe1785b82dee2442452f71ad7dc65
Signed-off-by: Marco Ballesio <balejs@google.com>
Co-developed-by: Todd Kjos <tkjos@google.com>
2020-08-31 18:57:09 +00:00
Ivaylo Georgiev
4c30d46517 Merge android-4.19.95 (5da1114) into msm-4.19
* refs/heads/tmp-5da1114:
  Revert crypto changes from android-4.19.79-95
  Revert "UPSTREAM: PM / wakeup updates"
  Revert "ANDROID: of: property: Enable of_devlink by default"
  Revert "UPSTREAM: dt-bindings: arm: coresight: Add support for coresight-loses-context-with-cpu"
  UPSTREAM: net: usbnet: Fix -Wcast-function-type
  UPSTREAM: USB: dummy-hcd: use usb_urb_dir_in instead of usb_pipein
  UPSTREAM: USB: dummy-hcd: increase max number of devices to 32
  ANDROID: tty: serdev: Fix broken serial console input
  ANDROID: update kernel ABI (perf_event changes)
  BACKPORT: perf_event: Add support for LSM and SELinux checks
  UPSTREAM: iommu: Allow io-pgtable to be used outside of drivers/iommu/
  ANDROID: update abi for 4.19.94 release
  ANDROID: update abi due to revert
  Revert "BACKPORT: perf_event: Add support for LSM and SELinux checks"
  UPSTREAM: selinux: sidtab reverse lookup hash table
  UPSTREAM: selinux: avoid atomic_t usage in sidtab
  UPSTREAM: selinux: check sidtab limit before adding a new entry
  UPSTREAM: selinux: fix context string corruption in convert_context()
  UPSTREAM: selinux: overhaul sidtab to fix bug and improve performance
  UPSTREAM: selinux: refactor mls_context_to_sid() and make it stricter
  UPSTREAM: selinux: use separate table for initial SID lookup
  UPSTREAM: selinux: make "selinux_policycap_names[]" const char *
  UPSTREAM: selinux: refactor sidtab conversion
  ANDROID: Update ABI representation
  ANDROID: GKI: clk: Don't disable unused clocks with sync state support
  ANDROID: GKI: clk: Add support for clock providers with sync state
  ANDROID: GKI: driver core: Add dev_has_sync_state()
  ANDROID: update kernel ABI representation
  BACKPORT: perf_event: Add support for LSM and SELinux checks
  ANDROID: update ABI representation
  UPSTREAM: exit: panic before exit_mm() on global init exit
  ANDROID: serdev: Fix platform device support
  ANDROID: Kconfig.gki: Add Hidden SPRD DRM configs
  ANDROID: gki_defconfig: Disable TRANSPARENT_HUGEPAGE
  ANDROID: gki_defconfig: Enable CONFIG_GNSS_CMDLINE_SERIAL
  ANDROID: gnss: Add command line test driver
  ANDROID: serdev: add platform device support
  ANDROID: gki_defconfig: enable ARM64_SW_TTBR0_PAN
  ANDROID: gki_defconfig: Set BINFMT_MISC as =m
  UPSTREAM: binder: fix incorrect calculation for num_valid
  ABI: Update ABI after f2fs merge
  ANDROID: add initial ABI whitelist for android-4.19
  ANDROID: staging: android: ion: Fix build when CONFIG_ION_SYSTEM_HEAP=n
  ANDROID: staging: android: ion: Expose total heap and pool sizes via sysfs
  ANDROID: Update ABI representation due to vmstat counter changes
  UPSTREAM: include/linux/slab.h: fix sparse warning in kmalloc_type()
  UPSTREAM: mm, slab: shorten kmalloc cache names for large sizes
  UPSTREAM: mm, proc: add KReclaimable to /proc/meminfo
  UPSTREAM: mm: rename and change semantics of nr_indirectly_reclaimable_bytes
  UPSTREAM: dcache: allocate external names from reclaimable kmalloc caches
  UPSTREAM: mm, slab/slub: introduce kmalloc-reclaimable caches
  UPSTREAM: mm, slab: combine kmalloc_caches and kmalloc_dma_caches
  ANDROID: abi update for 4.19.89
  ANDROID: update abi_gki_aarch64.xml for LTO, CFI, and SCS
  ANDROID: gki_defconfig: enable LTO, CFI, and SCS
  ANDROID: update abi_gki_aarch64.xml for CONFIG_GNSS
  ANDROID: cuttlefish_defconfig: Enable CONFIG_GNSS
  UPSTREAM: arm64: Validate tagged addresses in access_ok() called from kernel threads
  ANDROID: mm: Throttle rss_stat tracepoint
  UPSTREAM: mm: slub: really fix slab walking for init_on_free
  ANDROID: update abi_gki_aarch64.xml for nf change
  ANDROID: kbuild: limit LTO inlining
  ANDROID: kbuild: merge module sections with LTO
  ANDROID: netfilter: nf_nat: remove static from nf_nat_ipv4_fn
  UPSTREAM: drm/client: remove the exporting of drm_client_close
  ANDROID: f2fs: fix possible merge of unencrypted with encrypted I/O
  UPSTREAM: binder: Add binder_proc logging to binderfs
  UPSTREAM: binder: Make transaction_log available in binderfs
  UPSTREAM: binder: Add stats, state and transactions files
  UPSTREAM: binder: add a mount option to show global stats
  UPSTREAM: binder: Validate the default binderfs device names.
  UPSTREAM: binder: Add default binder devices through binderfs when configured
  UPSTREAM: binder: fix CONFIG_ANDROID_BINDER_DEVICES
  UPSTREAM: android: binder: use kstrdup instead of open-coding it
  UPSTREAM: binderfs: remove separate device_initcall()
  UPSTREAM: binderfs: respect limit on binder control creation
  UPSTREAM: binderfs: switch from d_add() to d_instantiate()
  UPSTREAM: binderfs: drop lock in binderfs_binder_ctl_create
  UPSTREAM: binderfs: kill_litter_super() before cleanup
  UPSTREAM: binderfs: rework binderfs_binder_device_create()
  UPSTREAM: binderfs: rework binderfs_fill_super()
  UPSTREAM: binderfs: prevent renaming the control dentry
  UPSTREAM: binderfs: remove outdated comment
  UPSTREAM: binderfs: fix error return code in binderfs_fill_super()
  UPSTREAM: binderfs: handle !CONFIG_IPC_NS builds
  UPSTREAM: binderfs: reserve devices for initial mount
  UPSTREAM: binderfs: rename header to binderfs.h
  UPSTREAM: binderfs: implement "max" mount option
  UPSTREAM: binderfs: make each binderfs mount a new instance
  UPSTREAM: binderfs: remove wrong kern_mount() call
  UPSTREAM: binder: implement binderfs
  UPSTREAM: binder: remove BINDER_DEBUG_ENTRY()
  ANDROID: Don't base allmodconfig on gki_defconfig
  ANDROID: Disable UNWINDER_ORC for allmodconfig
  ANDROID: update abi_gki_aarch64.xml for 4.19.87
  BACKPORT: ARM: 8905/1: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer
  ANDROID: update abi_gki_aarch64.xml
  ANDROID: gki_defconfig: =m's applied for virtio configs in arm64
  UPSTREAM: of: property: Add device link support for interrupt-parent, dmas and -gpio(s)
  UPSTREAM: of: property: Add device link support for "iommu-map"
  UPSTREAM: of: property: Fix the semantics of of_is_ancestor_of()
  UPSTREAM: i2c: of: Populate fwnode in of_i2c_get_board_info()
  UPSTREAM: driver core: Clarify documentation for fwnode_operations.add_links()
  UPSTREAM: dt-bindings: arm: coresight: Add support for coresight-loses-context-with-cpu
  BACKPORT: coresight: etm4x: Save/restore state across CPU low power states
  ANDROID: Update ABI representation
  ANDROID: gki_defconfig: IIO=y
  f2fs: stop GC when the victim becomes fully valid
  f2fs: expose main_blkaddr in sysfs
  f2fs: choose hardlimit when softlimit is larger than hardlimit in f2fs_statfs_project()
  f2fs: Fix deadlock in f2fs_gc() context during atomic files handling
  f2fs: show f2fs instance in printk_ratelimited
  f2fs: fix potential overflow
  f2fs: fix to update dir's i_pino during cross_rename
  f2fs: support aligned pinned file
  f2fs: avoid kernel panic on corruption test
  f2fs: fix wrong description in document
  f2fs: cache global IPU bio
  f2fs: fix to avoid memory leakage in f2fs_listxattr
  f2fs: check total_segments from devices in raw_super
  f2fs: update multi-dev metadata in resize_fs
  f2fs: mark recovery flag correctly in read_raw_super_block()
  f2fs: fix to update time in lazytime mode
  vfs: don't allow writes to swap files
  mm: set S_SWAPFILE on blockdev swap devices
  BACKPORT: ARM: 8900/1: UNWINDER_FRAME_POINTER implementation for Clang
  ANDROID: update abi_gki_aarch64.xml for 4.19.87
  ANDROID: gki_defconfig: FW_CACHE to no
  FROMGIT: firmware_class: make firmware caching configurable
  FROMLIST: arm64: implement Shadow Call Stack
  FROMLIST: arm64: disable SCS for hypervisor code
  BACKPORT: FROMLIST: arm64: vdso: disable Shadow Call Stack
  FROMLIST: arm64: efi: restore x18 if it was corrupted
  FROMLIST: arm64: preserve x18 when CPU is suspended
  FROMLIST: arm64: reserve x18 from general allocation with SCS
  FROMLIST: arm64: disable function graph tracing with SCS
  FROMLIST: scs: add support for stack usage debugging
  FROMLIST: scs: add accounting
  FROMLIST: add support for Clang's Shadow Call Stack (SCS)
  FROMLIST: arm64: kernel: avoid x18 in __cpu_soft_restart
  FROMLIST: arm64: kvm: stop treating register x18 as caller save
  FROMLIST: arm64/lib: copy_page: avoid x18 register in assembler code
  FROMLIST: arm64: mm: avoid x18 in idmap_kpti_install_ng_mappings
  ANDROID: use non-canonical CFI jump tables
  ANDROID: arm64: add __nocfi to __apply_alternatives
  ANDROID: arm64: add __pa_function
  ANDROID: arm64: allow ThinLTO to be selected
  ANDROID: soc/tegra: disable ARCH_TEGRA_210_SOC with LTO
  FROMLIST: arm64: fix alternatives with LLVM's integrated assembler
  ANDROID: irqchip/gic-v3: rename gic_of_init to work around a ThinLTO+CFI bug
  ANDROID: init: ensure initcall ordering with LTO
  Revert "ANDROID: init: ensure initcall ordering with LTO"
  ANDROID: add support for ThinLTO
  ANDROID: clang: update to 10.0.1
  ANDROID: gki_defconfig: enable CONFIG_REGULATOR_FIXED_VOLTAGE
  ANDROID: gki_defconfig: removed CONFIG_PM_WAKELOCKS
  ANDROID: gki_defconfig: enable CONFIG_IKHEADERS as m
  FROMGIT: pinctrl: devicetree: Avoid taking direct reference to device name string
  ANDROID: update abi_gki_aarch64.xml for 4.19.86 update
  ANDROID: Update ABI representation
  ANDROID: gki_defconfig: disable FUNCTION_TRACER
  ANDROID: Update the ABI representation
  ANDROID: update ABI representation
  ANDROID: add unstripped modules to the distribution
  FROMLIST: vsprintf: Inline call to ptr_to_hashval
  UPSTREAM: rss_stat: Add support to detect RSS updates of external mm
  UPSTREAM: mm: emit tracepoint when RSS changes
  FROMGIT: driver core: Allow device link operations inside sync_state()
  ANDROID: uid_sys_stats: avoid double accounting of dying threads
  ANDROID: scsi: ufs-qcom: Enable BROKEN_CRYPTO quirk flag
  ANDROID: scsi: ufs-hisi: Enable BROKEN_CRYPTO quirk flag
  ANDROID: scsi: ufs: Add quirk bit for controllers that don't play well with inline crypto
  ANDROID: scsi: ufs: UFS init should not require inline crypto
  ANDROID: scsi: ufs: UFS crypto variant operations API
  ANDROID: gki_defconfig: enable inline encryption
  BACKPORT: FROMLIST: ext4: add inline encryption support
  BACKPORT: FROMLIST: f2fs: add inline encryption support
  BACKPORT: FROMLIST: fscrypt: add inline encryption support
  BACKPORT: FROMLIST: scsi: ufs: Add inline encryption support to UFS
  BACKPORT: FROMLIST: scsi: ufs: UFS crypto API
  BACKPORT: FROMLIST: scsi: ufs: UFS driver v2.1 spec crypto additions
  BACKPORT: FROMLIST: block: blk-crypto for Inline Encryption
  ANDROID: block: Fix bio_crypt_should_process WARN_ON
  BACKPORT: FROMLIST: block: Add encryption context to struct bio
  BACKPORT: FROMLIST: block: Keyslot Manager for Inline Encryption
  FROMLIST: f2fs: add support for IV_INO_LBLK_64 encryption policies
  FROMLIST: ext4: add support for IV_INO_LBLK_64 encryption policies
  BACKPORT: FROMLIST: fscrypt: add support for IV_INO_LBLK_64 policies
  FROMLIST: fscrypt: zeroize fscrypt_info before freeing
  FROMLIST: fscrypt: remove struct fscrypt_ctx
  BACKPORT: FROMLIST: fscrypt: invoke crypto API for ESSIV handling
  ANDROID: build kernels with llvm-nm and llvm-objcopy
  ANDROID: Fix allmodconfig build with CC=clang
  UPSTREAM: mm/page_poison: expose page_poisoning_enabled to kernel modules
  FROMGIT: of: property: Add device link support for iommus, mboxes and io-channels
  FROMGIT: of: property: Make it easy to add device links from DT properties
  FROMGIT: of: property: Minor style clean up of of_link_to_phandle()
  Revert "ANDROID: of/property: Add device link support for iommus"
  ANDROID: Add allmodconfig build.configs for x86_64 and aarch64
  ANDROID: fix allmodconfig build
  ANDROID: nf: IDLETIMER: Fix possible use before initialization in idletimer_resume
  BACKPORT: coresight: funnel: Support static funnel
  BACKPORT:FROMGIT: coresight: replicator: Fix missing spin_lock_init()
  BACKPORT:FROMGIT: coresight: funnel: Fix missing spin_lock_init()
  BACKPORT:FROMGIT: coresight: Serialize enabling/disabling a link device.
  UPSTREAM: coresight: tmc-etr: Add barrier packets when moving offset forward
  UPSTREAM: coresight: tmc-etr: Decouple buffer sync and barrier packet insertion
  UPSTREAM: coresight: tmc: Make memory width mask computation into a function
  UPSTREAM: coresight: tmc-etr: Fix perf_data check
  UPSTREAM: coresight: tmc-etr: Fix updating buffer in not-snapshot mode.
  UPSTREAM: coresight: tmc-etr: Check if non-secure access is enabled
  UPSTREAM: coresight: tmc-etr: Handle memory errors
  BACKPORT: coresight: etr_buf: Consolidate refcount initialization
  UPSTREAM: coresight: Fix DEBUG_LOCKS_WARN_ON for uninitialized attribute
  UPSTREAM: coresight: Use coresight device names for sinks in PMU attribute
  UPSTREAM: coresight: tmc-etr: alloc_perf_buf: Do not call smp_processor_id from preemptible
  UPSTREAM: coresight: tmc-etr: Do not call smp_processor_id() from preemptible
  UPSTREAM: coresight: perf: Don't set the truncated flag in snapshot mode
  UPSTREAM: coresight: tmc-etf: Fix snapshot mode update function
  UPSTREAM: coresight: tmc-etr: Properly set AUX buffer head in snapshot mode
  UPSTREAM: coresight: tmc-etr: Add support for CPU-wide trace scenarios
  UPSTREAM: coresight: tmc-etr: Allocate and free ETR memory buffers for CPU-wide scenarios
  UPSTREAM: coresight: tmc-etr: Introduce the notion of IDR to ETR devices
  UPSTREAM: coresight: tmc-etr: Introduce the notion of reference counting to ETR devices
  UPSTREAM: coresight: tmc-etr: Introduce the notion of process ID to ETR devices
  UPSTREAM: coresight: tmc-etr: Create per-thread buffer allocation function
  UPSTREAM: coresight: tmc-etr: Refactor function tmc_etr_setup_perf_buf()
  UPSTREAM: coresight: Communicate perf event to sink buffer allocation functions
  UPSTREAM: coresight: perf: Refactor function free_event_data()
  UPSTREAM: coresight: perf: Clean up function etm_setup_aux()
  UPSTREAM: coresight: Properly address concurrency in sink::update() functions
  UPSTREAM: coresight: Properly address errors in sink::disable() functions
  UPSTREAM: coresight: Move reference counting inside sink drivers
  UPSTREAM: coresight: Adding return code to sink::disable() operation
  UPSTREAM: coresight: etm4x: Configure tracers to emit timestamps
  UPSTREAM: coresight: etm4x: Skip selector pair 0
  UPSTREAM: coresight: etm4x: Add kernel configuration for CONTEXTID
  UPSTREAM: coresight: pmu: Adding ITRACE property to cs_etm PMU
  UPSTREAM: coresight: tmc: Cleanup power management
  UPSTREAM: coresight: Fix freeing up the coresight connections
  UPSTREAM: coresight: tmc: Report DMA setup failures
  UPSTREAM: coresight: catu: fix clang build warning
  UPSTREAM: perf/core: Fix the address filtering fix
  UPSTREAM: perf, pt, coresight: Fix address filters for vmas with non-zero offset
  UPSTREAM: perf: Copy parent's address filter offsets on clone
  UPSTREAM: coresight: Use event attributes for sink selection
  UPSTREAM: coresight: perf: Add "sinks" group to PMU directory
  UPSTREAM: coresight: etb10: Add support for CLAIM tag
  UPSTREAM: coreisght: tmc: Claim device before use
  UPSTREAM: coresight: dynamic-replicator: Claim device for use
  UPSTREAM: coresight: funnel: Claim devices before use
  UPSTREAM: coresight: etmx: Claim devices before use
  UPSTREAM: coresight: Add support for CLAIM tag protocol
  UPSTREAM: coresight: dynamic-replicator: Handle multiple connections
  UPSTREAM: coresight: etb10: Handle errors enabling the device
  UPSTREAM: coresight: etm3: Add support for handling errors
  UPSTREAM: coresight: etm4x: Add support for handling errors
  UPSTREAM: coresight: tmc-etb/etf: Prepare to handle errors enabling
  UPSTREAM: coresight: tmc-etr: Handle errors enabling CATU
  UPSTREAM: coresight: tmc-etr: Refactor for handling errors
  UPSTREAM: coresight: Handle failures in enabling a trace path
  UPSTREAM: coresight: tmc: Fix byte-address alignment for RRP
  UPSTREAM: coresight: etm4x: Configure EL2 exception level when kernel is running in HYP
  UPSTREAM: coresight: etb10: Splitting function etb_enable()
  UPSTREAM: coresight: etb10: Refactor etb_drvdata::mode handling
  UPSTREAM: coresight: etm-perf: Add support for ETR backend
  UPSTREAM: coresight: perf: Remove set_buffer call back
  UPSTREAM: coresight: perf: Add helper to retrieve sink configuration
  UPSTREAM: coresight: perf: Remove reset_buffer call back for sinks
  UPSTREAM: coresight: Convert driver messages to dev_dbg
  UPSTREAM: coresight: tmc-etr: Relax collection of trace from sysfs mode
  UPSTREAM: coresight: tmc-etr: Handle driver mode specific ETR buffers
  UPSTREAM: coresight: perf: Disable trace path upon source error
  UPSTREAM: coresight: perf: Allow tracing on hotplugged CPUs
  UPSTREAM: coresight: perf: Avoid unncessary CPU hotplug read lock
  UPSTREAM: coresight: perf: Fix per cpu path management
  UPSTREAM: coresight: Fix handling of sinks
  UPSTREAM: coresight: Use ERR_CAST instead of ERR_PTR
  UPSTREAM: coresight: Fix remote endpoint parsing
  UPSTREAM: coresight: platform: Fix leaking device reference
  UPSTREAM: coresight: platform: Fix refcounting for graph nodes
  UPSTREAM: coresight: platform: Refactor graph endpoint parsing
  UPSTREAM: coresight: Document error handling in coresight_register
  ANDROID: regression introduced override_creds=off
  ANDROID: overlayfs: internal getxattr operations without sepolicy checking
  ANDROID: overlayfs: add __get xattr method
  ANDROID: Add optional __get xattr method paired to __vfs_getxattr
  UPSTREAM: scsi: ufs: override auto suspend tunables for ufs
  UPSTREAM: scsi: core: allow auto suspend override by low-level driver
  FROMGIT: of: property: Skip adding device links to suppliers that aren't devices
  ANDROID: gki_defconfig: enable CONFIG_KEYBOARD_GPIO
  UPSTREAM: dm bufio: introduce a global cache replacement
  UPSTREAM: dm bufio: remove old-style buffer cleanup
  UPSTREAM: dm bufio: introduce a global queue
  UPSTREAM: dm bufio: refactor adjust_total_allocated
  UPSTREAM: dm bufio: call adjust_total_allocated from __link_buffer and __unlink_buffer
  ANDROID: dummy_cpufreq: Implement get()
  ANDROID: gki_defconfig: enable CONFIG_CPUSETS
  ANDROID: virtio: virtio_input: Set the amount of multitouch slots in virtio input
  rtlwifi: Fix potential overflow on P2P code
  ANDROID: cpufreq: create dummy cpufreq driver
  ANDROID: Allow DRM_IOCTL_MODE_*_DUMB for render clients.
  Cuttlefish Wifi: Add data ops in virt_wifi driver for scan data simulation
  ANDROID: of: property: Enable of_devlink by default
  ANDROID: of: property: Make sure child dependencies don't block probing of parent
  ANDROID: driver core: Allow fwnode_operations.add_links to differentiate errors
  ANDROID: driver core: Allow a device to wait on optional suppliers
  ANDROID: driver core: Add device link support for SYNC_STATE_ONLY flag
  FROMGIT: docs: driver-model: Add documentation for sync_state
  FROMGIT: driver: core: Improve documentation for fwnode_operations.add_links()
  FROMGIT: of: property: Minor code formatting/style clean ups
  ANDROID: of/property: Add device link support for iommus
  ANDROID: move up spin_unlock_bh() ahead of remove_proc_entry()
  BACKPORT: arm64: tags: Preserve tags for addresses translated via TTBR1
  UPSTREAM: arm64: memory: Implement __tag_set() as common function
  UPSTREAM: arm64/mm: fix variable 'tag' set but not used
  UPSTREAM: arm64: avoid clang warning about self-assignment
  ANDROID: sdcardfs: evict dentries on fscrypt key removal
  ANDROID: fscrypt: add key removal notifier chain
  ANDROID: refactor build.config files to remove duplication
  ANDROID: Move from clang r353983c to r365631c
  ANDROID: gki_defconfig: remove PWRSEQ_EMMC and PWRSEQ_SIMPLE
  ANDROID: unconditionally compile sig_ok in struct module
  ANDROID: gki_defconfig: enable fs-verity
  UPSTREAM: mm: vmalloc: show number of vmalloc pages in /proc/meminfo
  BACKPORT: PM/sleep: Expose suspend stats in sysfs
  UPSTREAM: power: supply: Init device wakeup after device_add()
  UPSTREAM: PM / wakeup: Unexport wakeup_source_sysfs_{add,remove}()
  UPSTREAM: PM / wakeup: Register wakeup class kobj after device is added
  UPSTREAM: PM / wakeup: Fix sysfs registration error path
  UPSTREAM: PM / wakeup: Show wakeup sources stats in sysfs
  UPSTREAM: PM / wakeup: Use wakeup_source_register() in wakelock.c
  UPSTREAM: PM / wakeup: Drop wakeup_source_init(), wakeup_source_prepare()
  UPSTREAM: PM / wakeup: Drop wakeup_source_drop()
  UPSTREAM: PM / core: Add support to skip power management in device/driver model
  gki_defconfig: Enable CONFIG_DM_SNAPSHOT
  ANDROID: gki_defconfig: enable accelerated AES and SHA-256
  ANDROID: fix overflow in /proc/uid_cputime/remove_uid_range
  ANDROID: kasan: fix has_attribute check on older GCC versions
  ANDROID: gki_defconfig: enable CONFIG_PARAVIRT and CONFIG_HYPERVISOR_GUEST
  ANDROID: gki_defconfig: enable CONFIG_NLS_*
  ANDROID: gki_defconfig: Enable BPF_JIT and BPF_JIT_ALWAYS_ON
  FROMGIT: of: property: Create device links for all child-supplier depencencies
  FROMGIT: of/platform: Pause/resume sync state during init and of_platform_populate()
  BACKPORT: FROMGIT: driver core: Add sync_state driver/bus callback
  BACKPORT: FROMGIT: of: property: Add functional dependency link from DT bindings
  FROMGIT: driver core: Add support for linking devices during device addition
  FROMGIT: driver core: Add fwnode_to_dev() to look up device from fwnode
  UPSTREAM: mm: untag user pointers in mmap/munmap/mremap/brk
  UPSTREAM: vfio/type1: untag user pointers in vaddr_get_pfn
  UPSTREAM: tee/shm: untag user pointers in tee_shm_register
  UPSTREAM: media/v4l2-core: untag user pointers in videobuf_dma_contig_user_get
  UPSTREAM: drm/radeon: untag user pointers in radeon_gem_userptr_ioctl
  BACKPORT: drm/amdgpu: untag user pointers
  UPSTREAM: userfaultfd: untag user pointers
  UPSTREAM: fs/namespace: untag user pointers in copy_mount_options
  UPSTREAM: mm: untag user pointers in get_vaddr_frames
  UPSTREAM: mm: untag user pointers in mm/gup.c
  UPSTREAM: mm: untag user pointers passed to memory syscalls
  BACKPORT: lib: untag user pointers in strn*_user
  UPSTREAM: arm64: Fix reference to docs for ARM64_TAGGED_ADDR_ABI
  UPSTREAM: selftests, arm64: add kernel headers path for tags_test
  BACKPORT: arm64: Relax Documentation/arm64/tagged-pointers.rst
  UPSTREAM: arm64: Define Documentation/arm64/tagged-address-abi.rst
  UPSTREAM: arm64: Change the tagged_addr sysctl control semantics to only prevent the opt-in
  UPSTREAM: arm64: Tighten the PR_{SET, GET}_TAGGED_ADDR_CTRL prctl() unused arguments
  UPSTREAM: selftests, arm64: fix uninitialized symbol in tags_test.c
  UPSTREAM: arm64: mm: Really fix sparse warning in untagged_addr()
  UPSTREAM: selftests, arm64: add a selftest for passing tagged pointers to kernel
  BACKPORT: arm64: Introduce prctl() options to control the tagged user addresses ABI
  UPSTREAM: arm64: untag user pointers in access_ok and __uaccess_mask_ptr
  UPSTREAM: uaccess: add noop untagged_addr definition
  BACKPORT: block: annotate refault stalls from IO submission
  f2fs: add a condition to detect overflow in f2fs_ioc_gc_range()
  f2fs: fix to add missing F2FS_IO_ALIGNED() condition
  f2fs: fix to fallback to buffered IO in IO aligned mode
  f2fs: fix to handle error path correctly in f2fs_map_blocks
  f2fs: fix extent corrupotion during directIO in LFS mode
  f2fs: check all the data segments against all node ones
  f2fs: Add a small clarification to CONFIG_FS_F2FS_FS_SECURITY
  f2fs: fix inode rwsem regression
  f2fs: fix to avoid accessing uninitialized field of inode page in is_alive()
  f2fs: avoid infinite GC loop due to stale atomic files
  f2fs: Fix indefinite loop in f2fs_gc()
  f2fs: convert inline_data in prior to i_size_write
  f2fs: fix error path of f2fs_convert_inline_page()
  f2fs: add missing documents of reserve_root/resuid/resgid
  f2fs: fix flushing node pages when checkpoint is disabled
  f2fs: enhance f2fs_is_checkpoint_ready()'s readability
  f2fs: clean up __bio_alloc()'s parameter
  f2fs: fix wrong error injection path in inc_valid_block_count()
  f2fs: fix to writeout dirty inode during node flush
  f2fs: optimize case-insensitive lookups
  f2fs: introduce f2fs_match_name() for cleanup
  f2fs: Fix indefinite loop in f2fs_gc()
  f2fs: allocate memory in batch in build_sit_info()
  f2fs: support FS_IOC_{GET,SET}FSLABEL
  f2fs: fix to avoid data corruption by forbidding SSR overwrite
  f2fs: Fix build error while CONFIG_NLS=m
  Revert "f2fs: avoid out-of-range memory access"
  f2fs: cleanup the code in build_sit_entries.
  f2fs: fix wrong available node count calculation
  f2fs: remove duplicate code in f2fs_file_write_iter
  f2fs: fix to migrate blocks correctly during defragment
  f2fs: use wrapped f2fs_cp_error()
  f2fs: fix to use more generic EOPNOTSUPP
  f2fs: use wrapped IS_SWAPFILE()
  f2fs: Support case-insensitive file name lookups
  f2fs: include charset encoding information in the superblock
  fs: Reserve flag for casefolding
  f2fs: fix to avoid call kvfree under spinlock
  fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status()
  f2fs: disallow direct IO in atomic write
  f2fs: fix to handle quota_{on,off} correctly
  f2fs: fix to detect cp error in f2fs_setxattr()
  f2fs: fix to spread f2fs_is_checkpoint_ready()
  f2fs: support fiemap() for directory inode
  f2fs: fix to avoid discard command leak
  f2fs: fix to avoid tagging SBI_QUOTA_NEED_REPAIR incorrectly
  f2fs: fix to drop meta/node pages during umount
  f2fs: disallow switching io_bits option during remount
  f2fs: fix panic of IO alignment feature
  f2fs: introduce {page,io}_is_mergeable() for readability
  f2fs: fix livelock in swapfile writes
  f2fs: add fs-verity support
  ext4: update on-disk format documentation for fs-verity
  ext4: add fs-verity read support
  ext4: add basic fs-verity support
  fs-verity: support builtin file signatures
  fs-verity: add SHA-512 support
  fs-verity: implement FS_IOC_MEASURE_VERITY ioctl
  fs-verity: implement FS_IOC_ENABLE_VERITY ioctl
  fs-verity: add data verification hooks for ->readpages()
  fs-verity: add the hook for file ->setattr()
  fs-verity: add the hook for file ->open()
  fs-verity: add inode and superblock fields
  fs-verity: add Kconfig and the helper functions for hashing
  fs: uapi: define verity bit for FS_IOC_GETFLAGS
  fs-verity: add UAPI header
  fs-verity: add MAINTAINERS file entry
  fs-verity: add a documentation file
  ext4: fix kernel oops caused by spurious casefold flag
  ext4: fix coverity warning on error path of filename setup
  ext4: optimize case-insensitive lookups
  ext4: fix dcache lookup of !casefolded directories
  unicode: update to Unicode 12.1.0 final
  unicode: add missing check for an error return from utf8lookup()
  ext4: export /sys/fs/ext4/feature/casefold if Unicode support is present
  unicode: refactor the rule for regenerating utf8data.h
  ext4: Support case-insensitive file name lookups
  ext4: include charset encoding information in the superblock
  unicode: update unicode database unicode version 12.1.0
  unicode: introduce test module for normalized utf8 implementation
  unicode: implement higher level API for string handling
  unicode: reduce the size of utf8data[]
  unicode: introduce code for UTF-8 normalization
  unicode: introduce UTF-8 character database
  ext4 crypto: fix to check feature status before get policy
  fscrypt: document the new ioctls and policy version
  ubifs: wire up new fscrypt ioctls
  f2fs: wire up new fscrypt ioctls
  ext4: wire up new fscrypt ioctls
  fscrypt: require that key be added when setting a v2 encryption policy
  fscrypt: add FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS ioctl
  fscrypt: allow unprivileged users to add/remove keys for v2 policies
  fscrypt: v2 encryption policy support
  fscrypt: add an HKDF-SHA512 implementation
  fscrypt: add FS_IOC_GET_ENCRYPTION_KEY_STATUS ioctl
  fscrypt: add FS_IOC_REMOVE_ENCRYPTION_KEY ioctl
  fscrypt: add FS_IOC_ADD_ENCRYPTION_KEY ioctl
  fscrypt: rename keyinfo.c to keysetup.c
  fscrypt: move v1 policy key setup to keysetup_v1.c
  fscrypt: refactor key setup code in preparation for v2 policies
  fscrypt: rename fscrypt_master_key to fscrypt_direct_key
  fscrypt: add ->ci_inode to fscrypt_info
  fscrypt: use FSCRYPT_* definitions, not FS_*
  fscrypt: use FSCRYPT_ prefix for uapi constants
  fs, fscrypt: move uapi definitions to new header <linux/fscrypt.h>
  fscrypt: use ENOPKG when crypto API support missing
  fscrypt: improve warnings for missing crypto API support
  fscrypt: improve warning messages for unsupported encryption contexts
  fscrypt: make fscrypt_msg() take inode instead of super_block
  fscrypt: clean up base64 encoding/decoding
  fscrypt: remove loadable module related code

Updated following files to fix build errors:
	drivers/gpu/msm/kgsl_pool.c
	drivers/hwtracing/coresight/coresight-dummy.c
	drivers/iommu/dma-mapping-fast.c
	drivers/iommu/io-pgtable-fast.c
	drivers/iommu/io-pgtable-msm-secure.c
	kernel/taskstats.c
	mm/vmalloc.c
	security/selinux/ss/sidtab.h

Conflicts:
	arch/arm/Makefile
	arch/arm64/Kconfig
	arch/x86/include/asm/syscall_wrapper.h
	build.config.common
	drivers/clk/clk.c
	drivers/hwtracing/coresight/coresight-etm-perf.c
	drivers/hwtracing/coresight/coresight-funnel.c
	drivers/hwtracing/coresight/coresight-tmc-etf.c
	drivers/hwtracing/coresight/coresight-tmc-etr.c
	drivers/hwtracing/coresight/coresight-tmc.c
	drivers/hwtracing/coresight/coresight-tmc.h
	drivers/hwtracing/coresight/coresight.c
	drivers/hwtracing/coresight/of_coresight.c
	drivers/iommu/arm-smmu.c
	drivers/iommu/io-pgtable-arm.c
	drivers/iommu/io-pgtable.c
	drivers/scsi/scsi_sysfs.c
	drivers/scsi/sd.c
	drivers/scsi/ufs/ufshcd.c
	drivers/scsi/ufs/ufshcd.h
	drivers/staging/android/ion/ion.c
	drivers/staging/android/ion/ion.h
	drivers/staging/android/ion/ion_page_pool.c
	fs/ext4/readpage.c
	fs/f2fs/data.c
	fs/f2fs/f2fs.h
	fs/f2fs/file.c
	fs/f2fs/segment.c
	fs/f2fs/super.c
	include/linux/clk-provider.h
	include/linux/compiler_types.h
	include/linux/coresight.h
	include/linux/mmzone.h
	include/scsi/scsi_device.h
	include/trace/events/kmem.h
	kernel/events/core.c
	kernel/sched/core.c
	mm/vmstat.c

Change-Id: I2eca52b08b484f2b5c30437671cab8cb0195b8d6
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
2020-03-27 10:48:20 -07:00
Christian Brauner
a482713b5a UPSTREAM: binderfs: rename header to binderfs.h
It doesn't make sense to call the header binder_ctl.h when its sole
existence is tied to binderfs. So give it a sensible name. Users will far
more easily remember binderfs.h than binder_ctl.h.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 136497735
(cherry picked from commit c13295ad219d8bb0e47942d4cfc8251de449a67e)
Change-Id: Ide6275bbbaec2e25df19e11754afb7f1827888b2
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2019-12-08 21:42:38 -08:00
Christian Brauner
3492afe5d5 UPSTREAM: binder: implement binderfs
As discussed at Linux Plumbers Conference 2018 in Vancouver [1] this is the
implementation of binderfs.

/* Abstract */
binderfs is a backwards-compatible filesystem for Android's binder ipc
mechanism. Each ipc namespace will mount a new binderfs instance. Mounting
binderfs multiple times at different locations in the same ipc namespace
will not cause a new super block to be allocated and hence it will be the
same filesystem instance.
Each new binderfs mount will have its own set of binder devices only
visible in the ipc namespace it has been mounted in. All devices in a new
binderfs mount will follow the scheme binder%d and numbering will always
start at 0.

/* Backwards compatibility */
Devices requested in the Kconfig via CONFIG_ANDROID_BINDER_DEVICES for the
initial ipc namespace will work as before. They will be registered via
misc_register() and appear in the devtmpfs mount. Specifically, the
standard devices binder, hwbinder, and vndbinder will all appear in their
standard locations in /dev. Mounting or unmounting the binderfs mount in
the initial ipc namespace will have no effect on these devices, i.e. they
will neither show up in the binderfs mount nor will they disappear when the
binderfs mount is gone.

/* binder-control */
Each new binderfs instance comes with a binder-control device. No other
devices will be present at first. The binder-control device can be used to
dynamically allocate binder devices. All requests operate on the binderfs
mount the binder-control device resides in.
Assuming a new instance of binderfs has been mounted at /dev/binderfs
via mount -t binderfs binderfs /dev/binderfs. Then a request to create a
new binder device can be made as illustrated in [2].
Binderfs devices can simply be removed via unlink().

/* Implementation details */
- dynamic major number allocation:
  When binderfs is registered as a new filesystem it will dynamically
  allocate a new major number. The allocated major number will be returned
  in struct binderfs_device when a new binder device is allocated.
- global minor number tracking:
  Minor are tracked in a global idr struct that is capped at
  BINDERFS_MAX_MINOR. The minor number tracker is protected by a global
  mutex. This is the only point of contention between binderfs mounts.
- struct binderfs_info:
  Each binderfs super block has its own struct binderfs_info that tracks
  specific details about a binderfs instance:
  - ipc namespace
  - dentry of the binder-control device
  - root uid and root gid of the user namespace the binderfs instance
    was mounted in
- mountable by user namespace root:
  binderfs can be mounted by user namespace root in a non-initial user
  namespace. The devices will be owned by user namespace root.
- binderfs binder devices without misc infrastructure:
  New binder devices associated with a binderfs mount do not use the
  full misc_register() infrastructure.
  The misc_register() infrastructure can only create new devices in the
  host's devtmpfs mount. binderfs does however only make devices appear
  under its own mountpoint and thus allocates new character device nodes
  from the inode of the root dentry of the super block. This will have
  the side-effect that binderfs specific device nodes do not appear in
  sysfs. This behavior is similar to devpts allocated pts devices and
  has no effect on the functionality of the ipc mechanism itself.

[1]: https://goo.gl/JL2tfX
[2]: program to allocate a new binderfs binder device:

     #define _GNU_SOURCE
     #include <errno.h>
     #include <fcntl.h>
     #include <stdio.h>
     #include <stdlib.h>
     #include <string.h>
     #include <sys/ioctl.h>
     #include <sys/stat.h>
     #include <sys/types.h>
     #include <unistd.h>
     #include <linux/android/binder_ctl.h>

     int main(int argc, char *argv[])
     {
             int fd, ret, saved_errno;
             size_t len;
             struct binderfs_device device = { 0 };

             if (argc < 2)
                     exit(EXIT_FAILURE);

             len = strlen(argv[1]);
             if (len > BINDERFS_MAX_NAME)
                     exit(EXIT_FAILURE);

             memcpy(device.name, argv[1], len);

             fd = open("/dev/binderfs/binder-control", O_RDONLY | O_CLOEXEC);
             if (fd < 0) {
                     printf("%s - Failed to open binder-control device\n",
                            strerror(errno));
                     exit(EXIT_FAILURE);
             }

             ret = ioctl(fd, BINDER_CTL_ADD, &device);
             saved_errno = errno;
             close(fd);
             errno = saved_errno;
             if (ret < 0) {
                     printf("%s - Failed to allocate new binder device\n",
                            strerror(errno));
                     exit(EXIT_FAILURE);
             }

             printf("Allocated new binder device with major %d, minor %d, and "
                    "name %s\n", device.major, device.minor,
                    device.name);

             exit(EXIT_SUCCESS);
     }

Cc: Martijn Coenen <maco@android.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 136497735
(cherry picked from commit 3ad20fe393b31025bebfc2d76964561f65df48aa)
Change-Id: I145af9b0bc25b3a59a4f663c9e926889c2b41d18
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2019-12-08 21:41:34 -08:00
Ivaylo Georgiev
bd72c908a7 Merge android-4.19.27 (36d178b) into msm-4.19
* refs/heads/tmp-36d178b:
  Linux 4.19.27
  x86/uaccess: Don't leak the AC flag into __put_user() value evaluation
  MIPS: eBPF: Fix icache flush end address
  MIPS: BCM63XX: provide DMA masks for ethernet devices
  MIPS: fix truncation in __cmpxchg_small for short values
  hugetlbfs: fix races and page leaks during migration
  drm: Block fb changes for async plane updates
  mm: enforce min addr even if capable() in expand_downwards()
  mmc: sdhci-esdhc-imx: correct the fix of ERR004536
  mmc: cqhci: Fix a tiny potential memory leak on error condition
  mmc: cqhci: fix space allocated for transfer descriptor
  mmc: core: Fix NULL ptr crash from mmc_should_fail_request
  mmc: tmio: fix access width of Block Count Register
  mmc: tmio_mmc_core: don't claim spurious interrupts
  mmc: spi: Fix card detection during probe
  kvm: selftests: Fix region overlap check in kvm_util
  KVM: nSVM: clear events pending from svm_complete_interrupts() when exiting to L1
  svm: Fix AVIC incomplete IPI emulation
  cfg80211: extend range deviation for DMG
  mac80211: Add attribute aligned(2) to struct 'action'
  mac80211: don't initiate TDLS connection if station is not associated to AP
  ibmveth: Do not process frames after calling napi_reschedule
  net: dev_is_mac_header_xmit() true for ARPHRD_RAWIP
  net: usb: asix: ax88772_bind return error when hw_reset fail
  drm/msm: Fix A6XX support for opp-level
  nvme-multipath: drop optimization for static ANA group IDs
  nvme-rdma: fix timeout handler
  hv_netvsc: Fix hash key value reset after other ops
  hv_netvsc: Refactor assignments of struct netvsc_device_info
  hv_netvsc: Fix ethtool change hash key error
  net: altera_tse: fix connect_local_phy error path
  scsi: csiostor: fix NULL pointer dereference in csio_vport_set_state()
  scsi: lpfc: nvmet: avoid hang / use-after-free when destroying targetport
  scsi: lpfc: nvme: avoid hang / use-after-free when destroying localport
  writeback: synchronize sync(2) against cgroup writeback membership switches
  direct-io: allow direct writes to empty inodes
  staging: android: ion: Support cpu access during dma_buf_detach
  drm/sun4i: hdmi: Fix usage of TMDS clock
  serial: fsl_lpuart: fix maximum acceptable baud rate with over-sampling
  tty: serial: qcom_geni_serial: Allow mctrl when flow control is disabled
  drm/amd/powerplay: OD setting fix on Vega10
  locking/rwsem: Fix (possible) missed wakeup
  futex: Fix (possible) missed wakeup
  sched/wake_q: Fix wakeup ordering for wake_q
  sched/wait: Fix rcuwait_wake_up() ordering
  mac80211: fix miscounting of ttl-dropped frames
  staging: rtl8723bs: Fix build error with Clang when inlining is disabled
  drivers: thermal: int340x_thermal: Fix sysfs race condition
  ARC: show_regs: lockdep: avoid page allocator...
  ARC: fix __ffs return value to avoid build warnings
  irqchip/gic-v3-mbi: Fix uninitialized mbi_lock
  selftests: gpio-mockup-chardev: Check asprintf() for error
  selftests: seccomp: use LDLIBS instead of LDFLAGS
  phy: ath79-usb: Fix the main reset name to match the DT binding
  phy: ath79-usb: Fix the power on error path
  selftests/vm/gup_benchmark.c: match gup struct to kernel
  ASoC: imx-audmux: change snprintf to scnprintf for possible overflow
  ASoC: dapm: change snprintf to scnprintf for possible overflow
  ASoC: rt5682: Fix PLL source register definitions
  x86/mm/mem_encrypt: Fix erroneous sizeof()
  genirq: Make sure the initial affinity is not empty
  selftests: rtc: rtctest: add alarm test on minute boundary
  selftests: rtc: rtctest: fix alarm tests
  usb: gadget: Potential NULL dereference on allocation error
  usb: dwc3: gadget: Fix the uninitialized link_state when udc starts
  usb: dwc3: gadget: synchronize_irq dwc irq in suspend
  thermal: int340x_thermal: Fix a NULL vs IS_ERR() check
  clk: vc5: Abort clock configuration without upstream clock
  clk: sysfs: fix invalid JSON in clk_dump
  clk: tegra: dfll: Fix a potential Oop in remove()
  ASoC: Variable "val" in function rt274_i2c_probe() could be uninitialized
  ALSA: compress: prevent potential divide by zero bugs
  ASoC: Intel: Haswell/Broadwell: fix setting for .dynamic field
  drm/msm: Unblock writer if reader closes file
  scsi: libsas: Fix rphy phy_identifier for PHYs with end devices attached
  mac80211: Change default tx_sk_pacing_shift to 7
  genirq/matrix: Improve target CPU selection for managed interrupts.
  irq/matrix: Spread managed interrupts on allocation
  irq/matrix: Split out the CPU selection code into a helper
  FROMGIT: binder: create node flag to request sender's security context

  Modify include/uapi/linux/android/binder.h, as commit:

  FROMGIT: binder: create node flag to request sender's security context

  introduces enums and structures, which are already defined in other
  userspace files that include the binder uapi file. Thus, the
  redeclaration of these enums and structures can lead to
  build errors. To avoid this, guard the redundant declarations
  in the uapi header with the __KERNEL__ header guard, so they
  are not exported to userspace.

Conflicts:
	drivers/staging/android/ion/ion.c
	sound/core/compress_offload.c

Change-Id: Ibf422b9b32ea1315515c33036b20ae635b8c8e4c
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-03-21 01:42:04 -07:00
Todd Kjos
00bac1450b FROMGIT: binder: create node flag to request sender's security context
To allow servers to verify client identity, allow a node
flag to be set that causes the sender's security context
to be delivered with the transaction. The BR_TRANSACTION
command is extended in BR_TRANSACTION_SEC_CTX to
contain a pointer to the security context string.

Signed-off-by: Todd Kjos <tkjos@google.com>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit ec74136ded792deed80780a2f8baf3521eeb72f9
 https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
 master)
Change-Id: I44496546e2d0dc0022f818a45cd52feb1c1a92cb
Signed-off-by: Todd Kjos <tkjos@google.com>
2019-03-04 10:30:23 -08:00
Martijn Coenen
ce388e00bb ANDROID: binder: add support for RT prio inheritance.
Adds support for SCHED_BATCH/SCHED_FIFO/SCHED_RR
priority inheritance.

Bug: 34461621
Bug: 37293077
Bug: 120446518
Change-Id: I71f356e476be2933713a0ecfa2cc31aa141e2dc6
Signed-off-by: Martijn Coenen <maco@google.com>
[AmitP: Include <uapi/linux/sched/types.h> for struct sched_param]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
[astrachan: Folded the following changes into this patch:
            69308b3b07dd ("ANDROID: binder: add min sched_policy to node.")
            7a6edeb62d86 ("ANDROID: binder: improve priority inheritance.")
            22b061b17679 ("ANDROID: binder: don't check prio permissions on restore.")
            67cf97141d81 ("ANDROID: binder: Add tracing for binder priority inheritance.")
            fb92c34f7ba3 ("ANDROID: binder: add RT inheritance flag to node.")
            c847b48f8cda ("ANDROID: binder: init desired_prio.sched_policy before use it")]
Signed-off-by: Alistair Strachan <astrachan@google.com>
2018-12-05 09:48:13 -08:00
Martijn Coenen
4bc6ad96c9 UPSTREAM: binder: Add BINDER_GET_NODE_INFO_FOR_REF ioctl.
This allows the context manager to retrieve information about nodes
that it holds a reference to, such as the current number of
references to those nodes.

Such information can for example be used to determine whether the
servicemanager is the only process holding a reference to a node.
This information can then be passed on to the process holding the
node, which can in turn decide whether it wants to shut down to
reduce resource usage.

Bug: 79983843
Change-Id: I21e52ed1ca2137f7bfdc0300365fb1285b7e3d70
Signed-off-by: Martijn Coenen <maco@android.com>
2018-12-05 09:48:13 -08:00
Greg Kroah-Hartman
e2be04c7f9 License cleanup: add SPDX license identifier to uapi header files with a license
Many user space API headers have licensing information, which is either
incomplete, badly formatted or just a shorthand for referring to the
license under which the file is supposed to be.  This makes it hard for
compliance tools to determine the correct license.

Update these files with an SPDX license identifier.  The identifier was
chosen based on the license information in the file.

GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
identifier with the added 'WITH Linux-syscall-note' exception, which is
the officially assigned exception identifier for the kernel syscall
exception:

   NOTE! This copyright does *not* cover user programs that use kernel
   services by normal system calls - this is merely considered normal use
   of the kernel, and does *not* fall under the heading of "derived work".

This exception makes it possible to include GPL headers into non GPL
code, without confusing license compliance tools.

Headers which have either explicit dual licensing or are just licensed
under a non GPL license are updated with the corresponding SPDX
identifier and the GPLv2 with syscall exception identifier.  The format
is:
        ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)

SPDX license identifiers are a legally binding shorthand, which can be
used instead of the full boiler plate text.  The update does not remove
existing license information as this has to be done on a case by case
basis and the copyright holders might have to be consulted. This will
happen in a separate step.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.  See the previous patch in this series for the
methodology of how this patch was researched.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:20:11 +01:00
Colin Cross
abcc61537e ANDROID: binder: Add BINDER_GET_NODE_DEBUG_INFO ioctl
The BINDER_GET_NODE_DEBUG_INFO ioctl will return debug info on
a node.  Each successive call reusing the previous return value
will return the next node.  The data will be used by
libmemunreachable to mark the pointers with kernel references
as reachable.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Martijn Coenen <maco@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-01 09:21:12 +02:00
Martijn Coenen
5cdcf4c6a6 ANDROID: binder: add padding to binder_fd_array_object.
binder_fd_array_object starts with a 4-byte header,
followed by a few fields that are 8 bytes when
ANDROID_BINDER_IPC_32BIT=N.

This can cause alignment issues in a 64-bit kernel
with a 32-bit userspace, as on x86_32 an 8-byte primitive
may be aligned to a 4-byte address. Pad with a __u32
to fix this.

Signed-off-by: Martijn Coenen <maco@android.com>
Cc: stable <stable@vger.kernel.org> # 4.11+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22 18:43:23 -07:00
Nicolas Dichtel
fcc8487d47 uapi: export all headers under uapi directories
Regularly, when a new header is created in include/uapi/, the developer
forgets to add it in the corresponding Kbuild file. This error is usually
detected after the release is out.

In fact, all headers under uapi directories should be exported, thus it's
useless to have an exhaustive list.

After this patch, the following files, which were not exported, are now
exported (with make headers_install_all):
asm-arc/kvm_para.h
asm-arc/ucontext.h
asm-blackfin/shmparam.h
asm-blackfin/ucontext.h
asm-c6x/shmparam.h
asm-c6x/ucontext.h
asm-cris/kvm_para.h
asm-h8300/shmparam.h
asm-h8300/ucontext.h
asm-hexagon/shmparam.h
asm-m32r/kvm_para.h
asm-m68k/kvm_para.h
asm-m68k/shmparam.h
asm-metag/kvm_para.h
asm-metag/shmparam.h
asm-metag/ucontext.h
asm-mips/hwcap.h
asm-mips/reg.h
asm-mips/ucontext.h
asm-nios2/kvm_para.h
asm-nios2/ucontext.h
asm-openrisc/shmparam.h
asm-parisc/kvm_para.h
asm-powerpc/perf_regs.h
asm-sh/kvm_para.h
asm-sh/ucontext.h
asm-tile/shmparam.h
asm-unicore32/shmparam.h
asm-unicore32/ucontext.h
asm-x86/hwcap2.h
asm-xtensa/kvm_para.h
drm/armada_drm.h
drm/etnaviv_drm.h
drm/vgem_drm.h
linux/aspeed-lpc-ctrl.h
linux/auto_dev-ioctl.h
linux/bcache.h
linux/btrfs_tree.h
linux/can/vxcan.h
linux/cifs/cifs_mount.h
linux/coresight-stm.h
linux/cryptouser.h
linux/fsmap.h
linux/genwqe/genwqe_card.h
linux/hash_info.h
linux/kcm.h
linux/kcov.h
linux/kfd_ioctl.h
linux/lightnvm.h
linux/module.h
linux/nbd-netlink.h
linux/nilfs2_api.h
linux/nilfs2_ondisk.h
linux/nsfs.h
linux/pr.h
linux/qrtr.h
linux/rpmsg.h
linux/sched/types.h
linux/sed-opal.h
linux/smc.h
linux/smc_diag.h
linux/stm.h
linux/switchtec_ioctl.h
linux/vfio_ccw.h
linux/wil6210_uapi.h
rdma/bnxt_re-abi.h

Note that I have removed from this list the files which are generated in every
exported directories (like .install or .install.cmd).

Thanks to Julien Floret <julien.floret@6wind.com> for the tip to get all
subdirs with a pure makefile command.

For the record, note that exported files for asm directories are a mix of
files listed by:
 - include/uapi/asm-generic/Kbuild.asm;
 - arch/<arch>/include/uapi/asm/Kbuild;
 - arch/<arch>/include/asm/Kbuild.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Acked-by: Mark Salter <msalter@redhat.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-05-11 00:21:54 +09:00
Martijn Coenen
def95c7356 binder: Add support for file-descriptor arrays
This patch introduces a new binder_fd_array object,
that allows us to support one or more file descriptors
embedded in a buffer that is scatter-gathered.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Martijn Coenen <maco@google.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Rom Lemarchand <romlem@google.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Martijn Coenen <maco@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 16:00:01 +01:00
Martijn Coenen
7980240b6d binder: Add support for scatter-gather
Previously all data passed over binder needed
to be serialized, with the exception of Binder
objects and file descriptors.

This patchs adds support for scatter-gathering raw
memory buffers into a binder transaction, avoiding
the need to first serialize them into a Parcel.

To remain backwards compatibile with existing
binder clients, it introduces two new command
ioctls for this purpose - BC_TRANSACTION_SG and
BC_REPLY_SG. These commands may only be used with
the new binder_transaction_data_sg structure,
which adds a field for the total size of the
buffers we are scatter-gathering.

Because memory buffers may contain pointers to
other buffers, we allow callers to specify
a parent buffer and an offset into it, to indicate
this is a location pointing to the buffer that
we are fixing up. The kernel will then take care
of fixing up the pointer to that buffer as well.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Martijn Coenen <maco@google.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Rom Lemarchand <romlem@google.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Martijn Coenen <maco@google.com>
[jstultz: Fold in small fix from Amit Pundir <amit.pundir@linaro.org>]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 16:00:01 +01:00
Martijn Coenen
feba3900ca binder: Split flat_binder_object
flat_binder_object is used for both handling
binder objects and file descriptors, even though
the two are mostly independent. Since we'll
have more fixup objects in binder in the future,
instead of extending flat_binder_object again,
split out file descriptors to their own object
while retaining backwards compatibility to
existing user-space clients. All binder objects
just share a header.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Martijn Coenen <maco@google.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Rom Lemarchand <romlem@google.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Martijn Coenen <maco@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 16:00:01 +01:00
Greg Kroah-Hartman
bc2d62a01b android: uapi: binder.h
add types.h to .h file to pass the checker scripts, and provide a proper
uapi .h file.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:15 +08:00
Greg Kroah-Hartman
777783e0ab staging: android: binder: move to the "real" part of the kernel
The Android binder code has been "stable" for many years now.  No matter
what comes in the future, we are going to have to support this API, so
might as well move it to the "real" part of the kernel as there's no
real work that needs to be done to the existing code.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:15 +08:00