30 Dec, 2020

3 commits

  • Changes in 5.10.4
    hwmon: (k10temp) Remove support for displaying voltage and current on Zen CPUs
    drm/gma500: fix double free of gma_connector
    iio: adc: at91_adc: add Kconfig dep on the OF symbol and remove of_match_ptr()
    drm/aspeed: Fix Kconfig warning & subsequent build errors
    drm/mcde: Fix handling of platform_get_irq() error
    drm/tve200: Fix handling of platform_get_irq() error
    arm64: dts: renesas: hihope-rzg2-ex: Drop rxc-skew-ps from ethernet-phy node
    arm64: dts: renesas: cat875: Remove rxc-skew-ps from ethernet-phy node
    soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()
    soc: mediatek: Check if power domains can be powered on at boot time
    arm64: dts: mediatek: mt8183: fix gce incorrect mbox-cells value
    arm64: dts: ipq6018: update the reserved-memory node
    arm64: dts: qcom: sc7180: Fix one forgotten interconnect reference
    soc: qcom: geni: More properly switch to DMA mode
    Revert "i2c: i2c-qcom-geni: Fix DMA transfer race"
    RDMA/bnxt_re: Set queue pair state when being queried
    rtc: pcf2127: fix pcf2127_nvmem_read/write() returns
    RDMA/bnxt_re: Fix entry size during SRQ create
    selinux: fix error initialization in inode_doinit_with_dentry()
    ARM: dts: aspeed-g6: Fix the GPIO memory size
    ARM: dts: aspeed: s2600wf: Fix VGA memory region location
    RDMA/core: Fix error return in _ib_modify_qp()
    RDMA/rxe: Compute PSN windows correctly
    x86/mm/ident_map: Check for errors from ident_pud_init()
    ARM: p2v: fix handling of LPAE translation in BE mode
    RDMA/rtrs-clt: Remove destroy_con_cq_qp in case route resolving failed
    RDMA/rtrs-clt: Missing error from rtrs_rdma_conn_established
    RDMA/rtrs-srv: Don't guard the whole __alloc_srv with srv_mutex
    x86/apic: Fix x2apic enablement without interrupt remapping
    ASoC: qcom: fix unsigned int bitwidth compared to less than zero
    sched/deadline: Fix sched_dl_global_validate()
    sched: Reenable interrupts in do_sched_yield()
    drm/amdgpu: fix incorrect enum type
    crypto: talitos - Endianess in current_desc_hdr()
    crypto: talitos - Fix return type of current_desc_hdr()
    crypto: inside-secure - Fix sizeof() mismatch
    ASoC: sun4i-i2s: Fix lrck_period computation for I2S justified mode
    drm/msm: Add missing stub definition
    ARM: dts: aspeed: tiogapass: Remove vuart
    drm/amdgpu: fix build_coefficients() argument
    powerpc/64: Set up a kernel stack for secondaries before cpu_restore()
    spi: img-spfi: fix reference leak in img_spfi_resume
    f2fs: call f2fs_get_meta_page_retry for nat page
    RDMA/mlx5: Fix corruption of reg_pages in mlx5_ib_rereg_user_mr()
    perf test: Use generic event for expand_libpfm_events()
    drm/msm/dp: DisplayPort PHY compliance tests fixup
    drm/msm/dsi_pll_7nm: restore VCO rate during restore_state
    drm/msm/dsi_pll_10nm: restore VCO rate during restore_state
    drm/msm/dpu: fix clock scaling on non-sc7180 board
    spi: spi-mem: fix reference leak in spi_mem_access_start
    scsi: aacraid: Improve compat_ioctl handlers
    pinctrl: core: Add missing #ifdef CONFIG_GPIOLIB
    ASoC: pcm: DRAIN support reactivation
    drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe
    crypto: arm64/poly1305-neon - reorder PAC authentication with SP update
    crypto: arm/aes-neonbs - fix usage of cbc(aes) fallback
    crypto: caam - fix printing on xts fallback allocation error path
    selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling
    nl80211/cfg80211: fix potential infinite loop
    spi: stm32: fix reference leak in stm32_spi_resume
    bpf: Fix tests for local_storage
    x86/mce: Correct the detection of invalid notifier priorities
    drm/edid: Fix uninitialized variable in drm_cvt_modes()
    ath11k: Initialize complete alpha2 for regulatory change
    ath11k: Fix number of rules in filtered ETSI regdomain
    ath11k: fix wmi init configuration
    brcmfmac: Fix memory leak for unpaired brcmf_{alloc/free}
    arm64: dts: exynos: Include common syscon restart/poweroff for Exynos7
    arm64: dts: exynos: Correct psci compatible used on Exynos7
    drm/panel: simple: Add flags to boe_nv133fhm_n61
    Bluetooth: Fix null pointer dereference in hci_event_packet()
    Bluetooth: Fix: LL PRivacy BLE device fails to connect
    Bluetooth: hci_h5: fix memory leak in h5_close
    spi: stm32-qspi: fix reference leak in stm32 qspi operations
    spi: spi-ti-qspi: fix reference leak in ti_qspi_setup
    spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe
    spi: tegra20-slink: fix reference leak in slink ops of tegra20
    spi: tegra20-sflash: fix reference leak in tegra_sflash_resume
    spi: tegra114: fix reference leak in tegra spi ops
    spi: bcm63xx-hsspi: fix missing clk_disable_unprepare() on error in bcm63xx_hsspi_resume
    spi: imx: fix reference leak in two imx operations
    ASoC: qcom: common: Fix refcounting in qcom_snd_parse_of()
    ath11k: Handle errors if peer creation fails
    mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure
    drm/msm/a6xx: Clear shadow on suspend
    drm/msm/a5xx: Clear shadow on suspend
    firmware: tegra: fix strncpy()/strncat() confusion
    drm/msm/dp: return correct connection status after suspend
    drm/msm/dp: skip checking LINK_STATUS_UPDATED bit
    drm/msm/dp: do not notify audio subsystem if sink doesn't support audio
    selftests/run_kselftest.sh: fix dry-run typo
    selftest/bpf: Add missed ip6ip6 test back
    ASoC: wm8994: Fix PM disable depth imbalance on error
    ASoC: wm8998: Fix PM disable depth imbalance on error
    spi: sprd: fix reference leak in sprd_spi_remove
    virtiofs fix leak in setup
    ASoC: arizona: Fix a wrong free in wm8997_probe
    RDMa/mthca: Work around -Wenum-conversion warning
    ASoC: SOF: Intel: fix Kconfig dependency for SND_INTEL_DSP_CONFIG
    arm64: dts: ti: k3-am65*/j721e*: Fix unit address format error for dss node
    MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA
    drm/amdgpu: fix compute queue priority if num_kcq is less than 4
    soc: ti: omap-prm: Do not check rstst bit on deassert if already deasserted
    crypto: Kconfig - CRYPTO_MANAGER_EXTRA_TESTS requires the manager
    crypto: qat - fix status check in qat_hal_put_rel_rd_xfer()
    firmware: arm_scmi: Fix missing destroy_workqueue()
    drm/udl: Fix missing error code in udl_handle_damage()
    staging: greybus: codecs: Fix reference counter leak in error handling
    staging: gasket: interrupt: fix the missed eventfd_ctx_put() in gasket_interrupt.c
    scripts: kernel-doc: Restore anonymous enum parsing
    drm/amdkfd: Put ACPI table after using it
    ionic: use mc sync for multicast filters
    ionic: flatten calls to ionic_lif_rx_mode
    ionic: change set_rx_mode from_ndo to can_sleep
    media: tm6000: Fix sizeof() mismatches
    media: platform: add missing put_device() call in mtk_jpeg_clk_init()
    media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_dec_pm()
    media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm()
    media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_enc_pm()
    media: v4l2-fwnode: Return -EINVAL for invalid bus-type
    media: v4l2-fwnode: v4l2_fwnode_endpoint_parse caller must init vep argument
    media: ov5640: fix support of BT656 bus mode
    media: staging: rkisp1: cap: fix runtime PM imbalance on error
    media: cedrus: fix reference leak in cedrus_start_streaming
    media: platform: add missing put_device() call in mtk_jpeg_probe() and mtk_jpeg_remove()
    media: venus: core: change clk enable and disable order in resume and suspend
    media: venus: core: vote for video-mem path
    media: venus: core: vote with average bandwidth and peak bandwidth as zero
    RDMA/cma: Add missing error handling of listen_id
    ASoC: meson: fix COMPILE_TEST error
    spi: dw: fix build error by selecting MULTIPLEXER
    scsi: core: Fix VPD LUN ID designator priorities
    media: venus: put dummy vote on video-mem path after last session release
    media: solo6x10: fix missing snd_card_free in error handling case
    video: fbdev: atmel_lcdfb: fix return error code in atmel_lcdfb_of_init()
    mmc: sdhci: tegra: fix wrong unit with busy_timeout
    drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
    drm/meson: Free RDMA resources after tearing down DRM
    drm/meson: Unbind all connectors on module removal
    drm/meson: dw-hdmi: Register a callback to disable the regulator
    drm/meson: dw-hdmi: Ensure that clocks are enabled before touching the TOP registers
    ASoC: intel: SND_SOC_INTEL_KEEMBAY should depend on ARCH_KEEMBAY
    iommu/vt-d: include conditionally on CONFIG_INTEL_IOMMU_SVM
    Input: ads7846 - fix race that causes missing releases
    Input: ads7846 - fix integer overflow on Rt calculation
    Input: ads7846 - fix unaligned access on 7845
    bus: mhi: core: Remove double locking from mhi_driver_remove()
    bus: mhi: core: Fix null pointer access when parsing MHI configuration
    usb/max3421: fix return error code in max3421_probe()
    spi: mxs: fix reference leak in mxs_spi_probe
    selftests/bpf: Fix broken riscv build
    powerpc: Avoid broken GCC __attribute__((optimize))
    powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32
    ARM: dts: tacoma: Fix node vs reg mismatch for flash memory
    Revert "powerpc/pseries/hotplug-cpu: Remove double free in error path"
    powerpc/powernv/sriov: fix unsigned int win compared to less than zero
    mfd: htc-i2cpld: Add the missed i2c_put_adapter() in htcpld_register_chip_i2c()
    mfd: MFD_SL28CPLD should depend on ARCH_LAYERSCAPE
    mfd: stmfx: Fix dev_err_probe() call in stmfx_chip_init()
    mfd: cpcap: Fix interrupt regression with regmap clear_ack
    EDAC/mce_amd: Use struct cpuinfo_x86.cpu_die_id for AMD NodeId
    scsi: ufs: Avoid to call REQ_CLKS_OFF to CLKS_OFF
    scsi: ufs: Fix clkgating on/off
    rcu: Allow rcu_irq_enter_check_tick() from NMI
    rcu,ftrace: Fix ftrace recursion
    rcu/tree: Defer kvfree_rcu() allocation to a clean context
    crypto: crypto4xx - Replace bitwise OR with logical OR in crypto4xx_build_pd
    crypto: omap-aes - Fix PM disable depth imbalance in omap_aes_probe
    crypto: sun8i-ce - fix two error path's memory leak
    spi: fix resource leak for drivers without .remove callback
    drm/meson: dw-hdmi: Disable clocks on driver teardown
    drm/meson: dw-hdmi: Enable the iahb clock early enough
    PCI: Disable MSI for Pericom PCIe-USB adapter
    PCI: brcmstb: Initialize "tmp" before use
    soc: ti: knav_qmss: fix reference leak in knav_queue_probe
    soc: ti: Fix reference imbalance in knav_dma_probe
    drivers: soc: ti: knav_qmss_queue: Fix error return code in knav_queue_probe
    soc: qcom: initialize local variable
    arm64: dts: qcom: sm8250: correct compatible for sm8250-mtp
    arm64: dts: qcom: msm8916-samsung-a2015: Disable muic i2c pin bias
    Input: omap4-keypad - fix runtime PM error handling
    clk: meson: Kconfig: fix dependency for G12A
    staging: mfd: hi6421-spmi-pmic: fix error return code in hi6421_spmi_pmic_probe()
    ath11k: Fix the rx_filter flag setting for peer rssi stats
    RDMA/cxgb4: Validate the number of CQEs
    soundwire: Fix DEBUG_LOCKS_WARN_ON for uninitialized attribute
    pinctrl: sunxi: fix irq bank map for the Allwinner A100 pin controller
    memstick: fix a double-free bug in memstick_check
    ARM: dts: at91: sam9x60: add pincontrol for USB Host
    ARM: dts: at91: sama5d4_xplained: add pincontrol for USB Host
    ARM: dts: at91: sama5d3_xplained: add pincontrol for USB Host
    mmc: pxamci: Fix error return code in pxamci_probe
    brcmfmac: fix error return code in brcmf_cfg80211_connect()
    orinoco: Move context allocation after processing the skb
    qtnfmac: fix error return code in qtnf_pcie_probe()
    rsi: fix error return code in rsi_reset_card()
    cw1200: fix missing destroy_workqueue() on error in cw1200_init_common
    dmaengine: mv_xor_v2: Fix error return code in mv_xor_v2_probe()
    arm64: dts: qcom: sdm845: Limit ipa iommu streams
    leds: netxbig: add missing put_device() call in netxbig_leds_get_of_pdata()
    leds: lp50xx: Fix an error handling path in 'lp50xx_probe_dt()'
    leds: turris-omnia: check for LED_COLOR_ID_RGB instead LED_COLOR_ID_MULTI
    arm64: tegra: Fix DT binding for IO High Voltage entry
    RDMA/cma: Fix deadlock on &lock in rdma_cma_listen_on_all() error unwind
    soundwire: qcom: Fix build failure when slimbus is module
    drm/imx/dcss: fix rotations for Vivante tiled formats
    media: siano: fix memory leak of debugfs members in smsdvb_hotplug
    platform/x86: mlx-platform: Remove PSU EEPROM from default platform configuration
    platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform configuration
    arm64: dts: qcom: sc7180: limit IPA iommu streams
    RDMA/hns: Only record vlan info for HIP08
    RDMA/hns: Fix missing fields in address vector
    RDMA/hns: Avoid setting loopback indicator when smac is same as dmac
    serial: 8250-mtk: Fix reference leak in mtk8250_probe
    samples: bpf: Fix lwt_len_hist reusing previous BPF map
    media: imx214: Fix stop streaming
    mips: cdmm: fix use-after-free in mips_cdmm_bus_discover
    media: max2175: fix max2175_set_csm_mode() error code
    slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI
    RDMA/core: Track device memory MRs
    drm/mediatek: Use correct aliases name for ovl
    HSI: omap_ssi: Don't jump to free ID in ssi_add_controller()
    ARM: dts: Remove non-existent i2c1 from 98dx3236
    arm64: dts: armada-3720-turris-mox: update ethernet-phy handle name
    power: supply: bq25890: Use the correct range for IILIM register
    arm64: dts: rockchip: Set dr_mode to "host" for OTG on rk3328-roc-cc
    power: supply: max17042_battery: Fix current_{avg,now} hiding with no current sense
    power: supply: axp288_charger: Fix HP Pavilion x2 10 DMI matching
    power: supply: bq24190_charger: fix reference leak
    genirq/irqdomain: Don't try to free an interrupt that has no mapping
    arm64: dts: ls1028a: fix ENETC PTP clock input
    arm64: dts: ls1028a: fix FlexSPI clock input
    arm64: dts: freescale: sl28: combine SPI MTD partitions
    phy: tegra: xusb: Fix usb_phy device driver field
    arm64: dts: qcom: c630: Polish i2c-hid devices
    arm64: dts: qcom: c630: Fix pinctrl pins properties
    PCI: Bounds-check command-line resource alignment requests
    PCI: Fix overflow in command-line resource alignment requests
    PCI: iproc: Fix out-of-bound array accesses
    PCI: iproc: Invalidate correct PAXB inbound windows
    arm64: dts: meson: fix spi-max-frequency on Khadas VIM2
    arm64: dts: meson-sm1: fix typo in opp table
    soc: amlogic: canvas: add missing put_device() call in meson_canvas_get()
    scsi: hisi_sas: Fix up probe error handling for v3 hw
    scsi: pm80xx: Do not sleep in atomic context
    spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
    ARM: dts: at91: at91sam9rl: fix ADC triggers
    RDMA/hns: Fix 0-length sge calculation error
    RDMA/hns: Bugfix for calculation of extended sge
    mailbox: arm_mhu_db: Fix mhu_db_shutdown by replacing kfree with devm_kfree
    soundwire: master: use pm_runtime_set_active() on add
    platform/x86: dell-smbios-base: Fix error return code in dell_smbios_init
    ASoC: Intel: Boards: tgl_max98373: update TDM slot_width
    media: max9271: Fix GPIO enable/disable
    media: rdacm20: Enable GPIO1 explicitly
    media: i2c: imx219: Selection compliance fixes
    ath11k: Don't cast ath11k_skb_cb to ieee80211_tx_info.control
    ath11k: Reset ath11k_skb_cb before setting new flags
    ath11k: Fix an error handling path
    ath10k: Fix the parsing error in service available event
    ath10k: Fix an error handling path
    ath10k: Release some resources in an error handling path
    SUNRPC: rpc_wake_up() should wake up tasks in the correct order
    NFSv4.2: condition READDIR's mask for security label based on LSM state
    SUNRPC: xprt_load_transport() needs to support the netid "rdma6"
    NFSv4: Fix the alignment of page data in the getdeviceinfo reply
    net: sunrpc: Fix 'snprintf' return value check in 'do_xprt_debugfs'
    lockd: don't use interval-based rebinding over TCP
    NFS: switch nfsiod to be an UNBOUND workqueue.
    selftests/seccomp: Update kernel config
    vfio-pci: Use io_remap_pfn_range() for PCI IO memory
    hwmon: (ina3221) Fix PM usage counter unbalance in ina3221_write_enable
    f2fs: fix double free of unicode map
    media: tvp5150: Fix wrong return value of tvp5150_parse_dt()
    media: saa7146: fix array overflow in vidioc_s_audio()
    powerpc/perf: Fix crash with is_sier_available when pmu is not set
    powerpc/64: Fix an EMIT_BUG_ENTRY in head_64.S
    powerpc/xmon: Fix build failure for 8xx
    powerpc/perf: Fix to update radix_scope_qual in power10
    powerpc/perf: Update the PMU group constraints for l2l3 events in power10
    powerpc/perf: Fix the PMU group constraints for threshold events in power10
    clocksource/drivers/orion: Add missing clk_disable_unprepare() on error path
    clocksource/drivers/cadence_ttc: Fix memory leak in ttc_setup_clockevent()
    clocksource/drivers/ingenic: Fix section mismatch
    clocksource/drivers/riscv: Make RISCV_TIMER depends on RISCV_SBI
    arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE
    iio: hrtimer-trigger: Mark hrtimer to expire in hard interrupt context
    libbpf: Sanitise map names before pinning
    ARM: dts: at91: sam9x60ek: remove bypass property
    ARM: dts: at91: sama5d2: map securam as device
    scripts: kernel-doc: fix parsing function-like typedefs
    bpf: Fix bpf_put_raw_tracepoint()'s use of __module_address()
    selftests/bpf: Fix invalid use of strncat in test_sockmap
    pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe()
    soc: rockchip: io-domain: Fix error return code in rockchip_iodomain_probe()
    arm64: dts: rockchip: Fix UART pull-ups on rk3328
    memstick: r592: Fix error return in r592_probe()
    MIPS: Don't round up kernel sections size for memblock_add()
    mt76: mt7663s: fix a possible ple quota underflow
    mt76: mt7915: set fops_sta_stats.owner to THIS_MODULE
    mt76: set fops_tx_stats.owner to THIS_MODULE
    mt76: dma: fix possible deadlock running mt76_dma_cleanup
    net/mlx5: Properly convey driver version to firmware
    mt76: fix memory leak if device probing fails
    mt76: fix tkip configuration for mt7615/7663 devices
    ASoC: jz4740-i2s: add missed checks for clk_get()
    ASoC: q6afe-clocks: Add missing parent clock rate
    dm ioctl: fix error return code in target_message
    ASoC: cros_ec_codec: fix uninitialized memory read
    ASoC: atmel: mchp-spdifrx needs COMMON_CLK
    ASoC: qcom: fix QDSP6 dependencies, attempt #3
    phy: mediatek: allow compile-testing the hdmi phy
    phy: renesas: rcar-gen3-usb2: disable runtime pm in case of failure
    memory: ti-emif-sram: only build for ARMv7
    memory: jz4780_nemc: Fix potential NULL dereference in jz4780_nemc_probe()
    drm/msm: a5xx: Make preemption reset case reentrant
    drm/msm: add IOMMU_SUPPORT dependency
    clocksource/drivers/arm_arch_timer: Use stable count reader in erratum sne
    clocksource/drivers/arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI
    cpufreq: ap806: Add missing MODULE_DEVICE_TABLE
    cpufreq: highbank: Add missing MODULE_DEVICE_TABLE
    cpufreq: mediatek: Add missing MODULE_DEVICE_TABLE
    cpufreq: qcom: Add missing MODULE_DEVICE_TABLE
    cpufreq: st: Add missing MODULE_DEVICE_TABLE
    cpufreq: sun50i: Add missing MODULE_DEVICE_TABLE
    cpufreq: loongson1: Add missing MODULE_ALIAS
    cpufreq: scpi: Add missing MODULE_ALIAS
    cpufreq: vexpress-spc: Add missing MODULE_ALIAS
    cpufreq: imx: fix NVMEM_IMX_OCOTP dependency
    macintosh/adb-iop: Always wait for reply message from IOP
    macintosh/adb-iop: Send correct poll command
    staging: bcm2835: fix vchiq_mmal dependencies
    staging: greybus: audio: Fix possible leak free widgets in gbaudio_dapm_free_controls
    spi: dw: Fix error return code in dw_spi_bt1_probe()
    Bluetooth: btusb: Add the missed release_firmware() in btusb_mtk_setup_firmware()
    Bluetooth: btmtksdio: Add the missed release_firmware() in mtk_setup_firmware()
    Bluetooth: sco: Fix crash when using BT_SNDMTU/BT_RCVMTU option
    block/rnbd-clt: Dynamically alloc buffer for pathname & blk_symlink_name
    block/rnbd: fix a null pointer dereference on dev->blk_symlink_name
    Bluetooth: btusb: Fix detection of some fake CSR controllers with a bcdDevice val of 0x0134
    platform/x86: intel-vbtn: Fix SW_TABLET_MODE always reporting 1 on some HP x360 models
    adm8211: fix error return code in adm8211_probe()
    mtd: spi-nor: sst: fix BPn bits for the SST25VF064C
    mtd: spi-nor: ignore errors in spi_nor_unlock_all()
    mtd: spi-nor: atmel: remove global protection flag
    mtd: spi-nor: atmel: fix unlock_all() for AT25FS010/040
    arm64: dts: meson: g12b: odroid-n2: fix PHY deassert timing requirements
    arm64: dts: meson: fix PHY deassert timing requirements
    ARM: dts: meson: fix PHY deassert timing requirements
    arm64: dts: meson: g12a: x96-max: fix PHY deassert timing requirements
    arm64: dts: meson: g12b: w400: fix PHY deassert timing requirements
    clk: fsl-sai: fix memory leak
    scsi: qedi: Fix missing destroy_workqueue() on error in __qedi_probe
    scsi: pm80xx: Fix error return in pm8001_pci_probe()
    scsi: iscsi: Fix inappropriate use of put_device()
    seq_buf: Avoid type mismatch for seq_buf_init
    scsi: fnic: Fix error return code in fnic_probe()
    platform/x86: mlx-platform: Fix item counter assignment for MSN2700, MSN24xx systems
    platform/x86: mlx-platform: Fix item counter assignment for MSN2700/ComEx system
    ARM: 9030/1: entry: omit FP emulation for UND exceptions taken in kernel mode
    powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops
    powerpc/pseries/hibernation: remove redundant cacheinfo update
    powerpc/powermac: Fix low_sleep_handler with CONFIG_VMAP_STACK
    drm/mediatek: avoid dereferencing a null hdmi_phy on an error message
    ASoC: amd: change clk_get() to devm_clk_get() and add missed checks
    coresight: remove broken __exit annotations
    ASoC: max98390: Fix error codes in max98390_dsm_init()
    powerpc/mm: sanity_check_fault() should work for all, not only BOOK3S
    usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe
    usb: oxu210hp-hcd: Fix memory leak in oxu_create
    speakup: fix uninitialized flush_lock
    nfsd: Fix message level for normal termination
    NFSD: Fix 5 seconds delay when doing inter server copy
    nfs_common: need lock during iterate through the list
    x86/kprobes: Restore BTF if the single-stepping is cancelled
    scsi: qla2xxx: Fix FW initialization error on big endian machines
    scsi: qla2xxx: Fix N2N and NVMe connect retry failure
    platform/chrome: cros_ec_spi: Don't overwrite spi::mode
    misc: pci_endpoint_test: fix return value of error branch
    bus: fsl-mc: add back accidentally dropped error check
    bus: fsl-mc: fix error return code in fsl_mc_object_allocate()
    fsi: Aspeed: Add mutex to protect HW access
    s390/cio: fix use-after-free in ccw_device_destroy_console
    iwlwifi: dbg-tlv: fix old length in is_trig_data_contained()
    iwlwifi: mvm: hook up missing RX handlers
    erofs: avoid using generic_block_bmap
    clk: renesas: r8a779a0: Fix R and OSC clocks
    can: m_can: m_can_config_endisable(): remove double clearing of clock stop request bit
    powerpc/sstep: Emulate prefixed instructions only when CPU_FTR_ARCH_31 is set
    powerpc/sstep: Cover new VSX instructions under CONFIG_VSX
    slimbus: qcom: fix potential NULL dereference in qcom_slim_prg_slew()
    ALSA: hda/hdmi: fix silent stream for first playback to DP
    RDMA/core: Do not indicate device ready when device enablement fails
    RDMA/uverbs: Fix incorrect variable type
    remoteproc/mediatek: change MT8192 CFG register base
    remoteproc/mtk_scp: surround DT device IDs with CONFIG_OF
    remoteproc: q6v5-mss: fix error handling in q6v5_pds_enable
    remoteproc: qcom: fix reference leak in adsp_start
    remoteproc: qcom: pas: fix error handling in adsp_pds_enable
    remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories()
    remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio()
    remoteproc/mediatek: unprepare clk if scp_before_load fails
    clk: qcom: gcc-sc7180: Use floor ops for sdcc clks
    clk: tegra: Fix duplicated SE clock entry
    mtd: rawnand: gpmi: fix reference count leak in gpmi ops
    mtd: rawnand: meson: Fix a resource leak in init
    mtd: rawnand: gpmi: Fix the random DMA timeout issue
    samples/bpf: Fix possible hang in xdpsock with multiple threads
    fs: Handle I_DONTCACHE in iput_final() instead of generic_drop_inode()
    extcon: max77693: Fix modalias string
    crypto: atmel-i2c - select CONFIG_BITREVERSE
    mac80211: don't set set TDLS STA bandwidth wider than possible
    mac80211: fix a mistake check for rx_stats update
    ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
    irqchip/alpine-msi: Fix freeing of interrupts on allocation error path
    irqchip/ti-sci-inta: Fix printing of inta id on probe success
    irqchip/ti-sci-intr: Fix freeing of irqs
    dmaengine: ti: k3-udma: Correct normal channel offset when uchan_cnt is not 0
    RDMA/hns: Limit the length of data copied between kernel and userspace
    RDMA/hns: Normalization the judgment of some features
    RDMA/hns: Do shift on traffic class when using RoCEv2
    gpiolib: irq hooks: fix recursion in gpiochip_irq_unmask
    ath11k: Fix incorrect tlvs in scan start command
    irqchip/qcom-pdc: Fix phantom irq when changing between rising/falling
    watchdog: armada_37xx: Add missing dependency on HAS_IOMEM
    watchdog: sirfsoc: Add missing dependency on HAS_IOMEM
    watchdog: sprd: remove watchdog disable from resume fail path
    watchdog: sprd: check busy bit before new loading rather than after that
    watchdog: Fix potential dereferencing of null pointer
    ubifs: Fix error return code in ubifs_init_authentication()
    um: Monitor error events in IRQ controller
    um: tty: Fix handling of close in tty lines
    um: chan_xterm: Fix fd leak
    sunrpc: fix xs_read_xdr_buf for partial pages receive
    RDMA/mlx5: Fix MR cache memory leak
    RDMA/cma: Don't overwrite sgid_attr after device is released
    nfc: s3fwrn5: Release the nfc firmware
    drm: mxsfb: Silence -EPROBE_DEFER while waiting for bridge
    powerpc/perf: Fix Threshold Event Counter Multiplier width for P10
    powerpc/ps3: use dma_mapping_error()
    perf test: Fix metric parsing test
    drm/amdgpu: fix regression in vbios reservation handling on headless
    mm/gup: reorganize internal_get_user_pages_fast()
    mm/gup: prevent gup_fast from racing with COW during fork
    mm/gup: combine put_compound_head() and unpin_user_page()
    mm: memcg/slab: fix return of child memcg objcg for root memcg
    mm: memcg/slab: fix use after free in obj_cgroup_charge
    mm/rmap: always do TTU_IGNORE_ACCESS
    sparc: fix handling of page table constructor failure
    mm/vmalloc: Fix unlock order in s_stop()
    mm/vmalloc.c: fix kasan shadow poisoning size
    mm,memory_failure: always pin the page in madvise_inject_error
    hugetlb: fix an error code in hugetlb_reserve_pages()
    mm: don't wake kswapd prematurely when watermark boosting is disabled
    proc: fix lookup in /proc/net subdirectories after setns(2)
    checkpatch: fix unescaped left brace
    s390/test_unwind: fix CALL_ON_STACK tests
    lan743x: fix rx_napi_poll/interrupt ping-pong
    ice, xsk: clear the status bits for the next_to_use descriptor
    i40e, xsk: clear the status bits for the next_to_use descriptor
    net: dsa: qca: ar9331: fix sleeping function called from invalid context bug
    dpaa2-eth: fix the size of the mapped SGT buffer
    net: bcmgenet: Fix a resource leak in an error handling path in the probe functin
    net: mscc: ocelot: Fix a resource leak in the error handling path of the probe function
    net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function
    block/rnbd-clt: Get rid of warning regarding size argument in strlcpy
    block/rnbd-clt: Fix possible memleak
    NFS/pNFS: Fix a typo in ff_layout_resend_pnfs_read()
    net: korina: fix return value
    devlink: use _BITUL() macro instead of BIT() in the UAPI header
    libnvdimm/label: Return -ENXIO for no slot in __blk_label_update
    powerpc/32s: Fix cleanup_cpu_mmu_context() compile bug
    watchdog: qcom: Avoid context switch in restart handler
    watchdog: coh901327: add COMMON_CLK dependency
    clk: ti: Fix memleak in ti_fapll_synth_setup
    pwm: zx: Add missing cleanup in error path
    pwm: lp3943: Dynamically allocate PWM chip base
    pwm: imx27: Fix overflow for bigger periods
    pwm: sun4i: Remove erroneous else branch
    io_uring: cancel only requests of current task
    tools build: Add missing libcap to test-all.bin target
    perf record: Fix memory leak when using '--user-regs=?' to list registers
    qlcnic: Fix error code in probe
    nfp: move indirect block cleanup to flower app stop callback
    vdpa/mlx5: Use write memory barrier after updating CQ index
    virtio_ring: Cut and paste bugs in vring_create_virtqueue_packed()
    virtio_net: Fix error code in probe()
    virtio_ring: Fix two use after free bugs
    vhost scsi: fix error return code in vhost_scsi_set_endpoint()
    epoll: check for events when removing a timed out thread from the wait queue
    clk: bcm: dvp: Add MODULE_DEVICE_TABLE()
    clk: at91: sama7g5: fix compilation error
    clk: at91: sam9x60: remove atmel,osc-bypass support
    clk: s2mps11: Fix a resource leak in error handling paths in the probe function
    clk: sunxi-ng: Make sure divider tables have sentinel
    clk: vc5: Use "idt,voltage-microvolt" instead of "idt,voltage-microvolts"
    kconfig: fix return value of do_error_if()
    powerpc/boot: Fix build of dts/fsl
    powerpc/smp: Add __init to init_big_cores()
    ARM: 9044/1: vfp: use undef hook for VFP support detection
    ARM: 9036/1: uncompress: Fix dbgadtb size parameter name
    perf probe: Fix memory leak when synthesizing SDT probes
    io_uring: fix racy IOPOLL flush overflow
    io_uring: cancel reqs shouldn't kill overflow list
    Smack: Handle io_uring kernel thread privileges
    proc mountinfo: make splice available again
    io_uring: fix io_cqring_events()'s noflush
    io_uring: fix racy IOPOLL completions
    io_uring: always let io_iopoll_complete() complete polled io
    vfio/pci: Move dummy_resources_list init in vfio_pci_probe()
    vfio/pci/nvlink2: Do not attempt NPU2 setup on POWER8NVL NPU
    media: gspca: Fix memory leak in probe
    io_uring: fix io_wqe->work_list corruption
    io_uring: fix 0-iov read buffer select
    io_uring: hold uring_lock while completing failed polled io in io_wq_submit_work()
    io_uring: fix ignoring xa_store errors
    io_uring: fix double io_uring free
    io_uring: make ctx cancel on exit targeted to actual ctx
    media: sunxi-cir: ensure IR is handled when it is continuous
    media: netup_unidvb: Don't leak SPI master in probe error path
    media: ipu3-cio2: Remove traces of returned buffers
    media: ipu3-cio2: Return actual subdev format
    media: ipu3-cio2: Serialise access to pad format
    media: ipu3-cio2: Validate mbus format in setting subdev format
    media: ipu3-cio2: Make the field on subdev format V4L2_FIELD_NONE
    Input: cyapa_gen6 - fix out-of-bounds stack access
    ALSA: hda/ca0132 - Change Input Source enum strings.
    ACPI: NFIT: Fix input validation of bus-family
    PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup()
    Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks"
    ACPI: PNP: compare the string length in the matching_id()
    ALSA: hda: Fix regressions on clear and reconfig sysfs
    ALSA: hda/ca0132 - Fix AE-5 rear headphone pincfg.
    ALSA: hda/realtek: make bass spk volume adjustable on a yoga laptop
    ALSA: hda/realtek - Enable headset mic of ASUS X430UN with ALC256
    ALSA: hda/realtek - Enable headset mic of ASUS Q524UQK with ALC255
    ALSA: hda/realtek - Add supported for more Lenovo ALC285 Headset Button
    ALSA: pcm: oss: Fix a few more UBSAN fixes
    ALSA/hda: apply jack fixup for the Acer Veriton N4640G/N6640G/N2510G
    ALSA: hda/realtek: Add quirk for MSI-GP73
    ALSA: hda/realtek: Apply jack fixup for Quanta NL3
    ALSA: hda/realtek: Remove dummy lineout on Acer TravelMate P648/P658
    ALSA: hda/realtek - Supported Dell fixed type headset
    ALSA: usb-audio: Add VID to support native DSD reproduction on FiiO devices
    ALSA: usb-audio: Disable sample read check if firmware doesn't give back
    ALSA: usb-audio: Add alias entry for ASUS PRIME TRX40 PRO-S
    ALSA: core: memalloc: add page alignment for iram
    s390/smp: perform initial CPU reset also for SMT siblings
    s390/kexec_file: fix diag308 subcode when loading crash kernel
    s390/idle: add missing mt_cycles calculation
    s390/idle: fix accounting with machine checks
    s390/dasd: fix hanging device offline processing
    s390/dasd: prevent inconsistent LCU device data
    s390/dasd: fix list corruption of pavgroup group list
    s390/dasd: fix list corruption of lcu list
    binder: add flag to clear buffer on txn complete
    ASoC: cx2072x: Fix doubly definitions of Playback and Capture streams
    ASoC: AMD Renoir - add DMI table to avoid the ACP mic probe (broken BIOS)
    ASoC: AMD Raven/Renoir - fix the PCI probe (PCI revision)
    staging: comedi: mf6x4: Fix AI end-of-conversion detection
    z3fold: simplify freeing slots
    z3fold: stricter locking and more careful reclaim
    perf/x86/intel: Add event constraint for CYCLE_ACTIVITY.STALLS_MEM_ANY
    perf/x86/intel: Fix rtm_abort_event encoding on Ice Lake
    perf/x86/intel/lbr: Fix the return type of get_lbr_cycles()
    powerpc/perf: Exclude kernel samples while counting events in user space.
    cpufreq: intel_pstate: Use most recent guaranteed performance values
    crypto: ecdh - avoid unaligned accesses in ecdh_set_secret()
    crypto: arm/aes-ce - work around Cortex-A57/A72 silion errata
    m68k: Fix WARNING splat in pmac_zilog driver
    Documentation: seqlock: s/LOCKTYPE/LOCKNAME/g
    EDAC/i10nm: Use readl() to access MMIO registers
    EDAC/amd64: Fix PCI component registration
    cpuset: fix race between hotplug work and later CPU offline
    dyndbg: fix use before null check
    USB: serial: mos7720: fix parallel-port state restore
    USB: serial: digi_acceleport: fix write-wakeup deadlocks
    USB: serial: keyspan_pda: fix dropped unthrottle interrupts
    USB: serial: keyspan_pda: fix write deadlock
    USB: serial: keyspan_pda: fix stalled writes
    USB: serial: keyspan_pda: fix write-wakeup use-after-free
    USB: serial: keyspan_pda: fix tx-unthrottle use-after-free
    USB: serial: keyspan_pda: fix write unthrottling
    btrfs: do not shorten unpin len for caching block groups
    btrfs: update last_byte_to_unpin in switch_commit_roots
    btrfs: fix race when defragmenting leads to unnecessary IO
    ext4: fix an IS_ERR() vs NULL check
    ext4: fix a memory leak of ext4_free_data
    ext4: fix deadlock with fs freezing and EA inodes
    ext4: don't remount read-only with errors=continue on reboot
    RISC-V: Fix usage of memblock_enforce_memory_limit
    arm64: dts: ti: k3-am65: mark dss as dma-coherent
    arm64: dts: marvell: keep SMMU disabled by default for Armada 7040 and 8040
    KVM: arm64: Introduce handling of AArch32 TTBCR2 traps
    KVM: x86: reinstate vendor-agnostic check on SPEC_CTRL cpuid bits
    KVM: SVM: Remove the call to sev_platform_status() during setup
    iommu/arm-smmu: Allow implementation specific write_s2cr
    iommu/arm-smmu-qcom: Read back stream mappings
    iommu/arm-smmu-qcom: Implement S2CR quirk
    ARM: dts: pandaboard: fix pinmux for gpio user button of Pandaboard ES
    ARM: dts: at91: sama5d2: fix CAN message ram offset and size
    ARM: tegra: Populate OPP table for Tegra20 Ventana
    xprtrdma: Fix XDRBUF_SPARSE_PAGES support
    powerpc/32: Fix vmap stack - Properly set r1 before activating MMU on syscall too
    powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at
    powerpc/rtas: Fix typo of ibm,open-errinjct in RTAS filter
    powerpc/bitops: Fix possible undefined behaviour with fls() and fls64()
    powerpc/feature: Add CPU_FTR_NOEXECUTE to G2_LE
    powerpc/xmon: Change printk() to pr_cont()
    powerpc/8xx: Fix early debug when SMC1 is relocated
    powerpc/mm: Fix verification of MMU_FTR_TYPE_44x
    powerpc/powernv/npu: Do not attempt NPU2 setup on POWER8NVL NPU
    powerpc/powernv/memtrace: Don't leak kernel memory to user space
    powerpc/powernv/memtrace: Fix crashing the kernel when enabling concurrently
    ovl: make ioctl() safe
    ima: Don't modify file descriptor mode on the fly
    um: Remove use of asprinf in umid.c
    um: Fix time-travel mode
    ceph: fix race in concurrent __ceph_remove_cap invocations
    SMB3: avoid confusing warning message on mount to Azure
    SMB3.1.1: remove confusing mount warning when no SPNEGO info on negprot rsp
    SMB3.1.1: do not log warning message if server doesn't populate salt
    ubifs: wbuf: Don't leak kernel memory to flash
    jffs2: Fix GC exit abnormally
    jffs2: Fix ignoring mounting options problem during remounting
    fsnotify: generalize handle_inode_event()
    inotify: convert to handle_inode_event() interface
    fsnotify: fix events reported to watching parent and child
    jfs: Fix array index bounds check in dbAdjTree
    drm/panfrost: Fix job timeout handling
    drm/panfrost: Move the GPU reset bits outside the timeout handler
    platform/x86: mlx-platform: remove an unused variable
    drm/amdgpu: only set DP subconnector type on DP and eDP connectors
    drm/amd/display: Fix memory leaks in S3 resume
    drm/dp_aux_dev: check aux_dev before use in drm_dp_aux_dev_get_by_minor()
    drm/i915: Fix mismatch between misplaced vma check and vma insert
    iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack
    spi: pxa2xx: Fix use-after-free on unbind
    spi: spi-sh: Fix use-after-free on unbind
    spi: atmel-quadspi: Fix use-after-free on unbind
    spi: spi-mtk-nor: Don't leak SPI master in probe error path
    spi: ar934x: Don't leak SPI master in probe error path
    spi: davinci: Fix use-after-free on unbind
    spi: fsl: fix use of spisel_boot signal on MPC8309
    spi: gpio: Don't leak SPI master in probe error path
    spi: mxic: Don't leak SPI master in probe error path
    spi: npcm-fiu: Disable clock in probe error path
    spi: pic32: Don't leak DMA channels in probe error path
    spi: rb4xx: Don't leak SPI master in probe error path
    spi: rpc-if: Fix use-after-free on unbind
    spi: sc18is602: Don't leak SPI master in probe error path
    spi: spi-geni-qcom: Fix use-after-free on unbind
    spi: spi-qcom-qspi: Fix use-after-free on unbind
    spi: st-ssc4: Fix unbalanced pm_runtime_disable() in probe error path
    spi: synquacer: Disable clock in probe error path
    spi: mt7621: Disable clock in probe error path
    spi: mt7621: Don't leak SPI master in probe error path
    spi: atmel-quadspi: Disable clock in probe error path
    spi: atmel-quadspi: Fix AHB memory accesses
    soc: qcom: smp2p: Safely acquire spinlock without IRQs
    mtd: spinand: Fix OOB read
    mtd: parser: cmdline: Fix parsing of part-names with colons
    mtd: core: Fix refcounting for unpartitioned MTDs
    mtd: rawnand: qcom: Fix DMA sync on FLASH_STATUS register read
    mtd: rawnand: meson: fix meson_nfc_dma_buffer_release() arguments
    scsi: qla2xxx: Fix crash during driver load on big endian machines
    scsi: lpfc: Fix invalid sleeping context in lpfc_sli4_nvmet_alloc()
    scsi: lpfc: Fix scheduling call while in softirq context in lpfc_unreg_rpi
    scsi: lpfc: Re-fix use after free in lpfc_rq_buf_free()
    openat2: reject RESOLVE_BENEATH|RESOLVE_IN_ROOT
    iio: buffer: Fix demux update
    iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume
    iio: imu: st_lsm6dsx: fix edge-trigger interrupts
    iio:light:rpr0521: Fix timestamp alignment and prevent data leak.
    iio:light:st_uvis25: Fix timestamp alignment and prevent data leak.
    iio:magnetometer:mag3110: Fix alignment and data leak issues.
    iio:pressure:mpl3115: Force alignment of buffer
    iio:imu:bmi160: Fix too large a buffer.
    iio:imu:bmi160: Fix alignment and data leak issues
    iio:adc:ti-ads124s08: Fix buffer being too long.
    iio:adc:ti-ads124s08: Fix alignment and data leak issues.
    md/cluster: block reshape with remote resync job
    md/cluster: fix deadlock when node is doing resync job
    pinctrl: sunxi: Always call chained_irq_{enter, exit} in sunxi_pinctrl_irq_handler
    clk: ingenic: Fix divider calculation with div tables
    clk: mvebu: a3700: fix the XTAL MODE pin to MPP1_9
    clk: tegra: Do not return 0 on failure
    counter: microchip-tcb-capture: Fix CMR value check
    device-dax/core: Fix memory leak when rmmod dax.ko
    dma-buf/dma-resv: Respect num_fences when initializing the shared fence list.
    driver: core: Fix list corruption after device_del()
    xen-blkback: set ring->xenblkd to NULL after kthread_stop()
    xen/xenbus: Allow watches discard events before queueing
    xen/xenbus: Add 'will_handle' callback support in xenbus_watch_path()
    xen/xenbus/xen_bus_type: Support will_handle watch callback
    xen/xenbus: Count pending messages for each watch
    xenbus/xenbus_backend: Disallow pending watch messages
    memory: jz4780_nemc: Fix an error pointer vs NULL check in probe()
    memory: renesas-rpc-if: Fix a node reference leak in rpcif_probe()
    memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer()
    memory: renesas-rpc-if: Fix unbalanced pm_runtime_enable in rpcif_{enable,disable}_rpm
    libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels
    platform/x86: intel-vbtn: Allow switch events on Acer Switch Alpha 12
    tracing: Disable ftrace selftests when any tracer is running
    mt76: add back the SUPPORTS_REORDERING_BUFFER flag
    of: fix linker-section match-table corruption
    PCI: Fix pci_slot_release() NULL pointer dereference
    regulator: axp20x: Fix DLDO2 voltage control register mask for AXP22x
    remoteproc: sysmon: Ensure remote notification ordering
    thermal/drivers/cpufreq_cooling: Update cpufreq_state only if state has changed
    rtc: ep93xx: Fix NULL pointer dereference in ep93xx_rtc_read_time
    Revert: "ring-buffer: Remove HAVE_64BIT_ALIGNED_ACCESS"
    null_blk: Fix zone size initialization
    null_blk: Fail zone append to conventional zones
    drm/edid: fix objtool warning in drm_cvt_modes()
    x86/CPU/AMD: Save AMD NodeId as cpu_die_id
    Linux 5.10.4

    Signed-off-by: Greg Kroah-Hartman
    Change-Id: I25209e79d8b9faf5382087955a29b7404bdefe38

    Greg Kroah-Hartman
     
  • [ Upstream commit 200ea5a2292dc444a818b096ae6a32ba3caa51b9 ]

    A previous fix, commit 83370b31a915 ("selinux: fix error initialization
    in inode_doinit_with_dentry()"), changed how failures were handled
    before a SELinux policy was loaded. Unfortunately that patch was
    potentially problematic for two reasons: it set the isec->initialized
    state without holding a lock, and it didn't set the inode's SELinux
    label to the "default" for the particular filesystem. The later can
    be a problem if/when a later attempt to revalidate the inode fails
    and SELinux reverts to the existing inode label.

    This patch should restore the default inode labeling that existed
    before the original fix, without affecting the LABEL_INVALID marking
    such that revalidation will still be attempted in the future.

    Fixes: 83370b31a915 ("selinux: fix error initialization in inode_doinit_with_dentry()")
    Reported-by: Sven Schnelle
    Tested-by: Sven Schnelle
    Reviewed-by: Ondrej Mosnacek
    Signed-off-by: Paul Moore
    Signed-off-by: Sasha Levin

    Paul Moore
     
  • [ Upstream commit 83370b31a915493231e5b9addc72e4bef69f8d31 ]

    Mark the inode security label as invalid if we cannot find
    a dentry so that we will retry later rather than marking it
    initialized with the unlabeled SID.

    Fixes: 9287aed2ad1f ("selinux: Convert isec->lock into a spinlock")
    Signed-off-by: Tianyue Ren
    [PM: minor comment tweaks]
    Signed-off-by: Paul Moore
    Signed-off-by: Sasha Levin

    Tianyue Ren
     

15 Nov, 2020

2 commits


13 Nov, 2020

1 commit

  • Fix to return a negative error code from the error handling case
    instead of 0 in function sel_ib_pkey_sid_slow(), as done elsewhere
    in this function.

    Cc: stable@vger.kernel.org
    Fixes: 409dcf31538a ("selinux: Add a cache for quicker retreival of PKey SIDs")
    Reported-by: Hulk Robot
    Signed-off-by: Chen Zhou
    Signed-off-by: Paul Moore

    Chen Zhou
     

26 Oct, 2020

1 commit


25 Oct, 2020

1 commit


16 Oct, 2020

1 commit

  • Pull char/misc driver updates from Greg KH:
    "Here is the big set of char, misc, and other assorted driver subsystem
    patches for 5.10-rc1.

    There's a lot of different things in here, all over the drivers/
    directory. Some summaries:

    - soundwire driver updates

    - habanalabs driver updates

    - extcon driver updates

    - nitro_enclaves new driver

    - fsl-mc driver and core updates

    - mhi core and bus updates

    - nvmem driver updates

    - eeprom driver updates

    - binder driver updates and fixes

    - vbox minor bugfixes

    - fsi driver updates

    - w1 driver updates

    - coresight driver updates

    - interconnect driver updates

    - misc driver updates

    - other minor driver updates

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'char-misc-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (396 commits)
    binder: fix UAF when releasing todo list
    docs: w1: w1_therm: Fix broken xref, mistakes, clarify text
    misc: Kconfig: fix a HISI_HIKEY_USB dependency
    LSM: Fix type of id parameter in kernel_post_load_data prototype
    misc: Kconfig: add a new dependency for HISI_HIKEY_USB
    firmware_loader: fix a kernel-doc markup
    w1: w1_therm: make w1_poll_completion static
    binder: simplify the return expression of binder_mmap
    test_firmware: Test partial read support
    firmware: Add request_partial_firmware_into_buf()
    firmware: Store opt_flags in fw_priv
    fs/kernel_file_read: Add "offset" arg for partial reads
    IMA: Add support for file reads without contents
    LSM: Add "contents" flag to kernel_read_file hook
    module: Call security_kernel_post_load_data()
    firmware_loader: Use security_post_load_data()
    LSM: Introduce kernel_post_load_data() hook
    fs/kernel_read_file: Add file_size output argument
    fs/kernel_read_file: Switch buffer size arg to size_t
    fs/kernel_read_file: Remove redundant size argument
    ...

    Linus Torvalds
     

14 Oct, 2020

1 commit

  • Pull selinux updates from Paul Moore:
    "A decent number of SELinux patches for v5.10, twenty two in total. The
    highlights are listed below, but all of the patches pass our test
    suite and merge cleanly.

    - A number of changes to how the SELinux policy is loaded and managed
    inside the kernel with the goal of improving the atomicity of a
    SELinux policy load operation.

    These changes account for the bulk of the diffstat as well as the
    patch count. A special thanks to everyone who contributed patches
    and fixes for this work.

    - Convert the SELinux policy read-write lock to RCU.

    - A tracepoint was added for audited SELinux access control events;
    this should help provide a more unified backtrace across kernel and
    userspace.

    - Allow the removal of security.selinux xattrs when a SELinux policy
    is not loaded.

    - Enable policy capabilities in SELinux policies created with the
    scripts/selinux/mdp tool.

    - Provide some "no sooner than" dates for the SELinux checkreqprot
    sysfs deprecation"

    * tag 'selinux-pr-20201012' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: (22 commits)
    selinux: provide a "no sooner than" date for the checkreqprot removal
    selinux: Add helper functions to get and set checkreqprot
    selinux: access policycaps with READ_ONCE/WRITE_ONCE
    selinux: simplify away security_policydb_len()
    selinux: move policy mutex to selinux_state, use in lockdep checks
    selinux: fix error handling bugs in security_load_policy()
    selinux: convert policy read-write lock to RCU
    selinux: delete repeated words in comments
    selinux: add basic filtering for audit trace events
    selinux: add tracepoint on audited events
    selinux: Create new booleans and class dirs out of tree
    selinux: Standardize string literal usage for selinuxfs directory names
    selinux: Refactor selinuxfs directory populating functions
    selinux: Create function for selinuxfs directory cleanup
    selinux: permit removing security.selinux xattr before policy load
    selinux: fix memdup.cocci warnings
    selinux: avoid dereferencing the policy prior to initialization
    selinux: fix allocation failure check on newpolicy->sidtab
    selinux: refactor changing booleans
    selinux: move policy commit after updating selinuxfs
    ...

    Linus Torvalds
     

05 Oct, 2020

3 commits

  • As with the kernel_load_data LSM hook, add a "contents" flag to the
    kernel_read_file LSM hook that indicates whether the LSM can expect
    a matching call to the kernel_post_read_file LSM hook with the full
    contents of the file. With the coming addition of partial file read
    support for kernel_read_file*() API, the LSM will no longer be able
    to always see the entire contents of a file during the read calls.

    For cases where the LSM must read examine the complete file contents,
    it will need to do so on its own every time the kernel_read_file
    hook is called with contents=false (or reject such cases). Adjust all
    existing LSMs to retain existing behavior.

    Signed-off-by: Kees Cook
    Reviewed-by: Mimi Zohar
    Link: https://lore.kernel.org/r/20201002173828.2099543-12-keescook@chromium.org
    Signed-off-by: Greg Kroah-Hartman

    Kees Cook
     
  • There are a few places in the kernel where LSMs would like to have
    visibility into the contents of a kernel buffer that has been loaded or
    read. While security_kernel_post_read_file() (which includes the
    buffer) exists as a pairing for security_kernel_read_file(), no such
    hook exists to pair with security_kernel_load_data().

    Earlier proposals for just using security_kernel_post_read_file() with a
    NULL file argument were rejected (i.e. "file" should always be valid for
    the security_..._file hooks, but it appears at least one case was
    left in the kernel during earlier refactoring. (This will be fixed in
    a subsequent patch.)

    Since not all cases of security_kernel_load_data() can have a single
    contiguous buffer made available to the LSM hook (e.g. kexec image
    segments are separately loaded), there needs to be a way for the LSM to
    reason about its expectations of the hook coverage. In order to handle
    this, add a "contents" argument to the "kernel_load_data" hook that
    indicates if the newly added "kernel_post_load_data" hook will be called
    with the full contents once loaded. That way, LSMs requiring full contents
    can choose to unilaterally reject "kernel_load_data" with contents=false
    (which is effectively the existing hook coverage), but when contents=true
    they can allow it and later evaluate the "kernel_post_load_data" hook
    once the buffer is loaded.

    With this change, LSMs can gain coverage over non-file-backed data loads
    (e.g. init_module(2) and firmware userspace helper), which will happen
    in subsequent patches.

    Additionally prepare IMA to start processing these cases.

    Signed-off-by: Kees Cook
    Reviewed-by: KP Singh
    Link: https://lore.kernel.org/r/20201002173828.2099543-9-keescook@chromium.org
    Signed-off-by: Greg Kroah-Hartman

    Kees Cook
     
  • Move kernel_read_file* out of linux/fs.h to its own linux/kernel_read_file.h
    include file. That header gets pulled in just about everywhere
    and doesn't really need functions not related to the general fs interface.

    Suggested-by: Christoph Hellwig
    Signed-off-by: Scott Branden
    Signed-off-by: Kees Cook
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Mimi Zohar
    Reviewed-by: Luis Chamberlain
    Acked-by: Greg Kroah-Hartman
    Acked-by: James Morris
    Link: https://lore.kernel.org/r/20200706232309.12010-2-scott.branden@broadcom.com
    Link: https://lore.kernel.org/r/20201002173828.2099543-4-keescook@chromium.org
    Signed-off-by: Greg Kroah-Hartman

    Scott Branden
     

16 Sep, 2020

1 commit

  • checkreqprot data member in selinux_state struct is accessed directly by
    SELinux functions to get and set. This could cause unexpected read or
    write access to this data member due to compiler optimizations and/or
    compiler's reordering of access to this field.

    Add helper functions to get and set checkreqprot data member in
    selinux_state struct. These helper functions use READ_ONCE and
    WRITE_ONCE macros to ensure atomic read or write of memory for
    this data member.

    Signed-off-by: Lakshmi Ramasubramanian
    Suggested-by: Stephen Smalley
    Suggested-by: Paul Moore
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Lakshmi Ramasubramanian
     

11 Sep, 2020

1 commit


01 Sep, 2020

1 commit


31 Aug, 2020

1 commit

  • Remove the security_policydb_len() calls from sel_open_policy() and
    instead update the inode size from the size returned from
    security_read_policy().

    Since after this change security_policydb_len() is only called from
    security_load_policy(), remove it entirely and just open-code it there.

    Also, since security_load_policy() is always called with policy_mutex
    held, make it dereference the policy pointer directly and drop the
    unnecessary RCU locking.

    Signed-off-by: Ondrej Mosnacek
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Ondrej Mosnacek
     

27 Aug, 2020

1 commit

  • Move the mutex used to synchronize policy changes (reloads and setting
    of booleans) from selinux_fs_info to selinux_state and use it in
    lockdep checks for rcu_dereference_protected() calls in the security
    server functions. This makes the dependency on the mutex explicit
    in the code rather than relying on comments.

    Signed-off-by: Stephen Smalley
    Reviewed-by: Ondrej Mosnacek
    Signed-off-by: Paul Moore

    Stephen Smalley
     

26 Aug, 2020

1 commit

  • There are a few bugs in the error handling for security_load_policy().

    1) If the newpolicy->sidtab allocation fails then it leads to a NULL
    dereference. Also the error code was not set to -ENOMEM on that
    path.
    2) If policydb_read() failed then we call policydb_destroy() twice
    which meands we call kvfree(p->sym_val_to_name[i]) twice.
    3) If policydb_load_isids() failed then we call sidtab_destroy() twice
    and that results in a double free in the sidtab_destroy_tree()
    function because entry.ptr_inner and entry.ptr_leaf are not set to
    NULL.

    One thing that makes this code nice to deal with is that none of the
    functions return partially allocated data. In other words, the
    policydb_read() either allocates everything successfully or it frees
    all the data it allocates. It never returns a mix of allocated and
    not allocated data.

    I re-wrote this to only free the successfully allocated data which
    avoids the double frees. I also re-ordered selinux_policy_free() so
    it's in the reverse order of the allocation function.

    Fixes: c7c556f1e81b ("selinux: refactor changing booleans")
    Acked-by: Stephen Smalley
    Signed-off-by: Dan Carpenter
    [PM: partially merged by hand due to merge fuzz]
    Signed-off-by: Paul Moore

    Dan Carpenter
     

