0e8e989142
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmKhrZIACgkQONu9yGCS aT4bxhAAsahNlwa6uWf6brIeZkHy62w0LrZAEr6+TvO2CHLWwhcKIol5ZjdaJD5y KX7A839Vcdo5iAk0eNUV2MTigp7YK0f7XH9y/u/L3yNLc9YA4isA9PQhnnPc4R7N mgkmGT7Oz7BbQydyDiLvSwtXJDxBMOzCDTF3/4/42PsdmRmPzLBxzoTpH8wcY4vG jwGyiyUjUVWAF99uHo0O/Yp8sw8UvudpOX+lbKed76V+fXsbH0PYk1yMMJfWhZ60 TrFh1dmZY7j2bW0+F7rkVPXVGeQGyOlLSUVSFWlugJ8qvxVNpAItjcBUXZ+nChGe O25/5UiaBHprTIoms05yG1jPZtBbAO2MgLhw6zBCOySBr/e0bligNfJWpjt5D6H3 17+CQ1QeaL9BlzcYr4Ug/y60o2CkfUc/vr2CEQRQBRgj1gjsFWwBI4HVdO982fKC QClnC55h1wYDsjSJ6Z4l4TKBuEN8rV9D3RfdIaPex5C6JJMAoUNeAojCL+6iyuem ODSIufKm1I1eHeIS49+tw0Uu4jiAtn9RJfR4+uiV8zftfrDZ1qM/RPuHZTsE9wAl 3jHx6+8mT8NYjxb9Omn4Dp3aOl7Fcx/vPxx9uoj8YjrJtQ3L0EGgCnk0djmMi0b3 sBdKw15ftoJvNNrhQaLiCo+0M3XkcUUBk37ttNuIo4lvqIY23RE= =piEC -----END PGP SIGNATURE----- Merge 5.10.121 into android12-5.10-lts Changes in 5.10.121 binfmt_flat: do not stop relocating GOT entries prematurely on riscv parisc/stifb: Implement fb_is_primary_device() riscv: Initialize thread pointer before calling C functions riscv: Fix irq_work when SMP is disabled ALSA: hda/realtek: Enable 4-speaker output for Dell XPS 15 9520 laptop ALSA: hda/realtek - Fix microphone noise on ASUS TUF B550M-PLUS ALSA: usb-audio: Cancel pending work at closing a MIDI substream USB: serial: option: add Quectel BG95 modem USB: new quirk for Dell Gen 2 devices usb: dwc3: gadget: Move null pinter check to proper place usb: core: hcd: Add support for deferring roothub registration cifs: when extending a file with falloc we should make files not-sparse xhci: Allow host runtime PM as default for Intel Alder Lake N xHCI Fonts: Make font size unsigned in font_desc parisc/stifb: Keep track of hardware path of graphics card x86/MCE/AMD: Fix memory leak when threshold_create_bank() fails perf/x86/intel: Fix event constraints for ICL ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP ptrace/xtensa: Replace PT_SINGLESTEP with TIF_SINGLESTEP ptrace: Reimplement PTRACE_KILL by always sending SIGKILL btrfs: add "0x" prefix for unsupported optional features btrfs: repair super block num_devices automatically iommu/vt-d: Add RPLS to quirk list to skip TE disabling drm/virtio: fix NULL pointer dereference in virtio_gpu_conn_get_modes mwifiex: add mutex lock for call in mwifiex_dfs_chan_sw_work_queue b43legacy: Fix assigning negative value to unsigned variable b43: Fix assigning negative value to unsigned variable ipw2x00: Fix potential NULL dereference in libipw_xmit() ipv6: fix locking issues with loops over idev->addr_list fbcon: Consistently protect deferred_takeover with console_lock() x86/platform/uv: Update TSC sync state for UV5 ACPICA: Avoid cache flush inside virtual machines drm/komeda: return early if drm_universal_plane_init() fails. rcu-tasks: Fix race in schedule and flush work rcu: Make TASKS_RUDE_RCU select IRQ_WORK sfc: ef10: Fix assigning negative value to unsigned variable ALSA: jack: Access input_dev under mutex spi: spi-rspi: Remove setting {src,dst}_{addr,addr_width} based on DMA direction tools/power turbostat: fix ICX DRAM power numbers drm/amd/pm: fix double free in si_parse_power_table() ath9k: fix QCA9561 PA bias level media: venus: hfi: avoid null dereference in deinit media: pci: cx23885: Fix the error handling in cx23885_initdev() media: cx25821: Fix the warning when removing the module md/bitmap: don't set sb values if can't pass sanity check mmc: jz4740: Apply DMA engine limits to maximum segment size drivers: mmc: sdhci_am654: Add the quirk to set TESTCD bit scsi: megaraid: Fix error check return value of register_chrdev() scsi: ufs: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() scsi: lpfc: Fix resource leak in lpfc_sli4_send_seq_to_ulp() ath11k: disable spectral scan during spectral deinit ASoC: Intel: bytcr_rt5640: Add quirk for the HP Pro Tablet 408 drm/plane: Move range check for format_count earlier drm/amd/pm: fix the compile warning ath10k: skip ath10k_halt during suspend for driver state RESTARTING arm64: compat: Do not treat syscall number as ESR_ELx for a bad syscall drm: msm: fix error check return value of irq_of_parse_and_map() ipv6: Don't send rs packets to the interface of ARPHRD_TUNNEL net/mlx5: fs, delete the FTE when there are no rules attached to it ASoC: dapm: Don't fold register value changes into notifications mlxsw: spectrum_dcb: Do not warn about priority changes mlxsw: Treat LLDP packets as control drm/amdgpu/ucode: Remove firmware load type check in amdgpu_ucode_free_bo HID: bigben: fix slab-out-of-bounds Write in bigben_probe ASoC: tscs454: Add endianness flag in snd_soc_component_driver net: remove two BUG() from skb_checksum_help() s390/preempt: disable __preempt_count_add() optimization for PROFILE_ALL_BRANCHES perf/amd/ibs: Cascade pmu init functions' return value spi: stm32-qspi: Fix wait_cmd timeout in APM mode dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default ipmi:ssif: Check for NULL msg when handling events and messages ipmi: Fix pr_fmt to avoid compilation issues rtlwifi: Use pr_warn instead of WARN_ONCE media: rga: fix possible memory leak in rga_probe media: coda: limit frame interval enumeration to supported encoder frame sizes media: imon: reorganize serialization media: cec-adap.c: fix is_configuring state openrisc: start CPU timer early in boot nvme-pci: fix a NULL pointer dereference in nvme_alloc_admin_tags ASoC: rt5645: Fix errorenous cleanup order nbd: Fix hung on disconnect request if socket is closed before net: phy: micrel: Allow probing without .driver_data media: exynos4-is: Fix compile warning ASoC: max98357a: remove dependency on GPIOLIB ASoC: rt1015p: remove dependency on GPIOLIB can: mcp251xfd: silence clang's -Wunaligned-access warning x86/microcode: Add explicit CPU vendor dependency m68k: atari: Make Atari ROM port I/O write macros return void rxrpc: Return an error to sendmsg if call failed rxrpc, afs: Fix selection of abort codes eth: tg3: silence the GCC 12 array-bounds warning selftests/bpf: fix btf_dump/btf_dump due to recent clang change gfs2: use i_lock spin_lock for inode qadata IB/rdmavt: add missing locks in rvt_ruc_loopback ARM: dts: ox820: align interrupt controller node name with dtschema ARM: dts: s5pv210: align DMA channels with dtschema arm64: dts: qcom: msm8994: Fix BLSP[12]_DMA channels count PM / devfreq: rk3399_dmc: Disable edev on remove() crypto: ccree - use fine grained DMA mapping dir soc: ti: ti_sci_pm_domains: Check for null return of devm_kcalloc fs: jfs: fix possible NULL pointer dereference in dbFree() ARM: OMAP1: clock: Fix UART rate reporting algorithm powerpc/fadump: Fix fadump to work with a different endian capture kernel fat: add ratelimit to fat*_ent_bread() pinctrl: renesas: rzn1: Fix possible null-ptr-deref in sh_pfc_map_resources() ARM: versatile: Add missing of_node_put in dcscb_init ARM: dts: exynos: add atmel,24c128 fallback to Samsung EEPROM ARM: hisi: Add missing of_node_put after of_find_compatible_node PCI: Avoid pci_dev_lock() AB/BA deadlock with sriov_numvfs_store() tracing: incorrect isolate_mote_t cast in mm_vmscan_lru_isolate powerpc/powernv/vas: Assign real address to rx_fifo in vas_rx_win_attr powerpc/xics: fix refcount leak in icp_opal_init() powerpc/powernv: fix missing of_node_put in uv_init() macintosh/via-pmu: Fix build failure when CONFIG_INPUT is disabled powerpc/iommu: Add missing of_node_put in iommu_init_early_dart RDMA/hfi1: Prevent panic when SDMA is disabled drm: fix EDID struct for old ARM OABI format dt-bindings: display: sitronix, st7735r: Fix backlight in example ath11k: acquire ab->base_lock in unassign when finding the peer by addr ath9k: fix ar9003_get_eepmisc drm/edid: fix invalid EDID extension block filtering drm/bridge: adv7511: clean up CEC adapter when probe fails spi: qcom-qspi: Add minItems to interconnect-names ASoC: mediatek: Fix error handling in mt8173_max98090_dev_probe ASoC: mediatek: Fix missing of_node_put in mt2701_wm8960_machine_probe x86/delay: Fix the wrong asm constraint in delay_loop() drm/ingenic: Reset pixclock rate when parent clock rate changes drm/mediatek: Fix mtk_cec_mask() drm/vc4: hvs: Reset muxes at probe time drm/vc4: txp: Don't set TXP_VSTART_AT_EOF drm/vc4: txp: Force alpha to be 0xff if it's disabled libbpf: Don't error out on CO-RE relos for overriden weak subprogs bpf: Fix excessive memory allocation in stack_map_alloc() nl80211: show SSID for P2P_GO interfaces drm/komeda: Fix an undefined behavior bug in komeda_plane_add() drm: mali-dp: potential dereference of null pointer spi: spi-ti-qspi: Fix return value handling of wait_for_completion_timeout scftorture: Fix distribution of short handler delays net: dsa: mt7530: 1G can also support 1000BASE-X link mode NFC: NULL out the dev->rfkill to prevent UAF efi: Add missing prototype for efi_capsule_setup_info target: remove an incorrect unmap zeroes data deduction drbd: fix duplicate array initializer EDAC/dmc520: Don't print an error for each unconfigured interrupt line mtd: rawnand: denali: Use managed device resources HID: hid-led: fix maximum brightness for Dream Cheeky HID: elan: Fix potential double free in elan_input_configured drm/bridge: Fix error handling in analogix_dp_probe sched/fair: Fix cfs_rq_clock_pelt() for throttled cfs_rq spi: img-spfi: Fix pm_runtime_get_sync() error checking cpufreq: Fix possible race in cpufreq online error path ath9k_htc: fix potential out of bounds access with invalid rxstatus->rs_keyix media: hantro: Empty encoder capture buffers by default drm/panel: simple: Add missing bus flags for Innolux G070Y2-L01 ALSA: pcm: Check for null pointer of pointer substream before dereferencing it inotify: show inotify mask flags in proc fdinfo fsnotify: fix wrong lockdep annotations of: overlay: do not break notify on NOTIFY_{OK|STOP} drm/msm/dpu: adjust display_v_end for eDP and DP scsi: ufs: qcom: Fix ufs_qcom_resume() scsi: ufs: core: Exclude UECxx from SFR dump list selftests/resctrl: Fix null pointer dereference on open failed libbpf: Fix logic for finding matching program for CO-RE relocation mtd: spi-nor: core: Check written SR value in spi_nor_write_16bit_sr_and_check() x86/pm: Fix false positive kmemleak report in msr_build_context() mtd: rawnand: cadence: fix possible null-ptr-deref in cadence_nand_dt_probe() x86/speculation: Add missing prototype for unpriv_ebpf_notify() ASoC: rk3328: fix disabling mclk on pclk probe failure perf tools: Add missing headers needed by util/data.h drm/msm/disp/dpu1: set vbif hw config to NULL to avoid use after memory free during pm runtime resume drm/msm/dp: stop event kernel thread when DP unbind drm/msm/dp: fix error check return value of irq_of_parse_and_map() drm/msm/dsi: fix error checks and return values for DSI xmit functions drm/msm/hdmi: check return value after calling platform_get_resource_byname() drm/msm/hdmi: fix error check return value of irq_of_parse_and_map() drm/msm: add missing include to msm_drv.c drm/panel: panel-simple: Fix proper bpc for AM-1280800N3TZQW-T00H drm/rockchip: vop: fix possible null-ptr-deref in vop_bind() perf tools: Use Python devtools for version autodetection rather than runtime virtio_blk: fix the discard_granularity and discard_alignment queue limits x86: Fix return value of __setup handlers irqchip/exiu: Fix acknowledgment of edge triggered interrupts irqchip/aspeed-i2c-ic: Fix irq_of_parse_and_map() return value irqchip/aspeed-scu-ic: Fix irq_of_parse_and_map() return value x86/mm: Cleanup the control_va_addr_alignment() __setup handler arm64: fix types in copy_highpage() regulator: core: Fix enable_count imbalance with EXCLUSIVE_GET drm/msm/dp: fix event thread stuck in wait_event after kthread_stop() drm/msm/mdp5: Return error code in mdp5_pipe_release when deadlock is detected drm/msm/mdp5: Return error code in mdp5_mixer_release when deadlock is detected drm/msm: return an error pointer in msm_gem_prime_get_sg_table() media: uvcvideo: Fix missing check to determine if element is found in list iomap: iomap_write_failed fix spi: spi-fsl-qspi: check return value after calling platform_get_resource_byname() Revert "cpufreq: Fix possible race in cpufreq online error path" regulator: qcom_smd: Fix up PM8950 regulator configuration perf/amd/ibs: Use interrupt regs ip for stack unwinding ath11k: Don't check arvif->is_started before sending management frames ASoC: fsl: Fix refcount leak in imx_sgtl5000_probe ASoC: mxs-saif: Fix refcount leak in mxs_saif_probe regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt ASoC: samsung: Use dev_err_probe() helper ASoC: samsung: Fix refcount leak in aries_audio_probe kselftest/cgroup: fix test_stress.sh to use OUTPUT dir scripts/faddr2line: Fix overlapping text section failures media: aspeed: Fix an error handling path in aspeed_video_probe() media: exynos4-is: Fix PM disable depth imbalance in fimc_is_probe media: st-delta: Fix PM disable depth imbalance in delta_probe media: exynos4-is: Change clk_disable to clk_disable_unprepare media: pvrusb2: fix array-index-out-of-bounds in pvr2_i2c_core_init media: vsp1: Fix offset calculation for plane cropping Bluetooth: fix dangling sco_conn and use-after-free in sco_sock_timeout Bluetooth: Interleave with allowlist scan Bluetooth: L2CAP: Rudimentary typo fixes Bluetooth: LL privacy allow RPA Bluetooth: use inclusive language in HCI role comments Bluetooth: use inclusive language when filtering devices Bluetooth: use hdev lock for accept_list and reject_list in conn req nvme: set dma alignment to dword m68k: math-emu: Fix dependencies of math emulation support lsm,selinux: pass flowi_common instead of flowi to the LSM hooks sctp: read sk->sk_bound_dev_if once in sctp_rcv() net: hinic: add missing destroy_workqueue in hinic_pf_to_mgmt_init ASoC: ti: j721e-evm: Fix refcount leak in j721e_soc_probe_* media: ov7670: remove ov7670_power_off from ov7670_remove media: staging: media: rkvdec: Make use of the helper function devm_platform_ioremap_resource() media: rkvdec: h264: Fix dpb_valid implementation media: rkvdec: h264: Fix bit depth wrap in pps packet ext4: reject the 'commit' option on ext2 filesystems drm/msm/a6xx: Fix refcount leak in a6xx_gpu_init drm: msm: fix possible memory leak in mdp5_crtc_cursor_set() x86/sev: Annotate stack change in the #VC handler drm/msm/dpu: handle pm_runtime_get_sync() errors in bind path drm/i915: Fix CFI violation with show_dynamic_id() thermal/drivers/bcm2711: Don't clamp temperature at zero thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe thermal/drivers/core: Use a char pointer for the cooling device name thermal/core: Fix memory leak in __thermal_cooling_device_register() thermal/drivers/imx_sc_thermal: Fix refcount leak in imx_sc_thermal_probe ASoC: wm2000: fix missing clk_disable_unprepare() on error in wm2000_anc_transition() NFC: hci: fix sleep in atomic context bugs in nfc_hci_hcp_message_tx ASoC: max98090: Move check for invalid values before casting in max98090_put_enab_tlv() net: stmmac: selftests: Use kcalloc() instead of kzalloc() net: stmmac: fix out-of-bounds access in a selftest hv_netvsc: Fix potential dereference of NULL pointer rxrpc: Fix listen() setting the bar too high for the prealloc rings rxrpc: Don't try to resend the request if we're receiving the reply rxrpc: Fix overlapping ACK accounting rxrpc: Don't let ack.previousPacket regress rxrpc: Fix decision on when to generate an IDLE ACK net: huawei: hinic: Use devm_kcalloc() instead of devm_kzalloc() hinic: Avoid some over memory allocation net/smc: postpone sk_refcnt increment in connect() arm64: dts: rockchip: Move drive-impedance-ohm to emmc phy on rk3399 memory: samsung: exynos5422-dmc: Avoid some over memory allocation ARM: dts: suniv: F1C100: fix watchdog compatible soc: qcom: smp2p: Fix missing of_node_put() in smp2p_parse_ipc soc: qcom: smsm: Fix missing of_node_put() in smsm_parse_ipc PCI: cadence: Fix find_first_zero_bit() limit PCI: rockchip: Fix find_first_zero_bit() limit PCI: dwc: Fix setting error return on MSI DMA mapping failure ARM: dts: ci4x10: Adapt to changes in imx6qdl.dtsi regarding fec clocks soc: qcom: llcc: Add MODULE_DEVICE_TABLE() KVM: nVMX: Leave most VM-Exit info fields unmodified on failed VM-Entry KVM: nVMX: Clear IDT vectoring on nested VM-Exit for double/triple fault platform/chrome: cros_ec: fix error handling in cros_ec_register() ARM: dts: imx6dl-colibri: Fix I2C pinmuxing platform/chrome: Re-introduce cros_ec_cmd_xfer and use it for ioctls can: xilinx_can: mark bit timing constants as const ARM: dts: stm32: Fix PHY post-reset delay on Avenger96 ARM: dts: bcm2835-rpi-zero-w: Fix GPIO line name for Wifi/BT ARM: dts: bcm2837-rpi-cm3-io3: Fix GPIO line names for SMPS I2C ARM: dts: bcm2837-rpi-3-b-plus: Fix GPIO line name of power LED ARM: dts: bcm2835-rpi-b: Fix GPIO line names misc: ocxl: fix possible double free in ocxl_file_register_afu crypto: marvell/cesa - ECB does not IV gpiolib: of: Introduce hook for missing gpio-ranges pinctrl: bcm2835: implement hook for missing gpio-ranges arm: mediatek: select arch timer for mt7629 powerpc/fadump: fix PT_LOAD segment for boot memory area mfd: ipaq-micro: Fix error check return value of platform_get_irq() scsi: fcoe: Fix Wstringop-overflow warnings in fcoe_wwn_from_mac() firmware: arm_scmi: Fix list protocols enumeration in the base protocol nvdimm: Fix firmware activation deadlock scenarios nvdimm: Allow overwrite in the presence of disabled dimms pinctrl: mvebu: Fix irq_of_parse_and_map() return value drivers/base/node.c: fix compaction sysfs file leak dax: fix cache flush on PMD-mapped pages drivers/base/memory: fix an unlikely reference counting issue in __add_memory_block() powerpc/8xx: export 'cpm_setbrg' for modules pinctrl: renesas: core: Fix possible null-ptr-deref in sh_pfc_map_resources() powerpc/idle: Fix return value of __setup() handler powerpc/4xx/cpm: Fix return value of __setup() handler ASoC: atmel-pdmic: Remove endianness flag on pdmic component ASoC: atmel-classd: Remove endianness flag on class d component proc: fix dentry/inode overinstantiating under /proc/${pid}/net ipc/mqueue: use get_tree_nodev() in mqueue_get_tree() PCI: imx6: Fix PERST# start-up sequence tty: fix deadlock caused by calling printk() under tty_port->lock crypto: sun8i-ss - rework handling of IV crypto: sun8i-ss - handle zero sized sg crypto: cryptd - Protect per-CPU resource by disabling BH. Input: sparcspkr - fix refcount leak in bbc_beep_probe PCI/AER: Clear MULTI_ERR_COR/UNCOR_RCV bits hwrng: omap3-rom - fix using wrong clk_disable() in omap_rom_rng_runtime_resume() powerpc/64: Only WARN if __pa()/__va() called with bad addresses powerpc/perf: Fix the threshold compare group constraint for power9 macintosh: via-pmu and via-cuda need RTC_LIB powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup mfd: davinci_voicecodec: Fix possible null-ptr-deref davinci_vc_probe() mailbox: forward the hrtimer if not queued and under a lock RDMA/hfi1: Prevent use of lock before it is initialized Input: stmfts - do not leave device disabled in stmfts_input_open OPP: call of_node_put() on error path in _bandwidth_supported() f2fs: fix dereference of stale list iterator after loop body iommu/mediatek: Add list_del in mtk_iommu_remove i2c: at91: use dma safe buffers cpufreq: mediatek: add missing platform_driver_unregister() on error in mtk_cpufreq_driver_init cpufreq: mediatek: Use module_init and add module_exit cpufreq: mediatek: Unregister platform device on exit MIPS: Loongson: Use hwmon_device_register_with_groups() to register hwmon i2c: at91: Initialize dma_buf in at91_twi_xfer() dmaengine: idxd: Fix the error handling path in idxd_cdev_register() NFS: Do not report EINTR/ERESTARTSYS as mapping errors NFS: fsync() should report filesystem errors over EINTR/ERESTARTSYS NFS: Do not report flush errors in nfs_write_end() NFS: Don't report errors from nfs_pageio_complete() more than once NFSv4/pNFS: Do not fail I/O when we fail to allocate the pNFS layout video: fbdev: clcdfb: Fix refcount leak in clcdfb_of_vram_setup dmaengine: stm32-mdma: remove GISR1 register dmaengine: stm32-mdma: rework interrupt handler dmaengine: stm32-mdma: fix chan initialization in stm32_mdma_irq_handler() iommu/amd: Increase timeout waiting for GA log enablement i2c: npcm: Fix timeout calculation i2c: npcm: Correct register access width i2c: npcm: Handle spurious interrupts i2c: rcar: fix PM ref counts in probe error paths perf c2c: Use stdio interface if slang is not supported perf jevents: Fix event syntax error caused by ExtSel f2fs: fix to avoid f2fs_bug_on() in dec_valid_node_count() f2fs: fix to do sanity check on block address in f2fs_do_zero_range() f2fs: fix to clear dirty inode in f2fs_evict_inode() f2fs: fix deadloop in foreground GC f2fs: don't need inode lock for system hidden quota f2fs: fix to do sanity check on total_data_blocks f2fs: fix fallocate to use file_modified to update permissions consistently f2fs: fix to do sanity check for inline inode wifi: mac80211: fix use-after-free in chanctx code iwlwifi: mvm: fix assert 1F04 upon reconfig fs-writeback: writeback_sb_inodes:Recalculate 'wrote' according skipped pages efi: Do not import certificates from UEFI Secure Boot for T2 Macs bfq: Split shared queues on move between cgroups bfq: Update cgroup information before merging bio bfq: Track whether bfq_group is still online ext4: fix use-after-free in ext4_rename_dir_prepare ext4: fix warning in ext4_handle_inode_extension ext4: fix bug_on in ext4_writepages ext4: filter out EXT4_FC_REPLAY from on-disk superblock field s_state ext4: fix bug_on in __es_tree_search ext4: verify dir block before splitting it ext4: avoid cycles in directory h-tree ACPI: property: Release subnode properties with data nodes tracing: Fix potential double free in create_var_ref() PCI/PM: Fix bridge_d3_blacklist[] Elo i2 overwrite of Gigabyte X299 PCI: qcom: Fix runtime PM imbalance on probe errors PCI: qcom: Fix unbalanced PHY init on probe errors mm, compaction: fast_find_migrateblock() should return pfn in the target zone s390/perf: obtain sie_block from the right address dlm: fix plock invalid read dlm: fix missing lkb refcount handling ocfs2: dlmfs: fix error handling of user_dlm_destroy_lock scsi: dc395x: Fix a missing check on list iterator scsi: ufs: qcom: Add a readl() to make sure ref_clk gets enabled drm/amdgpu/cs: make commands with 0 chunks illegal behaviour. drm/etnaviv: check for reaped mapping in etnaviv_iommu_unmap_gem drm/nouveau/clk: Fix an incorrect NULL check on list iterator drm/nouveau/kms/nv50-: atom: fix an incorrect NULL check on list iterator drm/bridge: analogix_dp: Grab runtime PM reference for DP-AUX drm/i915/dsi: fix VBT send packet port selection for ICL+ md: fix an incorrect NULL check in does_sb_need_changing md: fix an incorrect NULL check in md_reload_sb mtd: cfi_cmdset_0002: Move and rename chip_check/chip_ready/chip_good_for_write mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N media: coda: Fix reported H264 profile media: coda: Add more H264 levels for CODA960 ima: remove the IMA_TEMPLATE Kconfig option Kconfig: Add option for asm goto w/ tied outputs to workaround clang-13 bug RDMA/hfi1: Fix potential integer multiplication overflow errors csky: patch_text: Fixup last cpu should be master irqchip/armada-370-xp: Do not touch Performance Counter Overflow on A375, A38x, A39x irqchip: irq-xtensa-mx: fix initial IRQ affinity cfg80211: declare MODULE_FIRMWARE for regulatory.db mac80211: upgrade passive scan to active scan on DFS channels after beacon rx um: chan_user: Fix winch_tramp() return value um: Fix out-of-bounds read in LDT setup kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] ftrace: Clean up hash direct_functions on register failures iommu/msm: Fix an incorrect NULL check on list iterator nodemask.h: fix compilation error with GCC12 hugetlb: fix huge_pmd_unshare address update xtensa/simdisk: fix proc_read_simdisk() rtl818x: Prevent using not initialized queues ASoC: rt5514: Fix event generation for "DSP Voice Wake Up" control carl9170: tx: fix an incorrect use of list iterator stm: ltdc: fix two incorrect NULL checks on list iterator bcache: improve multithreaded bch_btree_check() bcache: improve multithreaded bch_sectors_dirty_init() bcache: remove incremental dirty sector counting for bch_sectors_dirty_init() bcache: avoid journal no-space deadlock by reserving 1 journal bucket serial: pch: don't overwrite xmit->buf[0] by x_char tilcdc: tilcdc_external: fix an incorrect NULL check on list iterator gma500: fix an incorrect NULL check on list iterator arm64: dts: qcom: ipq8074: fix the sleep clock frequency phy: qcom-qmp: fix struct clk leak on probe errors ARM: dts: s5pv210: Remove spi-cs-high on panel in Aries ARM: pxa: maybe fix gpio lookup tables SMB3: EBADF/EIO errors in rename/open caused by race condition in smb2_compound_op docs/conf.py: Cope with removal of language=None in Sphinx 5.0.0 dt-bindings: gpio: altera: correct interrupt-cells vdpasim: allow to enable a vq repeatedly blk-iolatency: Fix inflight count imbalances and IO hangs on offline coresight: core: Fix coresight device probe failure issue phy: qcom-qmp: fix reset-controller leak on probe errors net: ipa: fix page free in ipa_endpoint_trans_release() net: ipa: fix page free in ipa_endpoint_replenish_one() xfs: set inode size after creating symlink xfs: sync lazy sb accounting on quiesce of read-only mounts xfs: fix chown leaking delalloc quota blocks when fssetxattr fails xfs: fix incorrect root dquot corruption error when switching group/project quota types xfs: restore shutdown check in mapped write fault path xfs: force log and push AIL to clear pinned inodes when aborting mount xfs: consider shutdown in bmapbt cursor delete assert xfs: assert in xfs_btree_del_cursor should take into account error kseltest/cgroup: Make test_stress.sh work if run interactively thermal/core: fix a UAF bug in __thermal_cooling_device_register() thermal/core: Fix memory leak in the error path bfq: Avoid merging queues with different parents bfq: Drop pointless unlock-lock pair bfq: Remove pointless bfq_init_rq() calls bfq: Get rid of __bio_blkcg() usage bfq: Make sure bfqg for which we are queueing requests is online block: fix bio_clone_blkg_association() to associate with proper blkcg_gq Revert "random: use static branch for crng_ready()" RDMA/rxe: Generate a completion for unsupported/invalid opcode MIPS: IP27: Remove incorrect `cpu_has_fpu' override MIPS: IP30: Remove incorrect `cpu_has_fpu' override ext4: only allow test_dummy_encryption when supported md: bcache: check the return value of kzalloc() in detached_dev_do_request() Linux 5.10.121 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I52dd11dc43acfa0ebddd2b6e277c823b96b07327
2014 lines
54 KiB
C
2014 lines
54 KiB
C
/*
|
|
* Linux Security plug
|
|
*
|
|
* Copyright (C) 2001 WireX Communications, Inc <chris@wirex.com>
|
|
* Copyright (C) 2001 Greg Kroah-Hartman <greg@kroah.com>
|
|
* Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com>
|
|
* Copyright (C) 2001 James Morris <jmorris@intercode.com.au>
|
|
* Copyright (C) 2001 Silicon Graphics, Inc. (Trust Technology Group)
|
|
* Copyright (C) 2016 Mellanox Techonologies
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Due to this file being licensed under the GPL there is controversy over
|
|
* whether this permits you to write a module that #includes this file
|
|
* without placing your module under the GPL. Please consult a lawyer for
|
|
* advice before doing this.
|
|
*
|
|
*/
|
|
|
|
#ifndef __LINUX_SECURITY_H
|
|
#define __LINUX_SECURITY_H
|
|
|
|
#include <linux/kernel_read_file.h>
|
|
#include <linux/key.h>
|
|
#include <linux/capability.h>
|
|
#include <linux/fs.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/err.h>
|
|
#include <linux/string.h>
|
|
#include <linux/mm.h>
|
|
|
|
struct linux_binprm;
|
|
struct cred;
|
|
struct rlimit;
|
|
struct kernel_siginfo;
|
|
struct sembuf;
|
|
struct kern_ipc_perm;
|
|
struct audit_context;
|
|
struct super_block;
|
|
struct inode;
|
|
struct dentry;
|
|
struct file;
|
|
struct vfsmount;
|
|
struct path;
|
|
struct qstr;
|
|
struct iattr;
|
|
struct fown_struct;
|
|
struct file_operations;
|
|
struct msg_msg;
|
|
struct xattr;
|
|
struct kernfs_node;
|
|
struct xfrm_sec_ctx;
|
|
struct mm_struct;
|
|
struct fs_context;
|
|
struct fs_parameter;
|
|
enum fs_value_type;
|
|
struct watch;
|
|
struct watch_notification;
|
|
|
|
/* Default (no) options for the capable function */
|
|
#define CAP_OPT_NONE 0x0
|
|
/* If capable should audit the security request */
|
|
#define CAP_OPT_NOAUDIT BIT(1)
|
|
/* If capable is being called by a setid function */
|
|
#define CAP_OPT_INSETID BIT(2)
|
|
|
|
/* LSM Agnostic defines for fs_context::lsm_flags */
|
|
#define SECURITY_LSM_NATIVE_LABELS 1
|
|
|
|
struct ctl_table;
|
|
struct audit_krule;
|
|
struct user_namespace;
|
|
struct timezone;
|
|
|
|
enum lsm_event {
|
|
LSM_POLICY_CHANGE,
|
|
};
|
|
|
|
/*
|
|
* These are reasons that can be passed to the security_locked_down()
|
|
* LSM hook. Lockdown reasons that protect kernel integrity (ie, the
|
|
* ability for userland to modify kernel code) are placed before
|
|
* LOCKDOWN_INTEGRITY_MAX. Lockdown reasons that protect kernel
|
|
* confidentiality (ie, the ability for userland to extract
|
|
* information from the running kernel that would otherwise be
|
|
* restricted) are placed before LOCKDOWN_CONFIDENTIALITY_MAX.
|
|
*
|
|
* LSM authors should note that the semantics of any given lockdown
|
|
* reason are not guaranteed to be stable - the same reason may block
|
|
* one set of features in one kernel release, and a slightly different
|
|
* set of features in a later kernel release. LSMs that seek to expose
|
|
* lockdown policy at any level of granularity other than "none",
|
|
* "integrity" or "confidentiality" are responsible for either
|
|
* ensuring that they expose a consistent level of functionality to
|
|
* userland, or ensuring that userland is aware that this is
|
|
* potentially a moving target. It is easy to misuse this information
|
|
* in a way that could break userspace. Please be careful not to do
|
|
* so.
|
|
*
|
|
* If you add to this, remember to extend lockdown_reasons in
|
|
* security/lockdown/lockdown.c.
|
|
*/
|
|
enum lockdown_reason {
|
|
LOCKDOWN_NONE,
|
|
LOCKDOWN_MODULE_SIGNATURE,
|
|
LOCKDOWN_DEV_MEM,
|
|
LOCKDOWN_EFI_TEST,
|
|
LOCKDOWN_KEXEC,
|
|
LOCKDOWN_HIBERNATION,
|
|
LOCKDOWN_PCI_ACCESS,
|
|
LOCKDOWN_IOPORT,
|
|
LOCKDOWN_MSR,
|
|
LOCKDOWN_ACPI_TABLES,
|
|
LOCKDOWN_PCMCIA_CIS,
|
|
LOCKDOWN_TIOCSSERIAL,
|
|
LOCKDOWN_MODULE_PARAMETERS,
|
|
LOCKDOWN_MMIOTRACE,
|
|
LOCKDOWN_DEBUGFS,
|
|
LOCKDOWN_XMON_WR,
|
|
LOCKDOWN_BPF_WRITE_USER,
|
|
LOCKDOWN_DBG_WRITE_KERNEL,
|
|
LOCKDOWN_INTEGRITY_MAX,
|
|
LOCKDOWN_KCORE,
|
|
LOCKDOWN_KPROBES,
|
|
LOCKDOWN_BPF_READ,
|
|
LOCKDOWN_DBG_READ_KERNEL,
|
|
LOCKDOWN_PERF,
|
|
LOCKDOWN_TRACEFS,
|
|
LOCKDOWN_XMON_RW,
|
|
LOCKDOWN_CONFIDENTIALITY_MAX,
|
|
};
|
|
|
|
/* These functions are in security/commoncap.c */
|
|
extern int cap_capable(const struct cred *cred, struct user_namespace *ns,
|
|
int cap, unsigned int opts);
|
|
extern int cap_settime(const struct timespec64 *ts, const struct timezone *tz);
|
|
extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode);
|
|
extern int cap_ptrace_traceme(struct task_struct *parent);
|
|
extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
|
|
extern int cap_capset(struct cred *new, const struct cred *old,
|
|
const kernel_cap_t *effective,
|
|
const kernel_cap_t *inheritable,
|
|
const kernel_cap_t *permitted);
|
|
extern int cap_bprm_creds_from_file(struct linux_binprm *bprm, struct file *file);
|
|
extern int cap_inode_setxattr(struct dentry *dentry, const char *name,
|
|
const void *value, size_t size, int flags);
|
|
extern int cap_inode_removexattr(struct dentry *dentry, const char *name);
|
|
extern int cap_inode_need_killpriv(struct dentry *dentry);
|
|
extern int cap_inode_killpriv(struct dentry *dentry);
|
|
extern int cap_inode_getsecurity(struct inode *inode, const char *name,
|
|
void **buffer, bool alloc);
|
|
extern int cap_mmap_addr(unsigned long addr);
|
|
extern int cap_mmap_file(struct file *file, unsigned long reqprot,
|
|
unsigned long prot, unsigned long flags);
|
|
extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags);
|
|
extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|
unsigned long arg4, unsigned long arg5);
|
|
extern int cap_task_setscheduler(struct task_struct *p);
|
|
extern int cap_task_setioprio(struct task_struct *p, int ioprio);
|
|
extern int cap_task_setnice(struct task_struct *p, int nice);
|
|
extern int cap_vm_enough_memory(struct mm_struct *mm, long pages);
|
|
|
|
struct msghdr;
|
|
struct sk_buff;
|
|
struct sock;
|
|
struct sockaddr;
|
|
struct socket;
|
|
struct flowi_common;
|
|
struct dst_entry;
|
|
struct xfrm_selector;
|
|
struct xfrm_policy;
|
|
struct xfrm_state;
|
|
struct xfrm_user_sec_ctx;
|
|
struct seq_file;
|
|
struct sctp_endpoint;
|
|
|
|
#ifdef CONFIG_MMU
|
|
extern unsigned long mmap_min_addr;
|
|
extern unsigned long dac_mmap_min_addr;
|
|
#else
|
|
#define mmap_min_addr 0UL
|
|
#define dac_mmap_min_addr 0UL
|
|
#endif
|
|
|
|
/*
|
|
* Values used in the task_security_ops calls
|
|
*/
|
|
/* setuid or setgid, id0 == uid or gid */
|
|
#define LSM_SETID_ID 1
|
|
|
|
/* setreuid or setregid, id0 == real, id1 == eff */
|
|
#define LSM_SETID_RE 2
|
|
|
|
/* setresuid or setresgid, id0 == real, id1 == eff, uid2 == saved */
|
|
#define LSM_SETID_RES 4
|
|
|
|
/* setfsuid or setfsgid, id0 == fsuid or fsgid */
|
|
#define LSM_SETID_FS 8
|
|
|
|
/* Flags for security_task_prlimit(). */
|
|
#define LSM_PRLIMIT_READ 1
|
|
#define LSM_PRLIMIT_WRITE 2
|
|
|
|
/* forward declares to avoid warnings */
|
|
struct sched_param;
|
|
struct request_sock;
|
|
|
|
/* bprm->unsafe reasons */
|
|
#define LSM_UNSAFE_SHARE 1
|
|
#define LSM_UNSAFE_PTRACE 2
|
|
#define LSM_UNSAFE_NO_NEW_PRIVS 4
|
|
|
|
#ifdef CONFIG_MMU
|
|
extern int mmap_min_addr_handler(struct ctl_table *table, int write,
|
|
void *buffer, size_t *lenp, loff_t *ppos);
|
|
#endif
|
|
|
|
/* security_inode_init_security callback function to write xattrs */
|
|
typedef int (*initxattrs) (struct inode *inode,
|
|
const struct xattr *xattr_array, void *fs_data);
|
|
|
|
|
|
/* Keep the kernel_load_data_id enum in sync with kernel_read_file_id */
|
|
#define __data_id_enumify(ENUM, dummy) LOADING_ ## ENUM,
|
|
#define __data_id_stringify(dummy, str) #str,
|
|
|
|
enum kernel_load_data_id {
|
|
__kernel_read_file_id(__data_id_enumify)
|
|
};
|
|
|
|
static const char * const kernel_load_data_str[] = {
|
|
__kernel_read_file_id(__data_id_stringify)
|
|
};
|
|
|
|
static inline const char *kernel_load_data_id_str(enum kernel_load_data_id id)
|
|
{
|
|
if ((unsigned)id >= LOADING_MAX_ID)
|
|
return kernel_load_data_str[LOADING_UNKNOWN];
|
|
|
|
return kernel_load_data_str[id];
|
|
}
|
|
|
|
#ifdef CONFIG_SECURITY
|
|
|
|
int call_blocking_lsm_notifier(enum lsm_event event, void *data);
|
|
int register_blocking_lsm_notifier(struct notifier_block *nb);
|
|
int unregister_blocking_lsm_notifier(struct notifier_block *nb);
|
|
|
|
/* prototypes */
|
|
extern int security_init(void);
|
|
extern int early_security_init(void);
|
|
|
|
/* Security operations */
|
|
int security_binder_set_context_mgr(const struct cred *mgr);
|
|
int security_binder_transaction(const struct cred *from,
|
|
const struct cred *to);
|
|
int security_binder_transfer_binder(const struct cred *from,
|
|
const struct cred *to);
|
|
int security_binder_transfer_file(const struct cred *from,
|
|
const struct cred *to, struct file *file);
|
|
int security_ptrace_access_check(struct task_struct *child, unsigned int mode);
|
|
int security_ptrace_traceme(struct task_struct *parent);
|
|
int security_capget(struct task_struct *target,
|
|
kernel_cap_t *effective,
|
|
kernel_cap_t *inheritable,
|
|
kernel_cap_t *permitted);
|
|
int security_capset(struct cred *new, const struct cred *old,
|
|
const kernel_cap_t *effective,
|
|
const kernel_cap_t *inheritable,
|
|
const kernel_cap_t *permitted);
|
|
int security_capable(const struct cred *cred,
|
|
struct user_namespace *ns,
|
|
int cap,
|
|
unsigned int opts);
|
|
int security_quotactl(int cmds, int type, int id, struct super_block *sb);
|
|
int security_quota_on(struct dentry *dentry);
|
|
int security_syslog(int type);
|
|
int security_settime64(const struct timespec64 *ts, const struct timezone *tz);
|
|
int security_vm_enough_memory_mm(struct mm_struct *mm, long pages);
|
|
int security_bprm_creds_for_exec(struct linux_binprm *bprm);
|
|
int security_bprm_creds_from_file(struct linux_binprm *bprm, struct file *file);
|
|
int security_bprm_check(struct linux_binprm *bprm);
|
|
void security_bprm_committing_creds(struct linux_binprm *bprm);
|
|
void security_bprm_committed_creds(struct linux_binprm *bprm);
|
|
int security_fs_context_dup(struct fs_context *fc, struct fs_context *src_fc);
|
|
int security_fs_context_parse_param(struct fs_context *fc, struct fs_parameter *param);
|
|
int security_sb_alloc(struct super_block *sb);
|
|
void security_sb_free(struct super_block *sb);
|
|
void security_free_mnt_opts(void **mnt_opts);
|
|
int security_sb_eat_lsm_opts(char *options, void **mnt_opts);
|
|
int security_sb_remount(struct super_block *sb, void *mnt_opts);
|
|
int security_sb_kern_mount(struct super_block *sb);
|
|
int security_sb_show_options(struct seq_file *m, struct super_block *sb);
|
|
int security_sb_statfs(struct dentry *dentry);
|
|
int security_sb_mount(const char *dev_name, const struct path *path,
|
|
const char *type, unsigned long flags, void *data);
|
|
int security_sb_umount(struct vfsmount *mnt, int flags);
|
|
int security_sb_pivotroot(const struct path *old_path, const struct path *new_path);
|
|
int security_sb_set_mnt_opts(struct super_block *sb,
|
|
void *mnt_opts,
|
|
unsigned long kern_flags,
|
|
unsigned long *set_kern_flags);
|
|
int security_sb_clone_mnt_opts(const struct super_block *oldsb,
|
|
struct super_block *newsb,
|
|
unsigned long kern_flags,
|
|
unsigned long *set_kern_flags);
|
|
int security_add_mnt_opt(const char *option, const char *val,
|
|
int len, void **mnt_opts);
|
|
int security_move_mount(const struct path *from_path, const struct path *to_path);
|
|
int security_dentry_init_security(struct dentry *dentry, int mode,
|
|
const struct qstr *name, void **ctx,
|
|
u32 *ctxlen);
|
|
int security_dentry_create_files_as(struct dentry *dentry, int mode,
|
|
struct qstr *name,
|
|
const struct cred *old,
|
|
struct cred *new);
|
|
int security_path_notify(const struct path *path, u64 mask,
|
|
unsigned int obj_type);
|
|
int security_inode_alloc(struct inode *inode);
|
|
void security_inode_free(struct inode *inode);
|
|
int security_inode_init_security(struct inode *inode, struct inode *dir,
|
|
const struct qstr *qstr,
|
|
initxattrs initxattrs, void *fs_data);
|
|
int security_inode_init_security_anon(struct inode *inode,
|
|
const struct qstr *name,
|
|
const struct inode *context_inode);
|
|
int security_old_inode_init_security(struct inode *inode, struct inode *dir,
|
|
const struct qstr *qstr, const char **name,
|
|
void **value, size_t *len);
|
|
int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode);
|
|
int security_inode_link(struct dentry *old_dentry, struct inode *dir,
|
|
struct dentry *new_dentry);
|
|
int security_inode_unlink(struct inode *dir, struct dentry *dentry);
|
|
int security_inode_symlink(struct inode *dir, struct dentry *dentry,
|
|
const char *old_name);
|
|
int security_inode_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
|
|
int security_inode_rmdir(struct inode *dir, struct dentry *dentry);
|
|
int security_inode_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev);
|
|
int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|
struct inode *new_dir, struct dentry *new_dentry,
|
|
unsigned int flags);
|
|
int security_inode_readlink(struct dentry *dentry);
|
|
int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
|
|
bool rcu);
|
|
int security_inode_permission(struct inode *inode, int mask);
|
|
int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
|
|
int security_inode_getattr(const struct path *path);
|
|
int security_inode_setxattr(struct dentry *dentry, const char *name,
|
|
const void *value, size_t size, int flags);
|
|
void security_inode_post_setxattr(struct dentry *dentry, const char *name,
|
|
const void *value, size_t size, int flags);
|
|
int security_inode_getxattr(struct dentry *dentry, const char *name);
|
|
int security_inode_listxattr(struct dentry *dentry);
|
|
int security_inode_removexattr(struct dentry *dentry, const char *name);
|
|
int security_inode_need_killpriv(struct dentry *dentry);
|
|
int security_inode_killpriv(struct dentry *dentry);
|
|
int security_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc);
|
|
int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags);
|
|
int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size);
|
|
void security_inode_getsecid(struct inode *inode, u32 *secid);
|
|
int security_inode_copy_up(struct dentry *src, struct cred **new);
|
|
int security_inode_copy_up_xattr(const char *name);
|
|
int security_kernfs_init_security(struct kernfs_node *kn_dir,
|
|
struct kernfs_node *kn);
|
|
int security_file_permission(struct file *file, int mask);
|
|
int security_file_alloc(struct file *file);
|
|
void security_file_free(struct file *file);
|
|
int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
|
|
int security_mmap_file(struct file *file, unsigned long prot,
|
|
unsigned long flags);
|
|
int security_mmap_addr(unsigned long addr);
|
|
int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot,
|
|
unsigned long prot);
|
|
int security_file_lock(struct file *file, unsigned int cmd);
|
|
int security_file_fcntl(struct file *file, unsigned int cmd, unsigned long arg);
|
|
void security_file_set_fowner(struct file *file);
|
|
int security_file_send_sigiotask(struct task_struct *tsk,
|
|
struct fown_struct *fown, int sig);
|
|
int security_file_receive(struct file *file);
|
|
int security_file_open(struct file *file);
|
|
int security_task_alloc(struct task_struct *task, unsigned long clone_flags);
|
|
void security_task_free(struct task_struct *task);
|
|
int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);
|
|
void security_cred_free(struct cred *cred);
|
|
int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp);
|
|
void security_transfer_creds(struct cred *new, const struct cred *old);
|
|
void security_cred_getsecid(const struct cred *c, u32 *secid);
|
|
int security_kernel_act_as(struct cred *new, u32 secid);
|
|
int security_kernel_create_files_as(struct cred *new, struct inode *inode);
|
|
int security_kernel_module_request(char *kmod_name);
|
|
int security_kernel_load_data(enum kernel_load_data_id id, bool contents);
|
|
int security_kernel_post_load_data(char *buf, loff_t size,
|
|
enum kernel_load_data_id id,
|
|
char *description);
|
|
int security_kernel_read_file(struct file *file, enum kernel_read_file_id id,
|
|
bool contents);
|
|
int security_kernel_post_read_file(struct file *file, char *buf, loff_t size,
|
|
enum kernel_read_file_id id);
|
|
int security_task_fix_setuid(struct cred *new, const struct cred *old,
|
|
int flags);
|
|
int security_task_fix_setgid(struct cred *new, const struct cred *old,
|
|
int flags);
|
|
int security_task_setpgid(struct task_struct *p, pid_t pgid);
|
|
int security_task_getpgid(struct task_struct *p);
|
|
int security_task_getsid(struct task_struct *p);
|
|
void security_task_getsecid(struct task_struct *p, u32 *secid);
|
|
int security_task_setnice(struct task_struct *p, int nice);
|
|
int security_task_setioprio(struct task_struct *p, int ioprio);
|
|
int security_task_getioprio(struct task_struct *p);
|
|
int security_task_prlimit(const struct cred *cred, const struct cred *tcred,
|
|
unsigned int flags);
|
|
int security_task_setrlimit(struct task_struct *p, unsigned int resource,
|
|
struct rlimit *new_rlim);
|
|
int security_task_setscheduler(struct task_struct *p);
|
|
int security_task_getscheduler(struct task_struct *p);
|
|
int security_task_movememory(struct task_struct *p);
|
|
int security_task_kill(struct task_struct *p, struct kernel_siginfo *info,
|
|
int sig, const struct cred *cred);
|
|
int security_task_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|
unsigned long arg4, unsigned long arg5);
|
|
void security_task_to_inode(struct task_struct *p, struct inode *inode);
|
|
int security_ipc_permission(struct kern_ipc_perm *ipcp, short flag);
|
|
void security_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid);
|
|
int security_msg_msg_alloc(struct msg_msg *msg);
|
|
void security_msg_msg_free(struct msg_msg *msg);
|
|
int security_msg_queue_alloc(struct kern_ipc_perm *msq);
|
|
void security_msg_queue_free(struct kern_ipc_perm *msq);
|
|
int security_msg_queue_associate(struct kern_ipc_perm *msq, int msqflg);
|
|
int security_msg_queue_msgctl(struct kern_ipc_perm *msq, int cmd);
|
|
int security_msg_queue_msgsnd(struct kern_ipc_perm *msq,
|
|
struct msg_msg *msg, int msqflg);
|
|
int security_msg_queue_msgrcv(struct kern_ipc_perm *msq, struct msg_msg *msg,
|
|
struct task_struct *target, long type, int mode);
|
|
int security_shm_alloc(struct kern_ipc_perm *shp);
|
|
void security_shm_free(struct kern_ipc_perm *shp);
|
|
int security_shm_associate(struct kern_ipc_perm *shp, int shmflg);
|
|
int security_shm_shmctl(struct kern_ipc_perm *shp, int cmd);
|
|
int security_shm_shmat(struct kern_ipc_perm *shp, char __user *shmaddr, int shmflg);
|
|
int security_sem_alloc(struct kern_ipc_perm *sma);
|
|
void security_sem_free(struct kern_ipc_perm *sma);
|
|
int security_sem_associate(struct kern_ipc_perm *sma, int semflg);
|
|
int security_sem_semctl(struct kern_ipc_perm *sma, int cmd);
|
|
int security_sem_semop(struct kern_ipc_perm *sma, struct sembuf *sops,
|
|
unsigned nsops, int alter);
|
|
void security_d_instantiate(struct dentry *dentry, struct inode *inode);
|
|
int security_getprocattr(struct task_struct *p, const char *lsm, char *name,
|
|
char **value);
|
|
int security_setprocattr(const char *lsm, const char *name, void *value,
|
|
size_t size);
|
|
int security_netlink_send(struct sock *sk, struct sk_buff *skb);
|
|
int security_ismaclabel(const char *name);
|
|
int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
|
|
int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);
|
|
void security_release_secctx(char *secdata, u32 seclen);
|
|
void security_inode_invalidate_secctx(struct inode *inode);
|
|
int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen);
|
|
int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen);
|
|
int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen);
|
|
int security_locked_down(enum lockdown_reason what);
|
|
#else /* CONFIG_SECURITY */
|
|
|
|
static inline int call_blocking_lsm_notifier(enum lsm_event event, void *data)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int register_blocking_lsm_notifier(struct notifier_block *nb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int unregister_blocking_lsm_notifier(struct notifier_block *nb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_free_mnt_opts(void **mnt_opts)
|
|
{
|
|
}
|
|
|
|
/*
|
|
* This is the default capabilities functionality. Most of these functions
|
|
* are just stubbed out, but a few must call the proper capable code.
|
|
*/
|
|
|
|
static inline int security_init(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int early_security_init(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_binder_set_context_mgr(const struct cred *mgr)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_binder_transaction(const struct cred *from,
|
|
const struct cred *to)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_binder_transfer_binder(const struct cred *from,
|
|
const struct cred *to)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_binder_transfer_file(const struct cred *from,
|
|
const struct cred *to,
|
|
struct file *file)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_ptrace_access_check(struct task_struct *child,
|
|
unsigned int mode)
|
|
{
|
|
return cap_ptrace_access_check(child, mode);
|
|
}
|
|
|
|
static inline int security_ptrace_traceme(struct task_struct *parent)
|
|
{
|
|
return cap_ptrace_traceme(parent);
|
|
}
|
|
|
|
static inline int security_capget(struct task_struct *target,
|
|
kernel_cap_t *effective,
|
|
kernel_cap_t *inheritable,
|
|
kernel_cap_t *permitted)
|
|
{
|
|
return cap_capget(target, effective, inheritable, permitted);
|
|
}
|
|
|
|
static inline int security_capset(struct cred *new,
|
|
const struct cred *old,
|
|
const kernel_cap_t *effective,
|
|
const kernel_cap_t *inheritable,
|
|
const kernel_cap_t *permitted)
|
|
{
|
|
return cap_capset(new, old, effective, inheritable, permitted);
|
|
}
|
|
|
|
static inline int security_capable(const struct cred *cred,
|
|
struct user_namespace *ns,
|
|
int cap,
|
|
unsigned int opts)
|
|
{
|
|
return cap_capable(cred, ns, cap, opts);
|
|
}
|
|
|
|
static inline int security_quotactl(int cmds, int type, int id,
|
|
struct super_block *sb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_quota_on(struct dentry *dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_syslog(int type)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_settime64(const struct timespec64 *ts,
|
|
const struct timezone *tz)
|
|
{
|
|
return cap_settime(ts, tz);
|
|
}
|
|
|
|
static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
|
|
{
|
|
return __vm_enough_memory(mm, pages, cap_vm_enough_memory(mm, pages));
|
|
}
|
|
|
|
static inline int security_bprm_creds_for_exec(struct linux_binprm *bprm)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_bprm_creds_from_file(struct linux_binprm *bprm,
|
|
struct file *file)
|
|
{
|
|
return cap_bprm_creds_from_file(bprm, file);
|
|
}
|
|
|
|
static inline int security_bprm_check(struct linux_binprm *bprm)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_bprm_committing_creds(struct linux_binprm *bprm)
|
|
{
|
|
}
|
|
|
|
static inline void security_bprm_committed_creds(struct linux_binprm *bprm)
|
|
{
|
|
}
|
|
|
|
static inline int security_fs_context_dup(struct fs_context *fc,
|
|
struct fs_context *src_fc)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline int security_fs_context_parse_param(struct fs_context *fc,
|
|
struct fs_parameter *param)
|
|
{
|
|
return -ENOPARAM;
|
|
}
|
|
|
|
static inline int security_sb_alloc(struct super_block *sb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_sb_free(struct super_block *sb)
|
|
{ }
|
|
|
|
static inline int security_sb_eat_lsm_opts(char *options,
|
|
void **mnt_opts)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sb_remount(struct super_block *sb,
|
|
void *mnt_opts)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sb_kern_mount(struct super_block *sb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sb_show_options(struct seq_file *m,
|
|
struct super_block *sb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sb_statfs(struct dentry *dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sb_mount(const char *dev_name, const struct path *path,
|
|
const char *type, unsigned long flags,
|
|
void *data)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sb_umount(struct vfsmount *mnt, int flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sb_pivotroot(const struct path *old_path,
|
|
const struct path *new_path)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sb_set_mnt_opts(struct super_block *sb,
|
|
void *mnt_opts,
|
|
unsigned long kern_flags,
|
|
unsigned long *set_kern_flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sb_clone_mnt_opts(const struct super_block *oldsb,
|
|
struct super_block *newsb,
|
|
unsigned long kern_flags,
|
|
unsigned long *set_kern_flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_add_mnt_opt(const char *option, const char *val,
|
|
int len, void **mnt_opts)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_move_mount(const struct path *from_path,
|
|
const struct path *to_path)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_notify(const struct path *path, u64 mask,
|
|
unsigned int obj_type)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_alloc(struct inode *inode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_inode_free(struct inode *inode)
|
|
{ }
|
|
|
|
static inline int security_dentry_init_security(struct dentry *dentry,
|
|
int mode,
|
|
const struct qstr *name,
|
|
void **ctx,
|
|
u32 *ctxlen)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
static inline int security_dentry_create_files_as(struct dentry *dentry,
|
|
int mode, struct qstr *name,
|
|
const struct cred *old,
|
|
struct cred *new)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
static inline int security_inode_init_security(struct inode *inode,
|
|
struct inode *dir,
|
|
const struct qstr *qstr,
|
|
const initxattrs xattrs,
|
|
void *fs_data)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_init_security_anon(struct inode *inode,
|
|
const struct qstr *name,
|
|
const struct inode *context_inode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_old_inode_init_security(struct inode *inode,
|
|
struct inode *dir,
|
|
const struct qstr *qstr,
|
|
const char **name,
|
|
void **value, size_t *len)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
static inline int security_inode_create(struct inode *dir,
|
|
struct dentry *dentry,
|
|
umode_t mode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_link(struct dentry *old_dentry,
|
|
struct inode *dir,
|
|
struct dentry *new_dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_unlink(struct inode *dir,
|
|
struct dentry *dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_symlink(struct inode *dir,
|
|
struct dentry *dentry,
|
|
const char *old_name)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_mkdir(struct inode *dir,
|
|
struct dentry *dentry,
|
|
int mode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_rmdir(struct inode *dir,
|
|
struct dentry *dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_mknod(struct inode *dir,
|
|
struct dentry *dentry,
|
|
int mode, dev_t dev)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_rename(struct inode *old_dir,
|
|
struct dentry *old_dentry,
|
|
struct inode *new_dir,
|
|
struct dentry *new_dentry,
|
|
unsigned int flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_readlink(struct dentry *dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_follow_link(struct dentry *dentry,
|
|
struct inode *inode,
|
|
bool rcu)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_permission(struct inode *inode, int mask)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_setattr(struct dentry *dentry,
|
|
struct iattr *attr)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_getattr(const struct path *path)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_setxattr(struct dentry *dentry,
|
|
const char *name, const void *value, size_t size, int flags)
|
|
{
|
|
return cap_inode_setxattr(dentry, name, value, size, flags);
|
|
}
|
|
|
|
static inline void security_inode_post_setxattr(struct dentry *dentry,
|
|
const char *name, const void *value, size_t size, int flags)
|
|
{ }
|
|
|
|
static inline int security_inode_getxattr(struct dentry *dentry,
|
|
const char *name)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_listxattr(struct dentry *dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_removexattr(struct dentry *dentry,
|
|
const char *name)
|
|
{
|
|
return cap_inode_removexattr(dentry, name);
|
|
}
|
|
|
|
static inline int security_inode_need_killpriv(struct dentry *dentry)
|
|
{
|
|
return cap_inode_need_killpriv(dentry);
|
|
}
|
|
|
|
static inline int security_inode_killpriv(struct dentry *dentry)
|
|
{
|
|
return cap_inode_killpriv(dentry);
|
|
}
|
|
|
|
static inline int security_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc)
|
|
{
|
|
return cap_inode_getsecurity(inode, name, buffer, alloc);
|
|
}
|
|
|
|
static inline int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
static inline int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_inode_getsecid(struct inode *inode, u32 *secid)
|
|
{
|
|
*secid = 0;
|
|
}
|
|
|
|
static inline int security_inode_copy_up(struct dentry *src, struct cred **new)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_kernfs_init_security(struct kernfs_node *kn_dir,
|
|
struct kernfs_node *kn)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_inode_copy_up_xattr(const char *name)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
static inline int security_file_permission(struct file *file, int mask)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_file_alloc(struct file *file)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_file_free(struct file *file)
|
|
{ }
|
|
|
|
static inline int security_file_ioctl(struct file *file, unsigned int cmd,
|
|
unsigned long arg)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_mmap_file(struct file *file, unsigned long prot,
|
|
unsigned long flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_mmap_addr(unsigned long addr)
|
|
{
|
|
return cap_mmap_addr(addr);
|
|
}
|
|
|
|
static inline int security_file_mprotect(struct vm_area_struct *vma,
|
|
unsigned long reqprot,
|
|
unsigned long prot)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_file_lock(struct file *file, unsigned int cmd)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_file_fcntl(struct file *file, unsigned int cmd,
|
|
unsigned long arg)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_file_set_fowner(struct file *file)
|
|
{
|
|
return;
|
|
}
|
|
|
|
static inline int security_file_send_sigiotask(struct task_struct *tsk,
|
|
struct fown_struct *fown,
|
|
int sig)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_file_receive(struct file *file)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_file_open(struct file *file)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_alloc(struct task_struct *task,
|
|
unsigned long clone_flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_task_free(struct task_struct *task)
|
|
{ }
|
|
|
|
static inline int security_cred_alloc_blank(struct cred *cred, gfp_t gfp)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_cred_free(struct cred *cred)
|
|
{ }
|
|
|
|
static inline int security_prepare_creds(struct cred *new,
|
|
const struct cred *old,
|
|
gfp_t gfp)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_transfer_creds(struct cred *new,
|
|
const struct cred *old)
|
|
{
|
|
}
|
|
|
|
static inline void security_cred_getsecid(const struct cred *c, u32 *secid)
|
|
{
|
|
*secid = 0;
|
|
}
|
|
|
|
static inline int security_kernel_act_as(struct cred *cred, u32 secid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_kernel_create_files_as(struct cred *cred,
|
|
struct inode *inode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_kernel_module_request(char *kmod_name)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_kernel_load_data(enum kernel_load_data_id id, bool contents)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_kernel_post_load_data(char *buf, loff_t size,
|
|
enum kernel_load_data_id id,
|
|
char *description)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_kernel_read_file(struct file *file,
|
|
enum kernel_read_file_id id,
|
|
bool contents)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_kernel_post_read_file(struct file *file,
|
|
char *buf, loff_t size,
|
|
enum kernel_read_file_id id)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_fix_setuid(struct cred *new,
|
|
const struct cred *old,
|
|
int flags)
|
|
{
|
|
return cap_task_fix_setuid(new, old, flags);
|
|
}
|
|
|
|
static inline int security_task_fix_setgid(struct cred *new,
|
|
const struct cred *old,
|
|
int flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_setpgid(struct task_struct *p, pid_t pgid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_getpgid(struct task_struct *p)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_getsid(struct task_struct *p)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_task_getsecid(struct task_struct *p, u32 *secid)
|
|
{
|
|
*secid = 0;
|
|
}
|
|
|
|
static inline int security_task_setnice(struct task_struct *p, int nice)
|
|
{
|
|
return cap_task_setnice(p, nice);
|
|
}
|
|
|
|
static inline int security_task_setioprio(struct task_struct *p, int ioprio)
|
|
{
|
|
return cap_task_setioprio(p, ioprio);
|
|
}
|
|
|
|
static inline int security_task_getioprio(struct task_struct *p)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_prlimit(const struct cred *cred,
|
|
const struct cred *tcred,
|
|
unsigned int flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_setrlimit(struct task_struct *p,
|
|
unsigned int resource,
|
|
struct rlimit *new_rlim)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_setscheduler(struct task_struct *p)
|
|
{
|
|
return cap_task_setscheduler(p);
|
|
}
|
|
|
|
static inline int security_task_getscheduler(struct task_struct *p)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_movememory(struct task_struct *p)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_kill(struct task_struct *p,
|
|
struct kernel_siginfo *info, int sig,
|
|
const struct cred *cred)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_task_prctl(int option, unsigned long arg2,
|
|
unsigned long arg3,
|
|
unsigned long arg4,
|
|
unsigned long arg5)
|
|
{
|
|
return cap_task_prctl(option, arg2, arg3, arg4, arg5);
|
|
}
|
|
|
|
static inline void security_task_to_inode(struct task_struct *p, struct inode *inode)
|
|
{ }
|
|
|
|
static inline int security_ipc_permission(struct kern_ipc_perm *ipcp,
|
|
short flag)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid)
|
|
{
|
|
*secid = 0;
|
|
}
|
|
|
|
static inline int security_msg_msg_alloc(struct msg_msg *msg)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_msg_msg_free(struct msg_msg *msg)
|
|
{ }
|
|
|
|
static inline int security_msg_queue_alloc(struct kern_ipc_perm *msq)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_msg_queue_free(struct kern_ipc_perm *msq)
|
|
{ }
|
|
|
|
static inline int security_msg_queue_associate(struct kern_ipc_perm *msq,
|
|
int msqflg)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_msg_queue_msgctl(struct kern_ipc_perm *msq, int cmd)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_msg_queue_msgsnd(struct kern_ipc_perm *msq,
|
|
struct msg_msg *msg, int msqflg)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_msg_queue_msgrcv(struct kern_ipc_perm *msq,
|
|
struct msg_msg *msg,
|
|
struct task_struct *target,
|
|
long type, int mode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_shm_alloc(struct kern_ipc_perm *shp)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_shm_free(struct kern_ipc_perm *shp)
|
|
{ }
|
|
|
|
static inline int security_shm_associate(struct kern_ipc_perm *shp,
|
|
int shmflg)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_shm_shmctl(struct kern_ipc_perm *shp, int cmd)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_shm_shmat(struct kern_ipc_perm *shp,
|
|
char __user *shmaddr, int shmflg)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sem_alloc(struct kern_ipc_perm *sma)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_sem_free(struct kern_ipc_perm *sma)
|
|
{ }
|
|
|
|
static inline int security_sem_associate(struct kern_ipc_perm *sma, int semflg)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sem_semctl(struct kern_ipc_perm *sma, int cmd)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sem_semop(struct kern_ipc_perm *sma,
|
|
struct sembuf *sops, unsigned nsops,
|
|
int alter)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_d_instantiate(struct dentry *dentry,
|
|
struct inode *inode)
|
|
{ }
|
|
|
|
static inline int security_getprocattr(struct task_struct *p, const char *lsm,
|
|
char *name, char **value)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline int security_setprocattr(const char *lsm, char *name,
|
|
void *value, size_t size)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline int security_netlink_send(struct sock *sk, struct sk_buff *skb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_ismaclabel(const char *name)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
static inline int security_secctx_to_secid(const char *secdata,
|
|
u32 seclen,
|
|
u32 *secid)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
static inline void security_release_secctx(char *secdata, u32 seclen)
|
|
{
|
|
}
|
|
|
|
static inline void security_inode_invalidate_secctx(struct inode *inode)
|
|
{
|
|
}
|
|
|
|
static inline int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
static inline int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
static inline int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
static inline int security_locked_down(enum lockdown_reason what)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif /* CONFIG_SECURITY */
|
|
|
|
#if defined(CONFIG_SECURITY) && defined(CONFIG_WATCH_QUEUE)
|
|
int security_post_notification(const struct cred *w_cred,
|
|
const struct cred *cred,
|
|
struct watch_notification *n);
|
|
#else
|
|
static inline int security_post_notification(const struct cred *w_cred,
|
|
const struct cred *cred,
|
|
struct watch_notification *n)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
#if defined(CONFIG_SECURITY) && defined(CONFIG_KEY_NOTIFICATIONS)
|
|
int security_watch_key(struct key *key);
|
|
#else
|
|
static inline int security_watch_key(struct key *key)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_SECURITY_NETWORK
|
|
|
|
int security_unix_stream_connect(struct sock *sock, struct sock *other, struct sock *newsk);
|
|
int security_unix_may_send(struct socket *sock, struct socket *other);
|
|
int security_socket_create(int family, int type, int protocol, int kern);
|
|
int security_socket_post_create(struct socket *sock, int family,
|
|
int type, int protocol, int kern);
|
|
int security_socket_socketpair(struct socket *socka, struct socket *sockb);
|
|
int security_socket_bind(struct socket *sock, struct sockaddr *address, int addrlen);
|
|
int security_socket_connect(struct socket *sock, struct sockaddr *address, int addrlen);
|
|
int security_socket_listen(struct socket *sock, int backlog);
|
|
int security_socket_accept(struct socket *sock, struct socket *newsock);
|
|
int security_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size);
|
|
int security_socket_recvmsg(struct socket *sock, struct msghdr *msg,
|
|
int size, int flags);
|
|
int security_socket_getsockname(struct socket *sock);
|
|
int security_socket_getpeername(struct socket *sock);
|
|
int security_socket_getsockopt(struct socket *sock, int level, int optname);
|
|
int security_socket_setsockopt(struct socket *sock, int level, int optname);
|
|
int security_socket_shutdown(struct socket *sock, int how);
|
|
int security_sock_rcv_skb(struct sock *sk, struct sk_buff *skb);
|
|
int security_socket_getpeersec_stream(struct socket *sock, char __user *optval,
|
|
int __user *optlen, unsigned len);
|
|
int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid);
|
|
int security_sk_alloc(struct sock *sk, int family, gfp_t priority);
|
|
void security_sk_free(struct sock *sk);
|
|
void security_sk_clone(const struct sock *sk, struct sock *newsk);
|
|
void security_sk_classify_flow(struct sock *sk, struct flowi_common *flic);
|
|
void security_req_classify_flow(const struct request_sock *req,
|
|
struct flowi_common *flic);
|
|
void security_sock_graft(struct sock*sk, struct socket *parent);
|
|
int security_inet_conn_request(struct sock *sk,
|
|
struct sk_buff *skb, struct request_sock *req);
|
|
void security_inet_csk_clone(struct sock *newsk,
|
|
const struct request_sock *req);
|
|
void security_inet_conn_established(struct sock *sk,
|
|
struct sk_buff *skb);
|
|
int security_secmark_relabel_packet(u32 secid);
|
|
void security_secmark_refcount_inc(void);
|
|
void security_secmark_refcount_dec(void);
|
|
int security_tun_dev_alloc_security(void **security);
|
|
void security_tun_dev_free_security(void *security);
|
|
int security_tun_dev_create(void);
|
|
int security_tun_dev_attach_queue(void *security);
|
|
int security_tun_dev_attach(struct sock *sk, void *security);
|
|
int security_tun_dev_open(void *security);
|
|
int security_sctp_assoc_request(struct sctp_endpoint *ep, struct sk_buff *skb);
|
|
int security_sctp_bind_connect(struct sock *sk, int optname,
|
|
struct sockaddr *address, int addrlen);
|
|
void security_sctp_sk_clone(struct sctp_endpoint *ep, struct sock *sk,
|
|
struct sock *newsk);
|
|
|
|
#else /* CONFIG_SECURITY_NETWORK */
|
|
static inline int security_unix_stream_connect(struct sock *sock,
|
|
struct sock *other,
|
|
struct sock *newsk)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_unix_may_send(struct socket *sock,
|
|
struct socket *other)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_create(int family, int type,
|
|
int protocol, int kern)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_post_create(struct socket *sock,
|
|
int family,
|
|
int type,
|
|
int protocol, int kern)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_socketpair(struct socket *socka,
|
|
struct socket *sockb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_bind(struct socket *sock,
|
|
struct sockaddr *address,
|
|
int addrlen)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_connect(struct socket *sock,
|
|
struct sockaddr *address,
|
|
int addrlen)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_listen(struct socket *sock, int backlog)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_accept(struct socket *sock,
|
|
struct socket *newsock)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_sendmsg(struct socket *sock,
|
|
struct msghdr *msg, int size)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_recvmsg(struct socket *sock,
|
|
struct msghdr *msg, int size,
|
|
int flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_getsockname(struct socket *sock)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_getpeername(struct socket *sock)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_getsockopt(struct socket *sock,
|
|
int level, int optname)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_setsockopt(struct socket *sock,
|
|
int level, int optname)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_shutdown(struct socket *sock, int how)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline int security_sock_rcv_skb(struct sock *sk,
|
|
struct sk_buff *skb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval,
|
|
int __user *optlen, unsigned len)
|
|
{
|
|
return -ENOPROTOOPT;
|
|
}
|
|
|
|
static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
|
|
{
|
|
return -ENOPROTOOPT;
|
|
}
|
|
|
|
static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_sk_free(struct sock *sk)
|
|
{
|
|
}
|
|
|
|
static inline void security_sk_clone(const struct sock *sk, struct sock *newsk)
|
|
{
|
|
}
|
|
|
|
static inline void security_sk_classify_flow(struct sock *sk,
|
|
struct flowi_common *flic)
|
|
{
|
|
}
|
|
|
|
static inline void security_req_classify_flow(const struct request_sock *req,
|
|
struct flowi_common *flic)
|
|
{
|
|
}
|
|
|
|
static inline void security_sock_graft(struct sock *sk, struct socket *parent)
|
|
{
|
|
}
|
|
|
|
static inline int security_inet_conn_request(struct sock *sk,
|
|
struct sk_buff *skb, struct request_sock *req)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_inet_csk_clone(struct sock *newsk,
|
|
const struct request_sock *req)
|
|
{
|
|
}
|
|
|
|
static inline void security_inet_conn_established(struct sock *sk,
|
|
struct sk_buff *skb)
|
|
{
|
|
}
|
|
|
|
static inline int security_secmark_relabel_packet(u32 secid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_secmark_refcount_inc(void)
|
|
{
|
|
}
|
|
|
|
static inline void security_secmark_refcount_dec(void)
|
|
{
|
|
}
|
|
|
|
static inline int security_tun_dev_alloc_security(void **security)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_tun_dev_free_security(void *security)
|
|
{
|
|
}
|
|
|
|
static inline int security_tun_dev_create(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_tun_dev_attach_queue(void *security)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_tun_dev_attach(struct sock *sk, void *security)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_tun_dev_open(void *security)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sctp_assoc_request(struct sctp_endpoint *ep,
|
|
struct sk_buff *skb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_sctp_bind_connect(struct sock *sk, int optname,
|
|
struct sockaddr *address,
|
|
int addrlen)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_sctp_sk_clone(struct sctp_endpoint *ep,
|
|
struct sock *sk,
|
|
struct sock *newsk)
|
|
{
|
|
}
|
|
#endif /* CONFIG_SECURITY_NETWORK */
|
|
|
|
#ifdef CONFIG_SECURITY_INFINIBAND
|
|
int security_ib_pkey_access(void *sec, u64 subnet_prefix, u16 pkey);
|
|
int security_ib_endport_manage_subnet(void *sec, const char *name, u8 port_num);
|
|
int security_ib_alloc_security(void **sec);
|
|
void security_ib_free_security(void *sec);
|
|
#else /* CONFIG_SECURITY_INFINIBAND */
|
|
static inline int security_ib_pkey_access(void *sec, u64 subnet_prefix, u16 pkey)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_ib_endport_manage_subnet(void *sec, const char *dev_name, u8 port_num)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_ib_alloc_security(void **sec)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_ib_free_security(void *sec)
|
|
{
|
|
}
|
|
#endif /* CONFIG_SECURITY_INFINIBAND */
|
|
|
|
#ifdef CONFIG_SECURITY_NETWORK_XFRM
|
|
|
|
int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp,
|
|
struct xfrm_user_sec_ctx *sec_ctx, gfp_t gfp);
|
|
int security_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctxp);
|
|
void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx);
|
|
int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx);
|
|
int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx);
|
|
int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
|
|
struct xfrm_sec_ctx *polsec, u32 secid);
|
|
int security_xfrm_state_delete(struct xfrm_state *x);
|
|
void security_xfrm_state_free(struct xfrm_state *x);
|
|
int security_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir);
|
|
int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
|
|
struct xfrm_policy *xp,
|
|
const struct flowi_common *flic);
|
|
int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid);
|
|
void security_skb_classify_flow(struct sk_buff *skb, struct flowi_common *flic);
|
|
|
|
#else /* CONFIG_SECURITY_NETWORK_XFRM */
|
|
|
|
static inline int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp,
|
|
struct xfrm_user_sec_ctx *sec_ctx,
|
|
gfp_t gfp)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_xfrm_policy_clone(struct xfrm_sec_ctx *old, struct xfrm_sec_ctx **new_ctxp)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx)
|
|
{
|
|
}
|
|
|
|
static inline int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_xfrm_state_alloc(struct xfrm_state *x,
|
|
struct xfrm_user_sec_ctx *sec_ctx)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
|
|
struct xfrm_sec_ctx *polsec, u32 secid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_xfrm_state_free(struct xfrm_state *x)
|
|
{
|
|
}
|
|
|
|
static inline int security_xfrm_state_delete(struct xfrm_state *x)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
|
|
struct xfrm_policy *xp,
|
|
const struct flowi_common *flic)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_skb_classify_flow(struct sk_buff *skb,
|
|
struct flowi_common *flic)
|
|
{
|
|
}
|
|
|
|
#endif /* CONFIG_SECURITY_NETWORK_XFRM */
|
|
|
|
#ifdef CONFIG_SECURITY_PATH
|
|
int security_path_unlink(const struct path *dir, struct dentry *dentry);
|
|
int security_path_mkdir(const struct path *dir, struct dentry *dentry, umode_t mode);
|
|
int security_path_rmdir(const struct path *dir, struct dentry *dentry);
|
|
int security_path_mknod(const struct path *dir, struct dentry *dentry, umode_t mode,
|
|
unsigned int dev);
|
|
int security_path_truncate(const struct path *path);
|
|
int security_path_symlink(const struct path *dir, struct dentry *dentry,
|
|
const char *old_name);
|
|
int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
|
|
struct dentry *new_dentry);
|
|
int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
|
|
const struct path *new_dir, struct dentry *new_dentry,
|
|
unsigned int flags);
|
|
int security_path_chmod(const struct path *path, umode_t mode);
|
|
int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid);
|
|
int security_path_chroot(const struct path *path);
|
|
#else /* CONFIG_SECURITY_PATH */
|
|
static inline int security_path_unlink(const struct path *dir, struct dentry *dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_mkdir(const struct path *dir, struct dentry *dentry,
|
|
umode_t mode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_rmdir(const struct path *dir, struct dentry *dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_mknod(const struct path *dir, struct dentry *dentry,
|
|
umode_t mode, unsigned int dev)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_truncate(const struct path *path)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_symlink(const struct path *dir, struct dentry *dentry,
|
|
const char *old_name)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_link(struct dentry *old_dentry,
|
|
const struct path *new_dir,
|
|
struct dentry *new_dentry)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_rename(const struct path *old_dir,
|
|
struct dentry *old_dentry,
|
|
const struct path *new_dir,
|
|
struct dentry *new_dentry,
|
|
unsigned int flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_chmod(const struct path *path, umode_t mode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_path_chroot(const struct path *path)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif /* CONFIG_SECURITY_PATH */
|
|
|
|
#ifdef CONFIG_KEYS
|
|
#ifdef CONFIG_SECURITY
|
|
|
|
int security_key_alloc(struct key *key, const struct cred *cred, unsigned long flags);
|
|
void security_key_free(struct key *key);
|
|
int security_key_permission(key_ref_t key_ref, const struct cred *cred,
|
|
enum key_need_perm need_perm);
|
|
int security_key_getsecurity(struct key *key, char **_buffer);
|
|
|
|
#else
|
|
|
|
static inline int security_key_alloc(struct key *key,
|
|
const struct cred *cred,
|
|
unsigned long flags)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_key_free(struct key *key)
|
|
{
|
|
}
|
|
|
|
static inline int security_key_permission(key_ref_t key_ref,
|
|
const struct cred *cred,
|
|
enum key_need_perm need_perm)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_key_getsecurity(struct key *key, char **_buffer)
|
|
{
|
|
*_buffer = NULL;
|
|
return 0;
|
|
}
|
|
|
|
#endif
|
|
#endif /* CONFIG_KEYS */
|
|
|
|
#ifdef CONFIG_AUDIT
|
|
#ifdef CONFIG_SECURITY
|
|
int security_audit_rule_init(u32 field, u32 op, char *rulestr, void **lsmrule);
|
|
int security_audit_rule_known(struct audit_krule *krule);
|
|
int security_audit_rule_match(u32 secid, u32 field, u32 op, void *lsmrule);
|
|
void security_audit_rule_free(void *lsmrule);
|
|
|
|
#else
|
|
|
|
static inline int security_audit_rule_init(u32 field, u32 op, char *rulestr,
|
|
void **lsmrule)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_audit_rule_known(struct audit_krule *krule)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_audit_rule_match(u32 secid, u32 field, u32 op,
|
|
void *lsmrule)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_audit_rule_free(void *lsmrule)
|
|
{ }
|
|
|
|
#endif /* CONFIG_SECURITY */
|
|
#endif /* CONFIG_AUDIT */
|
|
|
|
#ifdef CONFIG_SECURITYFS
|
|
|
|
extern struct dentry *securityfs_create_file(const char *name, umode_t mode,
|
|
struct dentry *parent, void *data,
|
|
const struct file_operations *fops);
|
|
extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent);
|
|
struct dentry *securityfs_create_symlink(const char *name,
|
|
struct dentry *parent,
|
|
const char *target,
|
|
const struct inode_operations *iops);
|
|
extern void securityfs_remove(struct dentry *dentry);
|
|
|
|
#else /* CONFIG_SECURITYFS */
|
|
|
|
static inline struct dentry *securityfs_create_dir(const char *name,
|
|
struct dentry *parent)
|
|
{
|
|
return ERR_PTR(-ENODEV);
|
|
}
|
|
|
|
static inline struct dentry *securityfs_create_file(const char *name,
|
|
umode_t mode,
|
|
struct dentry *parent,
|
|
void *data,
|
|
const struct file_operations *fops)
|
|
{
|
|
return ERR_PTR(-ENODEV);
|
|
}
|
|
|
|
static inline struct dentry *securityfs_create_symlink(const char *name,
|
|
struct dentry *parent,
|
|
const char *target,
|
|
const struct inode_operations *iops)
|
|
{
|
|
return ERR_PTR(-ENODEV);
|
|
}
|
|
|
|
static inline void securityfs_remove(struct dentry *dentry)
|
|
{}
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_BPF_SYSCALL
|
|
union bpf_attr;
|
|
struct bpf_map;
|
|
struct bpf_prog;
|
|
struct bpf_prog_aux;
|
|
#ifdef CONFIG_SECURITY
|
|
extern int security_bpf(int cmd, union bpf_attr *attr, unsigned int size);
|
|
extern int security_bpf_map(struct bpf_map *map, fmode_t fmode);
|
|
extern int security_bpf_prog(struct bpf_prog *prog);
|
|
extern int security_bpf_map_alloc(struct bpf_map *map);
|
|
extern void security_bpf_map_free(struct bpf_map *map);
|
|
extern int security_bpf_prog_alloc(struct bpf_prog_aux *aux);
|
|
extern void security_bpf_prog_free(struct bpf_prog_aux *aux);
|
|
#else
|
|
static inline int security_bpf(int cmd, union bpf_attr *attr,
|
|
unsigned int size)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_bpf_map(struct bpf_map *map, fmode_t fmode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_bpf_prog(struct bpf_prog *prog)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_bpf_map_alloc(struct bpf_map *map)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_bpf_map_free(struct bpf_map *map)
|
|
{ }
|
|
|
|
static inline int security_bpf_prog_alloc(struct bpf_prog_aux *aux)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_bpf_prog_free(struct bpf_prog_aux *aux)
|
|
{ }
|
|
#endif /* CONFIG_SECURITY */
|
|
#endif /* CONFIG_BPF_SYSCALL */
|
|
|
|
#ifdef CONFIG_PERF_EVENTS
|
|
struct perf_event_attr;
|
|
struct perf_event;
|
|
|
|
#ifdef CONFIG_SECURITY
|
|
extern int security_perf_event_open(struct perf_event_attr *attr, int type);
|
|
extern int security_perf_event_alloc(struct perf_event *event);
|
|
extern void security_perf_event_free(struct perf_event *event);
|
|
extern int security_perf_event_read(struct perf_event *event);
|
|
extern int security_perf_event_write(struct perf_event *event);
|
|
#else
|
|
static inline int security_perf_event_open(struct perf_event_attr *attr,
|
|
int type)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_perf_event_alloc(struct perf_event *event)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void security_perf_event_free(struct perf_event *event)
|
|
{
|
|
}
|
|
|
|
static inline int security_perf_event_read(struct perf_event *event)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int security_perf_event_write(struct perf_event *event)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif /* CONFIG_SECURITY */
|
|
#endif /* CONFIG_PERF_EVENTS */
|
|
|
|
#endif /* ! __LINUX_SECURITY_H */
|