25 Aug, 2020

1 commit

  • Convert the policy read-write lock to RCU. This is significantly
    simplified by the earlier work to encapsulate the policy data
    structures and refactor the policy load and boolean setting logic.
    Move the latest_granting sequence number into the selinux_policy
    structure so that it can be updated atomically with the policy.
    Since removing the policy rwlock and moving latest_granting reduces
    the selinux_ss structure to nothing more than a wrapper around the
    selinux_policy pointer, get rid of the extra layer of indirection.

    At present this change merely passes a hardcoded 1 to
    rcu_dereference_check() in the cases where we know we do not need to
    take rcu_read_lock(), with the preceding comment explaining why.
    Alternatively we could pass fsi->mutex down from selinuxfs and
    apply a lockdep check on it instead.

    Based in part on earlier attempts to convert the policy rwlock
    to RCU by Kaigai Kohei [1] and by Peter Enderborg [2].

    [1] https://lore.kernel.org/selinux/6e2f9128-e191-ebb3-0e87-74bfccb0767f@tycho.nsa.gov/
    [2] https://lore.kernel.org/selinux/20180530141104.28569-1-peter.enderborg@sony.com/

    Signed-off-by: Stephen Smalley
    Reviewed-by: Ondrej Mosnacek
    Signed-off-by: Paul Moore

    Stephen Smalley
     

24 Aug, 2020

2 commits

  • Drop a repeated word in comments.
    {open, is, then}

    Signed-off-by: Randy Dunlap
    Cc: Paul Moore
    Cc: Stephen Smalley
    Cc: Eric Paris
    Cc: selinux@vger.kernel.org
    Cc: James Morris
    Cc: "Serge E. Hallyn"
    Cc: linux-security-module@vger.kernel.org
    [PM: fix subject line]
    Signed-off-by: Paul Moore

    Randy Dunlap
     
  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

22 Aug, 2020

2 commits

  • This patch adds further attributes to the event. These attributes are
    helpful to understand the context of the message and can be used
    to filter the events.

    There are three common items. Source context, target context and tclass.
    There are also items from the outcome of operation performed.

    An event is similar to:
    -1309 [002] .... 6346.691689: selinux_audited:
    requested=0x4000000 denied=0x4000000 audited=0x4000000
    result=-13
    scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023
    tcontext=system_u:object_r:bin_t:s0 tclass=file

    With systems where many denials are occurring, it is useful to apply a
    filter. The filtering is a set of logic that is inserted with
    the filter file. Example:
    echo "tclass==\"file\" " > events/avc/selinux_audited/filter

    This adds that we only get tclass=file.

    The trace can also have extra properties. Adding the user stack
    can be done with
    echo 1 > options/userstacktrace

    Now the output will be
    runcon-1365 [003] .... 6960.955530: selinux_audited:
    requested=0x4000000 denied=0x4000000 audited=0x4000000
    result=-13
    scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023
    tcontext=system_u:object_r:bin_t:s0 tclass=file
    runcon-1365 [003] .... 6960.955560:
    =>
    =>

    Signed-off-by: Peter Enderborg
    Reviewed-by: Thiébaud Weksteen
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Peter Enderborg
     
  • The audit data currently captures which process and which target
    is responsible for a denial. There is no data on where exactly in the
    process that call occurred. Debugging can be made easier by being able to
    reconstruct the unified kernel and userland stack traces [1]. Add a
    tracepoint on the SELinux denials which can then be used by userland
    (i.e. perf).

    Although this patch could manually be added by each OS developer to
    trouble shoot a denial, adding it to the kernel streamlines the
    developers workflow.

    It is possible to use perf for monitoring the event:
    # perf record -e avc:selinux_audited -g -a
    ^C
    # perf report -g
    [...]
    6.40% 6.40% audited=800000 tclass=4
    |
    __libc_start_main
    |
    |--4.60%--__GI___ioctl
    | entry_SYSCALL_64
    | do_syscall_64
    | __x64_sys_ioctl
    | ksys_ioctl
    | binder_ioctl
    | binder_set_nice
    | can_nice
    | capable
    | security_capable
    | cred_has_capability.isra.0
    | slow_avc_audit
    | common_lsm_audit
    | avc_audit_post_callback
    | avc_audit_post_callback
    |

    It is also possible to use the ftrace interface:
    # echo 1 > /sys/kernel/debug/tracing/events/avc/selinux_audited/enable
    # cat /sys/kernel/debug/tracing/trace
    tracer: nop
    entries-in-buffer/entries-written: 1/1 #P:8
    [...]
    dmesg-3624 [001] 13072.325358: selinux_denied: audited=800000 tclass=4

    The tclass value can be mapped to a class by searching
    security/selinux/flask.h. The audited value is a bit field of the
    permissions described in security/selinux/av_permissions.h for the
    corresponding class.

    [1] https://source.android.com/devices/tech/debug/native_stack_dump

    Signed-off-by: Thiébaud Weksteen
    Suggested-by: Joel Fernandes
    Reviewed-by: Peter Enderborg
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Thiébaud Weksteen
     

21 Aug, 2020

5 commits

  • In order to avoid concurrency issues around selinuxfs resource availability
    during policy load, we first create new directories out of tree for
    reloaded resources, then swap them in, and finally delete the old versions.

    This fix focuses on concurrency in each of the two subtrees swapped, and
    not concurrency between the trees. This means that it is still possible
    that subsequent reads to eg the booleans directory and the class directory
    during a policy load could see the old state for one and the new for the other.
    The problem of ensuring that policy loads are fully atomic from the perspective
    of userspace is larger than what is dealt with here. This commit focuses on
    ensuring that the directories contents always match either the new or the old
    policy state from the perspective of userspace.

    In the previous implementation, on policy load /sys/fs/selinux is updated
    by deleting the previous contents of
    /sys/fs/selinux/{class,booleans} and then recreating them. This means
    that there is a period of time when the contents of these directories do not
    exist which can cause race conditions as userspace relies on them for
    information about the policy. In addition, it means that error recovery in
    the event of failure is challenging.

    In order to demonstrate the race condition that this series fixes, you
    can use the following commands:

    while true; do cat /sys/fs/selinux/class/service/perms/status
    >/dev/null; done &
    while true; do load_policy; done;

    In the existing code, this will display errors fairly often as the class
    lookup fails. (In normal operation from systemd, this would result in a
    permission check which would be allowed or denied based on policy settings
    around unknown object classes.) After applying this patch series you
    should expect to no longer see such error messages.

    Signed-off-by: Daniel Burgener
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Daniel Burgener
     
  • Switch class and policy_capabilities directory names to be referred to with
    global constants, consistent with booleans directory name. This will allow
    for easy consistency of naming in future development.

    Signed-off-by: Daniel Burgener
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Daniel Burgener
     
  • Make sel_make_bools and sel_make_classes take the specific elements of
    selinux_fs_info that they need rather than the entire struct.

    This will allow a future patch to pass temporary elements that are not in
    the selinux_fs_info struct to these functions so that the original elements
    can be preserved until we are ready to perform the switch over.

    Signed-off-by: Daniel Burgener
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Daniel Burgener
     
  • Separating the cleanup from the creation will simplify two things in
    future patches in this series. First, the creation can be made generic,
    to create directories not tied to the selinux_fs_info structure. Second,
    we will ultimately want to reorder creation and deletion so that the
    deletions aren't performed until the new directory structures have already
    been moved into place.

    Signed-off-by: Daniel Burgener
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Daniel Burgener
     
  • Currently SELinux denies attempts to remove the security.selinux xattr
    always, even when permissive or no policy is loaded. This was originally
    motivated by the view that all files should be labeled, even if that label
    is unlabeled_t, and we shouldn't permit files that were once labeled to
    have their labels removed entirely. This however prevents removing
    SELinux xattrs in the case where one "disables" SELinux by not loading
    a policy (e.g. a system where runtime disable is removed and selinux=0
    was not specified). Allow removing the xattr before SELinux is
    initialized. We could conceivably permit it even after initialization
    if permissive, or introduce a separate permission check here.

    Signed-off-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Stephen Smalley
     

20 Aug, 2020

2 commits

  • Use kmemdup rather than duplicating its implementation

    Generated by: scripts/coccinelle/api/memdup.cocci

    Fixes: c7c556f1e81b ("selinux: refactor changing booleans")
    CC: Stephen Smalley
    Signed-off-by: kernel test robot
    Signed-off-by: Julia Lawall
    Acked-by: Stephen Smalley
    Signed-off-by: Paul Moore

    kernel test robot
     
  • Certain SELinux security server functions (e.g. security_port_sid,
    called during bind) were not explicitly testing to see if SELinux
    has been initialized (i.e. initial policy loaded) and handling
    the no-policy-loaded case. In the past this happened to work
    because the policydb was statically allocated and could always
    be accessed, but with the recent encapsulation of policy state
    and conversion to dynamic allocation, we can no longer access
    the policy state prior to initialization. Add a test of
    !selinux_initialized(state) to all of the exported functions that
    were missing them and handle appropriately.

    Fixes: 461698026ffa ("selinux: encapsulate policy state, refactor policy load")
    Reported-by: Naresh Kamboju
    Tested-by: Andy Shevchenko
    Signed-off-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Stephen Smalley
     

19 Aug, 2020

1 commit


18 Aug, 2020

4 commits

  • Refactor the logic for changing SELinux policy booleans in a similar
    manner to the refactoring of policy load, thereby reducing the
    size of the critical section when the policy write-lock is held
    and making it easier to convert the policy rwlock to RCU in the
    future. Instead of directly modifying the policydb in place, modify
    a copy and then swap it into place through a single pointer update.
    Only fully copy the portions of the policydb that are affected by
    boolean changes to avoid the full cost of a deep policydb copy.
    Introduce another level of indirection for the sidtab since changing
    booleans does not require updating the sidtab, unlike policy load.
    While we are here, create a common helper for notifying
    other kernel components and userspace of a policy change and call it
    from both security_set_bools() and selinux_policy_commit().

    Based on an old (2004) patch by Kaigai Kohei [1] to convert the policy
    rwlock to RCU that was deferred at the time since it did not
    significantly improve performance and introduced complexity. Peter
    Enderborg later submitted a patch series to convert to RCU [2] that
    would have made changing booleans a much more expensive operation
    by requiring a full policydb_write();policydb_read(); sequence to
    deep copy the entire policydb and also had concerns regarding
    atomic allocations.

    This change is now simplified by the earlier work to encapsulate
    policy state in the selinux_policy struct and to refactor
    policy load. After this change, the last major obstacle to
    converting the policy rwlock to RCU is likely the sidtab live
    convert support.

    [1] https://lore.kernel.org/selinux/6e2f9128-e191-ebb3-0e87-74bfccb0767f@tycho.nsa.gov/
    [2] https://lore.kernel.org/selinux/20180530141104.28569-1-peter.enderborg@sony.com/

    Signed-off-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Stephen Smalley
     
  • With the refactoring of the policy load logic in the security
    server from the previous change, it is now possible to split out
    the committing of the new policy from security_load_policy() and
    perform it only after successful updating of selinuxfs. Change
    security_load_policy() to return the newly populated policy
    data structures to the caller, export selinux_policy_commit()
    for external callers, and introduce selinux_policy_cancel() to
    provide a way to cancel the policy load in the event of an error
    during updating of the selinuxfs directory tree. Further, rework
    the interfaces used by selinuxfs to get information from the policy
    when creating the new directory tree to take and act upon the
    new policy data structure rather than the current/active policy.
    Update selinuxfs to use these updated and new interfaces. While
    we are here, stop re-creating the policy_capabilities directory
    on each policy load since it does not depend on the policy, and
    stop trying to create the booleans and classes directories during
    the initial creation of selinuxfs since no information is available
    until first policy load.

    After this change, a failure while updating the booleans and class
    directories will cause the entire policy load to be canceled, leaving
    the original policy intact, and policy load notifications to userspace
    will only happen after a successful completion of updating those
    directories. This does not (yet) provide full atomicity with respect
    to the updating of the directory trees themselves.

    Signed-off-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Stephen Smalley
     
  • Encapsulate the policy state in its own structure (struct
    selinux_policy) that is separately allocated but referenced from the
    selinux_ss structure. The policy state includes the SID table
    (particularly the context structures), the policy database, and the
    mapping between the kernel classes/permissions and the policy values.
    Refactor the security server portion of the policy load logic to
    cleanly separate loading of the new structures from committing the new
    policy. Unify the initial policy load and reload code paths as much
    as possible, avoiding duplicated code. Make sure we are taking the
    policy read-lock prior to any dereferencing of the policy. Move the
    copying of the policy capability booleans into the state structure
    outside of the policy write-lock because they are separate from the
    policy and are read outside of any policy lock; possibly they should
    be using at least READ_ONCE/WRITE_ONCE or smp_load_acquire/store_release.

    These changes simplify the policy loading logic, reduce the size of
    the critical section while holding the policy write-lock, and should
    facilitate future changes to e.g. refactor the entire policy reload
    logic including the selinuxfs code to make the updating of the policy
    and the selinuxfs directory tree atomic and/or to convert the policy
    read-write lock to RCU.

    Signed-off-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Stephen Smalley
     
  • Presently mdp does not enable any SELinux policy capabilities
    in the dummy policy it generates. Thus, policies derived from
    it will by default lack various features commonly used in modern
    policies such as open permission, extended socket classes, network
    peer controls, etc. Split the policy capability definitions out into
    their own headers so that we can include them into mdp without pulling in
    other kernel headers and extend mdp generate policycap statements for the
    policy capabilities known to the kernel. Policy authors may wish to
    selectively remove some of these from the generated policy.

    Signed-off-by: Stephen Smalley
    Signed-off-by: Paul Moore

    Stephen Smalley
     

07 Aug, 2020

1 commit


05 Aug, 2020

2 commits

  • …rnel/git/brauner/linux

    Pull checkpoint-restore updates from Christian Brauner:
    "This enables unprivileged checkpoint/restore of processes.

    Given that this work has been going on for quite some time the first
    sentence in this summary is hopefully more exciting than the actual
    final code changes required. Unprivileged checkpoint/restore has seen
    a frequent increase in interest over the last two years and has thus
    been one of the main topics for the combined containers &
    checkpoint/restore microconference since at least 2018 (cf. [1]).

    Here are just the three most frequent use-cases that were brought forward:

    - The JVM developers are integrating checkpoint/restore into a Java
    VM to significantly decrease the startup time.

    - In high-performance computing environment a resource manager will
    typically be distributing jobs where users are always running as
    non-root. Long-running and "large" processes with significant
    startup times are supposed to be checkpointed and restored with
    CRIU.

    - Container migration as a non-root user.

    In all of these scenarios it is either desirable or required to run
    without CAP_SYS_ADMIN. The userspace implementation of
    checkpoint/restore CRIU already has the pull request for supporting
    unprivileged checkpoint/restore up (cf. [2]).

    To enable unprivileged checkpoint/restore a new dedicated capability
    CAP_CHECKPOINT_RESTORE is introduced. This solution has last been
    discussed in 2019 in a talk by Google at Linux Plumbers (cf. [1]
    "Update on Task Migration at Google Using CRIU") with Adrian and
    Nicolas providing the implementation now over the last months. In
    essence, this allows the CRIU binary to be installed with the
    CAP_CHECKPOINT_RESTORE vfs capability set thereby enabling
    unprivileged users to restore processes.

    To make this possible the following permissions are altered:

    - Selecting a specific PID via clone3() set_tid relaxed from userns
    CAP_SYS_ADMIN to CAP_CHECKPOINT_RESTORE.

    - Selecting a specific PID via /proc/sys/kernel/ns_last_pid relaxed
    from userns CAP_SYS_ADMIN to CAP_CHECKPOINT_RESTORE.

    - Accessing /proc/pid/map_files relaxed from init userns
    CAP_SYS_ADMIN to init userns CAP_CHECKPOINT_RESTORE.

    - Changing /proc/self/exe from userns CAP_SYS_ADMIN to userns
    CAP_CHECKPOINT_RESTORE.

    Of these four changes the /proc/self/exe change deserves a few words
    because the reasoning behind even restricting /proc/self/exe changes
    in the first place is just full of historical quirks and tracking this
    down was a questionable version of fun that I'd like to spare others.

    In short, it is trivial to change /proc/self/exe as an unprivileged
    user, i.e. without userns CAP_SYS_ADMIN right now. Either via ptrace()
    or by simply intercepting the elf loader in userspace during exec.
    Nicolas was nice enough to even provide a POC for the latter (cf. [3])
    to illustrate this fact.

    The original patchset which introduced PR_SET_MM_MAP had no
    permissions around changing the exe link. They too argued that it is
    trivial to spoof the exe link already which is true. The argument
    brought up against this was that the Tomoyo LSM uses the exe link in
    tomoyo_manager() to detect whether the calling process is a policy
    manager. This caused changing the exe links to be guarded by userns
    CAP_SYS_ADMIN.

    All in all this rather seems like a "better guard it with something
    rather than nothing" argument which imho doesn't qualify as a great
    security policy. Again, because spoofing the exe link is possible for
    the calling process so even if this were security relevant it was
    broken back then and would be broken today. So technically, dropping
    all permissions around changing the exe link would probably be
    possible and would send a clearer message to any userspace that relies
    on /proc/self/exe for security reasons that they should stop doing
    this but for now we're only relaxing the exe link permissions from
    userns CAP_SYS_ADMIN to userns CAP_CHECKPOINT_RESTORE.

    There's a final uapi change in here. Changing the exe link used to
    accidently return EINVAL when the caller lacked the necessary
    permissions instead of the more correct EPERM. This pr contains a
    commit fixing this. I assume that userspace won't notice or care and
    if they do I will revert this commit. But since we are changing the
    permissions anyway it seems like a good opportunity to try this fix.

    With these changes merged unprivileged checkpoint/restore will be
    possible and has already been tested by various users"

    [1] LPC 2018
    1. "Task Migration at Google Using CRIU"
    https://www.youtube.com/watch?v=yI_1cuhoDgA&t=12095
    2. "Securely Migrating Untrusted Workloads with CRIU"
    https://www.youtube.com/watch?v=yI_1cuhoDgA&t=14400
    LPC 2019
    1. "CRIU and the PID dance"
    https://www.youtube.com/watch?v=LN2CUgp8deo&list=PLVsQ_xZBEyN30ZA3Pc9MZMFzdjwyz26dO&index=9&t=2m48s
    2. "Update on Task Migration at Google Using CRIU"
    https://www.youtube.com/watch?v=LN2CUgp8deo&list=PLVsQ_xZBEyN30ZA3Pc9MZMFzdjwyz26dO&index=9&t=1h2m8s

    [2] https://github.com/checkpoint-restore/criu/pull/1155

    [3] https://github.com/nviennot/run_as_exe

    * tag 'cap-checkpoint-restore-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
    selftests: add clone3() CAP_CHECKPOINT_RESTORE test
    prctl: exe link permission error changed from -EINVAL to -EPERM
    prctl: Allow local CAP_CHECKPOINT_RESTORE to change /proc/self/exe
    proc: allow access in init userns for map_files with CAP_CHECKPOINT_RESTORE
    pid_namespace: use checkpoint_restore_ns_capable() for ns_last_pid
    pid: use checkpoint_restore_ns_capable() for set_tid
    capabilities: Introduce CAP_CHECKPOINT_RESTORE

    Linus Torvalds
     
  • Pull selinux updates from Paul Moore:
    "Beyond the usual smattering of bug fixes, we've got three small
    improvements worth highlighting:

    - improved SELinux policy symbol table performance due to a reworking
    of the insert and search functions

    - allow reading of SELinux labels before the policy is loaded,
    allowing for some more "exotic" initramfs approaches

    - improved checking an error reporting about process
    class/permissions during SELinux policy load"

    * tag 'selinux-pr-20200803' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
    selinux: complete the inlining of hashtab functions
    selinux: prepare for inlining of hashtab functions
    selinux: specialize symtab insert and search functions
    selinux: Fix spelling mistakes in the comments
    selinux: fixed a checkpatch warning with the sizeof macro
    selinux: log error messages on required process class / permissions
    scripts/selinux/mdp: fix initial SID handling
    selinux: allow reading labels before policy is loaded

    Linus Torvalds
     

20 Jul, 2020

1 commit

  • This patch introduces CAP_CHECKPOINT_RESTORE, a new capability facilitating
    checkpoint/restore for non-root users.

    Over the last years, The CRIU (Checkpoint/Restore In Userspace) team has
    been asked numerous times if it is possible to checkpoint/restore a
    process as non-root. The answer usually was: 'almost'.

    The main blocker to restore a process as non-root was to control the PID
    of the restored process. This feature available via the clone3 system
    call, or via /proc/sys/kernel/ns_last_pid is unfortunately guarded by
    CAP_SYS_ADMIN.

    In the past two years, requests for non-root checkpoint/restore have
    increased due to the following use cases:
    * Checkpoint/Restore in an HPC environment in combination with a
    resource manager distributing jobs where users are always running as
    non-root. There is a desire to provide a way to checkpoint and
    restore long running jobs.
    * Container migration as non-root
    * We have been in contact with JVM developers who are integrating
    CRIU into a Java VM to decrease the startup time. These
    checkpoint/restore applications are not meant to be running with
    CAP_SYS_ADMIN.

    We have seen the following workarounds:
    * Use a setuid wrapper around CRIU:
    See https://github.com/FredHutch/slurm-examples/blob/master/checkpointer/lib/checkpointer/checkpointer-suid.c
    * Use a setuid helper that writes to ns_last_pid.
    Unfortunately, this helper delegation technique is impossible to use
    with clone3, and is thus prone to races.
    See https://github.com/twosigma/set_ns_last_pid
    * Cycle through PIDs with fork() until the desired PID is reached:
    This has been demonstrated to work with cycling rates of 100,000 PIDs/s
    See https://github.com/twosigma/set_ns_last_pid
    * Patch out the CAP_SYS_ADMIN check from the kernel
    * Run the desired application in a new user and PID namespace to provide
    a local CAP_SYS_ADMIN for controlling PIDs. This technique has limited
    use in typical container environments (e.g., Kubernetes) as /proc is
    typically protected with read-only layers (e.g., /proc/sys) for
    hardening purposes. Read-only layers prevent additional /proc mounts
    (due to proc's SB_I_USERNS_VISIBLE property), making the use of new
    PID namespaces limited as certain applications need access to /proc
    matching their PID namespace.

    The introduced capability allows to:
    * Control PIDs when the current user is CAP_CHECKPOINT_RESTORE capable
    for the corresponding PID namespace via ns_last_pid/clone3.
    * Open files in /proc/pid/map_files when the current user is
    CAP_CHECKPOINT_RESTORE capable in the root namespace, useful for
    recovering files that are unreachable via the file system such as
    deleted files, or memfd files.

    See corresponding selftest for an example with clone3().

    Signed-off-by: Adrian Reber
    Signed-off-by: Nicolas Viennot
    Reviewed-by: Serge Hallyn
    Acked-by: Christian Brauner
    Link: https://lore.kernel.org/r/20200719100418.2112740-2-areber@redhat.com
    Signed-off-by: Christian Brauner

    Adrian Reber