Commit Graph

50 Commits

Author SHA1 Message Date
Greg Kroah-Hartman
9222a6a6c0 Merge 6.12.37 into android16-6.12-lts
GKI (arm64) relevant 35 out of 230 changes, affecting 67 files +612/-427
  ec9be081c5 Revert "mmc: sdhci: Disable SD card clock before changing parameters" [1 file, +2/-7]
  0698a2eb7d Bluetooth: HCI: Set extended advertising data synchronously [2 files, +130/-113]
  3672fe9d1e Bluetooth: hci_sync: revert some mesh modifications [1 file, +4/-12]
  44bb1e13b4 Bluetooth: MGMT: set_mesh: update LE scan interval and window [1 file, +22/-0]
  a99f80c88a Bluetooth: MGMT: mesh_send: check instances prior disabling advertising [1 file, +2/-1]
  5581e694d3 usb: typec: altmodes/displayport: do not index invalid pin_assignments [2 files, +2/-1]
  b1abc5ab47 scsi: sd: Fix VPD page 0xb7 length check [1 file, +1/-1]
  381c1c1219 Bluetooth: Prevent unintended pause by checking if advertising is active [1 file, +4/-0]
  f0fee863a7 nvme: Fix incorrect cdw15 value in passthru error logging [1 file, +1/-1]
  50c86c0945 netfs: Fix i_size updating [2 files, +8/-2]
  a553afd91f net/sched: Always pass notifications when child class becomes empty [1 file, +5/-14]
  d78f79a2c1 spinlock: extend guard with spinlock_bh variants [1 file, +13/-0]
  0cc4721a71 sched/fair: Rename h_nr_running into h_nr_queued [5 files, +53/-53]
  a2562bdd35 sched/fair: Fixup wake_up_sync() vs DELAYED_DEQUEUE [1 file, +11/-2]
  5833026221 f2fs: decrease spare area for pinned files for zoned devices [3 files, +5/-2]
  8912b139a8 f2fs: zone: fix to calculate first_zoned_segno correctly [4 files, +69/-20]
  c5474a7b04 bpf: use common instruction history across all states [2 files, +63/-63]
  4265682c29 bpf: Do not include stack ptr register in precision backtracking bookkeeping [2 files, +24/-6]
  e0fefe9bc0 netfs: Fix oops in write-retry from mis-resetting the subreq iterator [1 file, +3/-2]
  acf9ab15ec selinux: change security_compute_sid to return the ssid or tsid on match [1 file, +11/-5]
  42c5a4b47d rcu: Return early if callback is not specified [1 file, +4/-0]
  e036efbe58 add a string-to-qstr constructor [10 files, +13/-23]
  f94c422157 fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass [3 files, +21/-13]
  8caccd2eac usb: xhci: Skip xhci_reset in xhci_resume if xhci is being removed [1 file, +4/-1]
  9f75893189 Revert "usb: xhci: Implement xhci_handshake_check_state() helper" [3 files, +3/-30]
  fbebc2254a usb: xhci: quirk for data loss in ISOC transfers [3 files, +30/-0]
  195597e0be xhci: Disable stream for xHC controller with XHCI_BROKEN_STREAMS [1 file, +2/-1]
  dbdd2a2320 Input: xpad - support Acer NGR 200 Controller [1 file, +2/-0]
  3b1407caac usb: dwc3: Abort suspend on soft disconnect failure [2 files, +16/-15]
  7cb8750160 usb: acpi: fix device link removal [3 files, +8/-1]
  c745744a82 dma-buf: fix timeout handling in dma_resv_wait_timeout v2 [1 file, +7/-5]
  ccdc472b4d Logitech C-270 even more broken [1 file, +2/-1]
  c782f98eef usb: typec: displayport: Fix potential deadlock [1 file, +1/-2]
  ead91de35d mm/vmalloc: fix data race in show_numa_info() [1 file, +35/-28]
  4c443046d8 mm: userfaultfd: fix race of userfaultfd_move and swap cache [1 file, +31/-2]

Changes in 6.12.37
        rtc: pcf2127: add missing semicolon after statement
        rtc: pcf2127: fix SPI command byte for PCF2131
        rtc: cmos: use spin_lock_irqsave in cmos_interrupt
        virtio-net: xsk: rx: fix the frame's length check
        virtio-net: ensure the received length does not exceed allocated size
        s390/pci: Fix stale function handles in error handling
        s390/pci: Do not try re-enabling load/store if device is disabled
        net: txgbe: request MISC IRQ in ndo_open
        vsock/vmci: Clear the vmci transport packet properly when initializing it
        net: libwx: fix the incorrect display of the queue number
        mmc: sdhci: Add a helper function for dump register in dynamic debug mode
        Revert "mmc: sdhci: Disable SD card clock before changing parameters"
        mmc: core: sd: Apply BROKEN_SD_DISCARD quirk earlier
        Bluetooth: HCI: Set extended advertising data synchronously
        Bluetooth: hci_sync: revert some mesh modifications
        Bluetooth: MGMT: set_mesh: update LE scan interval and window
        Bluetooth: MGMT: mesh_send: check instances prior disabling advertising
        iommufd/selftest: Fix iommufd_dirty_tracking with large hugepage sizes
        regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods
        Input: cs40l50-vibra - fix potential NULL dereference in cs40l50_upload_owt()
        usb: typec: altmodes/displayport: do not index invalid pin_assignments
        mtk-sd: Fix a pagefault in dma_unmap_sg() for not prepared data
        mtk-sd: Prevent memory corruption from DMA map failure
        mtk-sd: reset host->mrq on prepare_data() error
        drm/v3d: Disable interrupts before resetting the GPU
        firmware: arm_ffa: Fix memory leak by freeing notifier callback node
        firmware: arm_ffa: Move memory allocation outside the mutex locking
        firmware: arm_ffa: Replace mutex with rwlock to avoid sleep in atomic context
        arm64: dts: apple: t8103: Fix PCIe BCM4377 nodename
        platform/mellanox: mlxbf-tmfifo: fix vring_desc.len assignment
        RDMA/mlx5: Fix unsafe xarray access in implicit ODP handling
        RDMA/mlx5: Initialize obj_event->obj_sub_list before xa_insert
        nfs: Clean up /proc/net/rpc/nfs when nfs_fs_proc_net_init() fails.
        NFSv4/pNFS: Fix a race to wake on NFS_LAYOUT_DRAIN
        scsi: qla2xxx: Fix DMA mapping test in qla24xx_get_port_database()
        scsi: qla4xxx: Fix missing DMA mapping error in qla4xxx_alloc_pdu()
        scsi: sd: Fix VPD page 0xb7 length check
        scsi: ufs: core: Fix spelling of a sysfs attribute name
        RDMA/mlx5: Fix HW counters query for non-representor devices
        RDMA/mlx5: Fix CC counters query for MPV
        RDMA/mlx5: Fix vport loopback for MPV device
        platform/mellanox: mlxbf-pmc: Fix duplicate event ID for CACHE_DATA1
        platform/mellanox: nvsw-sn2201: Fix bus number in adapter error message
        Bluetooth: Prevent unintended pause by checking if advertising is active
        btrfs: fix missing error handling when searching for inode refs during log replay
        btrfs: fix iteration of extrefs during log replay
        btrfs: return a btrfs_inode from btrfs_iget_logging()
        btrfs: return a btrfs_inode from read_one_inode()
        btrfs: fix invalid inode pointer dereferences during log replay
        btrfs: fix inode lookup error handling during log replay
        btrfs: record new subvolume in parent dir earlier to avoid dir logging races
        btrfs: propagate last_unlink_trans earlier when doing a rmdir
        btrfs: use btrfs_record_snapshot_destroy() during rmdir
        ethernet: atl1: Add missing DMA mapping error checks and count errors
        dpaa2-eth: fix xdp_rxq_info leak
        drm/exynos: fimd: Guard display clock control with runtime PM calls
        spi: spi-fsl-dspi: Clear completion counter before initiating transfer
        drm/i915/selftests: Change mock_request() to return error pointers
        nvme: Fix incorrect cdw15 value in passthru error logging
        nvmet: fix memory leak of bio integrity
        platform/x86: dell-wmi-sysman: Fix WMI data block retrieval in sysfs callbacks
        platform/x86: hp-bioscfg: Directly use firmware_attributes_class
        platform/x86: hp-bioscfg: Fix class device unregistration
        platform/x86: firmware_attributes_class: Move include linux/device/class.h
        platform/x86: firmware_attributes_class: Simplify API
        platform/x86: think-lmi: Directly use firmware_attributes_class
        platform/x86: think-lmi: Fix class device unregistration
        platform/x86: dell-sysman: Directly use firmware_attributes_class
        platform/x86: dell-wmi-sysman: Fix class device unregistration
        platform/mellanox: mlxreg-lc: Fix logic error in power state check
        drm/bridge: aux-hpd-bridge: fix assignment of the of_node
        smb: client: fix warning when reconnecting channel
        net: usb: lan78xx: fix WARN in __netif_napi_del_locked on disconnect
        drm/i915/gt: Fix timeline left held on VMA alloc error
        drm/i915/gsc: mei interrupt top half should be in irq disabled context
        idpf: return 0 size for RSS key if not supported
        idpf: convert control queue mutex to a spinlock
        igc: disable L1.2 PCI-E link substate to avoid performance issue
        smb: client: set missing retry flag in smb2_writev_callback()
        smb: client: set missing retry flag in cifs_readv_callback()
        smb: client: set missing retry flag in cifs_writev_callback()
        netfs: Fix i_size updating
        lib: test_objagg: Set error message in check_expect_hints_stats()
        amd-xgbe: align CL37 AN sequence as per databook
        enic: fix incorrect MTU comparison in enic_change_mtu()
        rose: fix dangling neighbour pointers in rose_rt_device_down()
        nui: Fix dma_mapping_error() check
        net/sched: Always pass notifications when child class becomes empty
        amd-xgbe: do not double read link status
        smb: client: fix race condition in negotiate timeout by using more precise timing
        arm64: dts: rockchip: fix internal USB hub instability on RK3399 Puma
        crypto: iaa - Remove dst_null support
        crypto: iaa - Do not clobber req->base.data
        spinlock: extend guard with spinlock_bh variants
        crypto: zynqmp-sha - Add locking
        kunit: qemu_configs: sparc: use Zilog console
        kunit: qemu_configs: sparc: Explicitly enable CONFIG_SPARC32=y
        kunit: qemu_configs: Disable faulting tests on 32-bit SPARC
        gfs2: Initialize gl_no_formal_ino earlier
        gfs2: Rename GIF_{DEFERRED -> DEFER}_DELETE
        gfs2: Rename dinode_demise to evict_behavior
        gfs2: Prevent inode creation race
        gfs2: Decode missing glock flags in tracepoints
        gfs2: Add GLF_PENDING_REPLY flag
        gfs2: Replace GIF_DEFER_DELETE with GLF_DEFER_DELETE
        gfs2: Move gfs2_dinode_dealloc
        gfs2: Move GIF_ALLOC_FAILED check out of gfs2_ea_dealloc
        gfs2: deallocate inodes in gfs2_create_inode
        btrfs: prepare btrfs_page_mkwrite() for large folios
        btrfs: fix wrong start offset for delalloc space release during mmap write
        sched/fair: Rename h_nr_running into h_nr_queued
        sched/fair: Add new cfs_rq.h_nr_runnable
        sched/fair: Fixup wake_up_sync() vs DELAYED_DEQUEUE
        gfs2: Move gfs2_trans_add_databufs
        gfs2: Don't start unnecessary transactions during log flush
        ASoC: tas2764: Extend driver to SN012776
        ASoC: tas2764: Reinit cache on part reset
        ACPI: thermal: Fix stale comment regarding trip points
        ACPI: thermal: Execute _SCP before reading trip points
        bonding: Mark active offloaded xfrm_states
        wifi: ath12k: fix skb_ext_desc leak in ath12k_dp_tx() error path
        wifi: ath12k: Handle error cases during extended skb allocation
        wifi: ath12k: fix wrong handling of CCMP256 and GCMP ciphers
        RDMA/rxe: Fix "trying to register non-static key in rxe_qp_do_cleanup" bug
        iommu: ipmmu-vmsa: avoid Wformat-security warning
        f2fs: decrease spare area for pinned files for zoned devices
        f2fs: zone: introduce first_zoned_segno in f2fs_sb_info
        f2fs: zone: fix to calculate first_zoned_segno correctly
        scsi: lpfc: Remove NLP_RELEASE_RPI flag from nodelist structure
        scsi: lpfc: Change lpfc_nodelist nlp_flag member into a bitmask
        scsi: lpfc: Avoid potential ndlp use-after-free in dev_loss_tmo_callbk
        hisi_acc_vfio_pci: bugfix cache write-back issue
        hisi_acc_vfio_pci: bugfix the problem of uninstalling driver
        bpf: use common instruction history across all states
        bpf: Do not include stack ptr register in precision backtracking bookkeeping
        arm64: dts: qcom: sm8650: change labels to lower-case
        arm64: dts: qcom: sm8650: Fix domain-idle-state for CPU2
        arm64: dts: renesas: Use interrupts-extended for Ethernet PHYs
        arm64: dts: renesas: Factor out White Hawk Single board support
        arm64: dts: renesas: white-hawk-single: Improve Ethernet TSN description
        arm64: dts: qcom: sm8650: add the missing l2 cache node
        ubsan: integer-overflow: depend on BROKEN to keep this out of CI
        remoteproc: k3: Call of_node_put(rmem_np) only once in three functions
        remoteproc: k3-r5: Add devm action to release reserved memory
        remoteproc: k3-r5: Use devm_kcalloc() helper
        remoteproc: k3-r5: Use devm_ioremap_wc() helper
        remoteproc: k3-r5: Use devm_rproc_add() helper
        remoteproc: k3-r5: Refactor sequential core power up/down operations
        netfs: Fix oops in write-retry from mis-resetting the subreq iterator
        mfd: exynos-lpass: Fix another error handling path in exynos_lpass_probe()
        drm/xe: Fix DSB buffer coherency
        drm/xe: Move DSB l2 flush to a more sensible place
        drm/xe: add interface to request physical alignment for buffer objects
        drm/xe: Allow bo mapping on multiple ggtts
        drm/xe: move DPT l2 flush to a more sensible place
        drm/xe: Replace double space with single space after comma
        drm/xe/guc: Dead CT helper
        drm/xe/guc: Explicitly exit CT safe mode on unwind
        selinux: change security_compute_sid to return the ssid or tsid on match
        drm/simpledrm: Do not upcast in release helpers
        drm/amdgpu: VCN v5_0_1 to prevent FW checking RB during DPG pause
        drm/i915/dp_mst: Work around Thunderbolt sink disconnect after SINK_COUNT_ESI read
        drm/amdgpu: add kicker fws loading for gfx11/smu13/psp13
        drm/amd/display: Add more checks for DSC / HUBP ONO guarantees
        arm64: dts: qcom: x1e80100-crd: mark l12b and l15b always-on
        drm/amdgpu/mes: add missing locking in helper functions
        sched_ext: Make scx_group_set_weight() always update tg->scx.weight
        scsi: lpfc: Restore clearing of NLP_UNREG_INP in ndlp->nlp_flag
        drm/msm: Fix a fence leak in submit error path
        drm/msm: Fix another leak in the submit error path
        ALSA: sb: Don't allow changing the DMA mode during operations
        ALSA: sb: Force to disable DMAs once when DMA mode is changed
        ata: libata-acpi: Do not assume 40 wire cable if no devices are enabled
        ata: pata_cs5536: fix build on 32-bit UML
        ASoC: amd: yc: Add quirk for MSI Bravo 17 D7VF internal mic
        platform/x86/amd/pmc: Add PCSpecialist Lafite Pro V 14M to 8042 quirks list
        genirq/irq_sim: Initialize work context pointers properly
        powerpc: Fix struct termio related ioctl macros
        ASoC: amd: yc: update quirk data for HP Victus
        regulator: fan53555: add enable_time support and soft-start times
        scsi: target: Fix NULL pointer dereference in core_scsi3_decode_spec_i_port()
        aoe: defer rexmit timer downdev work to workqueue
        wifi: mac80211: drop invalid source address OCB frames
        wifi: ath6kl: remove WARN on bad firmware input
        ACPICA: Refuse to evaluate a method if arguments are missing
        mtd: spinand: fix memory leak of ECC engine conf
        rcu: Return early if callback is not specified
        add a string-to-qstr constructor
        module: Provide EXPORT_SYMBOL_GPL_FOR_MODULES() helper
        fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass
        RDMA/mlx5: Fix cache entry update on dereg error
        IB/mlx5: Fix potential deadlock in MR deregistration
        drm/xe/bmg: Update Wa_22019338487
        drm/xe: Allow dropping kunit dependency as built-in
        NFSv4/flexfiles: Fix handling of NFS level errors in I/O
        usb: xhci: Skip xhci_reset in xhci_resume if xhci is being removed
        Revert "usb: xhci: Implement xhci_handshake_check_state() helper"
        usb: xhci: quirk for data loss in ISOC transfers
        xhci: dbctty: disable ECHO flag by default
        xhci: dbc: Flush queued requests before stopping dbc
        xhci: Disable stream for xHC controller with XHCI_BROKEN_STREAMS
        Input: xpad - support Acer NGR 200 Controller
        Input: iqs7222 - explicitly define number of external channels
        usb: cdnsp: do not disable slot for disabled slot
        usb: cdnsp: Fix issue with CV Bad Descriptor test
        usb: dwc3: Abort suspend on soft disconnect failure
        usb: chipidea: udc: disconnect/reconnect from host when do suspend/resume
        usb: acpi: fix device link removal
        smb: client: fix readdir returning wrong type with POSIX extensions
        cifs: all initializations for tcon should happen in tcon_info_alloc
        dma-buf: fix timeout handling in dma_resv_wait_timeout v2
        i2c/designware: Fix an initialization issue
        Logitech C-270 even more broken
        optee: ffa: fix sleep in atomic context
        iommu/rockchip: prevent iommus dead loop when two masters share one IOMMU
        powercap: intel_rapl: Do not change CLAMPING bit if ENABLE bit cannot be changed
        riscv: cpu_ops_sbi: Use static array for boot_data
        platform/x86: think-lmi: Create ksets consecutively
        platform/x86: think-lmi: Fix kobject cleanup
        platform/x86: think-lmi: Fix sysfs group cleanup
        usb: typec: displayport: Fix potential deadlock
        powerpc/kernel: Fix ppc_save_regs inclusion in build
        mm/vmalloc: fix data race in show_numa_info()
        mm: userfaultfd: fix race of userfaultfd_move and swap cache
        x86/bugs: Rename MDS machinery to something more generic
        x86/bugs: Add a Transient Scheduler Attacks mitigation
        KVM: SVM: Advertise TSA CPUID bits to guests
        x86/microcode/AMD: Add TSA microcode SHAs
        x86/process: Move the buffer clearing before MONITOR
        Linux 6.12.37

Change-Id: If1d8d0f83e11df1540bebaf0fb136fe340f25dcb
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2025-07-13 12:24:55 +00:00
Peter Zijlstra
cdd9862252 module: Provide EXPORT_SYMBOL_GPL_FOR_MODULES() helper
[ Upstream commit 707f853d7fa3ce323a6875487890c213e34d81a0 ]

Helper macro to more easily limit the export of a symbol to a given
list of modules.

Eg:

  EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm");

will limit the use of said function to kvm.ko, any other module trying
to use this symbol will refure to load (and get modpost build
failures).

Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Requested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: cbe4134ea4bc ("fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-07-10 16:05:08 +02:00
Greg Kroah-Hartman
9634c94147 Merge 6.12.13 into android16-6.12
GKI (arm64) relevant 102 out of 584 changes, affecting 165 files +1491/-594
  4338831b83 coredump: Do not lock during 'comm' reporting [1 file, +2/-2]
  784908004f fs: fix proc_handler for sysctl_nr_open [1 file, +1/-1]
  f83f330fc4 block: retry call probe after request_module in blk_request_module [1 file, +17/-5]
  e278c7ff75 block: check BLK_FEAT_POLL under q_usage_count [2 files, +22/-12]
  d313ff5308 block: don't update BLK_FEAT_POLL in __blk_mq_update_nr_hw_queues [4 files, +22/-26]
  4621771de1 nvme: Add error check for xa_store in nvme_get_effects_log [1 file, +6/-2]
  e8c390a9a5 nvme: Add error path for xa_store in nvme_init_effects [1 file, +22/-4]
  68303b5d38 select: Fix unbalanced user_access_end() [1 file, +2/-2]
  1e8c151fb2 nvme: fix bogus kzalloc() return check in nvme_init_effects_log() [1 file, +1/-1]
  e4b64d34a4 sched/fair: Untangle NEXT_BUDDY and pick_next_task() [2 files, +11/-2]
  5bb4039f77 sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat [2 files, +14/-4]
  fd2818c5e0 sched: Split out __schedule() deactivate task logic into a helper [1 file, +40/-27]
  3f1215588b sched: psi: pass enqueue/dequeue flags to psi callbacks directly [3 files, +53/-44]
  10a7d3e734 psi: Fix race when task wakes up before psi_sched_switch() adjusts flags [2 files, +7/-3]
  ebaeca33d3 HID: core: Fix assumption that Resolution Multipliers must be in Logical Collections [1 file, +2/-0]
  7d68c20638 OPP: add index check to assert to avoid buffer overflow in _read_freq() [1 file, +27/-15]
  ff2def2518 OPP: fix dev_pm_opp_find_bw_*() when bandwidth table not initialized [1 file, +13/-2]
  82bd38bd54 net_sched: sch_sfq: handle bigger packets [1 file, +13/-26]
  7d8947f215 net_sched: sch_sfq: don't allow 1 packet limit [1 file, +4/-0]
  e561d1a2ba clk: fix an OF node reference leak in of_clk_get_parent_name() [1 file, +3/-1]
  bd1bb30b9f HID: multitouch: fix support for Goodix PID 0x01e9 [1 file, +1/-1]
  d474a73856 inetpeer: remove create argument of inet_getpeer_v[46]() [7 files, +11/-12]
  dc4fd82dad inetpeer: remove create argument of inet_getpeer() [2 files, +5/-13]
  4622e45097 inetpeer: update inetpeer timestamp in inet_getpeer() [1 file, +4/-8]
  9345b588f8 inetpeer: do not get a refcount in inet_getpeer() [7 files, +32/-29]
  4f8344fce9 udp: Deal with race between UDP socket address change and rehash [2 files, +106/-0]
  a7175e363a dt-bindings: clock: imx93: Drop IMX93_CLK_END macro definition [1 file, +0/-1]
  036f2f5109 dt-bindings: clock: imx93: Add SPDIF IPG clk [1 file, +1/-0]
  5078123528 regulator: of: Implement the unwind path of of_regulator_match() [1 file, +13/-1]
  8937f5e38a ax25: rcu protect dev->ax25_ptr [7 files, +35/-20]
  3d62a5037f OPP: OF: Fix an OF node leak in _opp_add_static_v2() [1 file, +3/-1]
  a3bdd14936 HID: fix generic desktop D-Pad controls [2 files, +18/-20]
  a8251d3a4c mfd: syscon: Fix race in device_node_get_regmap() [1 file, +10/-9]
  984e7d2aa0 wifi: mac80211: Fix common size calculation for ML element [1 file, +3/-8]
  df2f2d9199 Bluetooth: btbcm: Fix NULL deref in btbcm_get_board_name() [1 file, +3/-0]
  f98ccd7d77 dev: Acquire netdev_rename_lock before restoring dev->name in dev_change_name(). [1 file, +2/-0]
  33e2168788 net: let net.core.dev_weight always be non-zero [1 file, +4/-1]
  b382ab9b88 net: avoid race between device unregistration and ethnl ops [1 file, +1/-1]
  73c7e1d689 net: sched: Disallow replacing of child qdisc from one parent to another [1 file, +4/-0]
  d7fe7e1bbe netfilter: nf_tables: fix set size with rbtree backend [3 files, +96/-2]
  5213efec90 net: sched: refine software bypass handling in tc_run [8 files, +55/-45]
  a0753466f0 tcp_cubic: fix incorrect HyStart round start detection [1 file, +5/-3]
  b7de862bda crypto: api - Fix boot-up self-test race [1 file, +2/-2]
  b002750000 bpf: bpf_local_storage: Always use bpf_mem_alloc in PREEMPT_RT [1 file, +6/-2]
  eb2e58484b rhashtable: Fix potential deadlock by moving schedule_work outside lock [1 file, +6/-4]
  8e7d29b698 bpf: Use refcount_t instead of atomic_t for mmap_count [1 file, +4/-4]
  b777b14c2a bpf: Reject struct_ops registration that uses module ptr and the module btf_id is missing [3 files, +26/-5]
  78b9778349 bpf: Send signals asynchronously if !preemptible [1 file, +1/-1]
  0e272fe6a0 bpf: tcp: Mark bpf_load_hdr_opt() arg2 as read-write [1 file, +1/-1]
  f939008a52 rhashtable: Fix rhashtable_try_insert test [1 file, +7/-5]
  33e47d9573 bpf: Cancel the running bpf_timer through kworker for PREEMPT_RT [1 file, +16/-2]
  6cffdf4838 of: property: Avoiding using uninitialized variable @imaplen in parse_interrupt_map() [1 file, +1/-1]
  92ed1efb6a of: reserved-memory: Do not make kmemleak ignore freed address [1 file, +2/-1]
  9a0fe62f93 of: reserved_mem: Restructure how the reserved memory regions are processed [3 files, +122/-54]
  e61977c714 of/fdt: Restore possibility to use both ACPI and FDT from bootloader [1 file, +1/-9]
  45e1246e5c PCI: endpoint: Destroy the EPC device in devm_pci_epc_destroy() [1 file, +1/-1]
  58465dfc42 media: uvcvideo: Propagate buf->error to userspace [1 file, +2/-1]
  a2c80a1881 PCI: qcom: Update ICC and OPP values after Link Up event [1 file, +2/-0]
  a665fab63d PCI: dwc: Always stop link in the dw_pcie_suspend_noirq [1 file, +1/-0]
  0e0ac81d51 scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails [1 file, +1/-0]
  4896402780 erofs: fix potential return value overflow of z_erofs_shrink_scan() [1 file, +1/-2]
  565611d101 module: Extend the preempt disabled section in dereference_symbol_descriptor(). [1 file, +1/-1]
  fd41b2e9aa module: Don't fail module loading when setting ro_after_init section RO failed [1 file, +4/-3]
  1614e75d1a driver core: class: Fix wild pointer dereferences in API class_dev_iter_next() [1 file, +8/-1]
  b35a3edc7c serial: 8250: Adjust the timeout for FIFO mode [1 file, +26/-6]
  87fdd4c447 xfrm: replay: Fix the update of replay_esn->oseq_hi for GSO [1 file, +6/-4]
  2a64cff2aa xfrm: Add support for per cpu xfrm state handling. [6 files, +112/-22]
  aa48a18fdb xfrm: Cache used outbound xfrm states at the policy. [3 files, +71/-0]
  5e4334dc39 xfrm: Add an inbound percpu state cache. [6 files, +70/-7]
  a16871c783 xfrm: state: fix out-of-bounds read during lookup [1 file, +70/-19]
  6945701ca1 xfrm: delete intermediate secpath entry in packet offload mode [1 file, +13/-3]
  24ac5b7524 regulator: core: Add missing newline character [1 file, +1/-1]
  a099834a51 ipmr: do not call mr_mfc_uses_dev() for unres entries [1 file, +0/-3]
  3b732c60a0 PM: hibernate: Add error handling for syscore_suspend() [1 file, +6/-1]
  e468aace40 xfrm: Don't disable preemption while looking up cache state. [1 file, +1/-3]
  3e44707da8 ptp: Properly handle compat ioctls [1 file, +4/-0]
  a68d7a9fb8 ethtool: Fix set RXNFC command with symmetric RSS hash [1 file, +1/-1]
  a06bb37d65 vsock: Allow retrying on connect() failure [1 file, +5/-0]
  1dd823a46e tcp: correct handling of extreme memory squeeze [1 file, +6/-3]
  557707906d net: xdp: Disallow attaching device-bound programs in generic mode [1 file, +4/-0]
  a23834b782 genksyms: fix memory leak when the same symbol is added from source [2 files, +15/-2]
  52f0a28e17 genksyms: fix memory leak when the same symbol is read from *.symref file [3 files, +9/-5]
  206d8e0242 io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock() [1 file, +1/-1]
  6e26ca1818 kconfig: fix file name in warnings when loading KCONFIG_DEFCONFIG_LIST [1 file, +4/-2]
  e4e8ed67e0 kconfig: fix memory leak in sym_warn_unmet_dep() [1 file, +1/-0]
  00d1943fe4 f2fs: Introduce linear search for dentries [3 files, +45/-19]
  e0216c39b4 ALSA: usb-audio: Add delay quirk for iBasso DC07 Pro [1 file, +2/-0]
  f395b7efce net: usb: rtl8150: enable basic endpoint checking [1 file, +22/-0]
  ae069cd2ba usb: xhci: Fix NULL pointer dereference on certain command aborts [1 file, +2/-1]
  ebba1bebf0 usb: dwc3: core: Defer the probe until USB power supply ready [1 file, +21/-9]
  01c74aeac2 usb: dwc3: Skip resume if pm_runtime_set_active() fails [1 file, +4/-1]
  ce5c91a1b2 usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE [1 file, +1/-1]
  15b50cbc6f usb: typec: tcpci: Prevent Sink disconnection before vPpsShutdown in SPR PPS [3 files, +16/-8]
  f2013d19b7 remoteproc: core: Fix ida_free call while not allocated [1 file, +7/-7]
  d1f8e69eec media: uvcvideo: Fix double free in error path [1 file, +1/-0]
  8de4e5a922 of: reserved-memory: Warn for missing static reserved memory regions [1 file, +5/-0]
  698943070e dma-mapping: save base/size instead of pointer to shared DMA pool [1 file, +8/-6]
  78b366aa0e xfrm: Add error handling when nla_put_u32() returns an error [1 file, +4/-1]
  364d7e7f30 xfrm: Fix acquire state insertion. [1 file, +1/-0]
  1cf2177959 ethtool: Fix access to uninitialized fields in set RXNFC command [1 file, +2/-1]
  c3a3741db8 memcg: fix soft lockup in the OOM process [2 files, +13/-2]
  333f128224 ethtool: ntuple: fix rss + ring_cookie check [1 file, +1/-1]

Changes in 6.12.13
	coredump: Do not lock during 'comm' reporting
	powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active
	dlm: fix removal of rsb struct that is master and dir record
	dlm: fix srcu_read_lock() return type to int
	afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY
	afs: Fix directory format encoding struct
	afs: Fix cleanup of immediately failed async calls
	fs: fix proc_handler for sysctl_nr_open
	block: copy back bounce buffer to user-space correctly in case of split
	block: retry call probe after request_module in blk_request_module
	ps3disk: Do not use dev->bounce_size before it is set
	nbd: don't allow reconnect after disconnect
	pstore/blk: trivial typo fixes
	block: check BLK_FEAT_POLL under q_usage_count
	block: don't update BLK_FEAT_POLL in __blk_mq_update_nr_hw_queues
	nvme-tcp: Fix I/O queue cpu spreading for multiple controllers
	nvme: Add error check for xa_store in nvme_get_effects_log
	powerpc/pseries/iommu: IOMMU incorrectly marks MMIO range in DDW
	selftests/powerpc: Fix argument order to timer_sub()
	nvme: Add error path for xa_store in nvme_init_effects
	btrfs: improve the warning and error message for btrfs_remove_qgroup()
	partitions: ldm: remove the initial kernel-doc notation
	btrfs: subpage: fix the bitmap dump of the locked flags
	select: Fix unbalanced user_access_end()
	nvme: fix bogus kzalloc() return check in nvme_init_effects_log()
	afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call
	perf/core: Save raw sample data conditionally based on sample type
	sched/fair: Untangle NEXT_BUDDY and pick_next_task()
	sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat
	sched: Fix race between yield_to() and try_to_wake_up()
	x86/cpu: Enable SD_ASYM_PACKING for PKG domain on AMD
	x86/topology: Use x86_sched_itmt_flags for PKG domain unconditionally
	sched: Split out __schedule() deactivate task logic into a helper
	sched: psi: pass enqueue/dequeue flags to psi callbacks directly
	psi: Fix race when task wakes up before psi_sched_switch() adjusts flags
	drm/v3d: Fix performance counter source settings on V3D 7.x
	drm/rockchip: vop2: fix rk3588 dp+dsi maxclk verification
	drm/msm/dp: set safe_to_exit_level before printing it
	drm/msm/hdmi: simplify code in pll_get_integloop_gain
	drm/etnaviv: Fix page property being used for non writecombine buffers
	HID: core: Fix assumption that Resolution Multipliers must be in Logical Collections
	drm/amd/pm: Fix an error handling path in vega10_enable_se_edc_force_stall_config()
	drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table
	drm/rockchip: vop2: Fix cluster windows alpha ctrl regsiters offset
	drm/rockchip: vop2: Fix the mixer alpha setup for layer 0
	drm/panthor: Preserve the result returned by panthor_fw_resume()
	drm/rockchip: vop2: Fix the windows switch between different layers
	printk: Defer legacy printing when holding printk_cpu_sync
	drm/connector: Allow clearing HDMI infoframes
	drm/rockchip: vop2: Set AXI id for rk3588
	drm/rockchip: vop2: Setup delay cycle for Esmart2/3
	drm/rockchip: vop2: Check linear format for Cluster windows on rk3566/8
	drm/rockchip: vop2: Add check for 32 bpp format for rk3588
	drm/rockchip: vop2: include rockchip_drm_drv.h
	drm/amdgpu/vcn: reset fw_shared under SRIOV
	OPP: add index check to assert to avoid buffer overflow in _read_freq()
	OPP: fix dev_pm_opp_find_bw_*() when bandwidth table not initialized
	drm/msm/dpu: provide DSPP and correct LM config for SDM670
	drm/msm/dpu: link DSPP_2/_3 blocks on SM8150
	drm/msm/dpu: link DSPP_2/_3 blocks on SC8180X
	drm/msm/dpu: link DSPP_2/_3 blocks on SM8250
	drm/msm/dpu: link DSPP_2/_3 blocks on SM8350
	drm/msm/dpu: link DSPP_2/_3 blocks on SM8550
	drm/msm/dpu: link DSPP_2/_3 blocks on SM8650
	drm/msm/dpu: link DSPP_2/_3 blocks on X1E80100
	drm/msm: Check return value of of_dma_configure()
	drm/msm: don't clean up priv->kms prematurely
	drm/msm/mdp4: correct LCDC regulator name
	drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE
	drm/amdgpu: tear down ttm range manager for doorbell in amdgpu_ttm_fini()
	Revert "drm/amdgpu/gfx9: put queue resets behind a debug option"
	drm/amdgpu: fix gpu recovery disable with per queue reset
	genirq: Make handle_enforce_irqctx() unconditionally available
	ipmi: ipmb: Add check devm_kasprintf() returned value
	wifi: ath11k: Fix unexpected return buffer manager error for WCN6750/WCN6855
	wifi: rtlwifi: rtl8821ae: phy: restore removed code to fix infinite loop
	wifi: rtlwifi: do not complete firmware loading needlessly
	wifi: rtlwifi: rtl8192se: rise completion of firmware loading as last step
	wifi: rtlwifi: wait for firmware loading before releasing memory
	wifi: rtlwifi: fix init_sw_vars leak when probe fails
	wifi: rtlwifi: usb: fix workqueue leak when probe fails
	wifi: wcn36xx: fix channel survey memory allocation size
	clk: renesas: cpg-mssr: Fix 'soc' node handling in cpg_mssr_reserved_init()
	wifi: cfg80211: tests: Fix potential NULL dereference in test_cfg80211_parse_colocated_ap()
	selftests/bpf: Actuate tx_metadata_len in xdp_hw_metadata
	net_sched: sch_sfq: handle bigger packets
	net_sched: sch_sfq: don't allow 1 packet limit
	spi: zynq-qspi: Add check for clk_enable()
	rxrpc: Fix handling of received connection abort
	dt-bindings: mmc: controller: clarify the address-cells description
	clk: fix an OF node reference leak in of_clk_get_parent_name()
	dt-bindings: leds: class-multicolor: Fix path to color definitions
	wifi: rtlwifi: remove unused check_buddy_priv
	wifi: rtlwifi: destroy workqueue at rtl_deinit_core
	wifi: rtlwifi: fix memory leaks and invalid access at probe error path
	wifi: rtlwifi: pci: wait for firmware loading before releasing memory
	HID: multitouch: fix support for Goodix PID 0x01e9
	regulator: dt-bindings: mt6315: Drop regulator-compatible property
	wifi: brcmfmac: add missing header include for brcmf_dbg
	module: Convert default symbol namespace to string literal
	hwmon: (nct6775): Actually make use of the HWMON_NCT6775 symbol namespace
	ACPI: fan: cleanup resources in the error path of .probe()
	cpupower: fix TSC MHz calculation
	dt-bindings: mfd: bd71815: Fix rsense and typos
	leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata()
	inetpeer: remove create argument of inet_getpeer_v[46]()
	inetpeer: remove create argument of inet_getpeer()
	inetpeer: update inetpeer timestamp in inet_getpeer()
	inetpeer: do not get a refcount in inet_getpeer()
	pwm: stm32-lp: Add check for clk_enable()
	cpufreq: schedutil: Fix superfluous updates caused by need_freq_update
	selftests: ktap_helpers: Fix uninitialized variable
	ptr_ring: do not block hard interrupts in ptr_ring_resize_multiple()
	net: airoha: Fix error path in airoha_probe()
	gpio: pca953x: log an error when failing to get the reset GPIO
	cpufreq: qcom: Fix qcom_cpufreq_hw_recalc_rate() to query LUT if LMh IRQ is not available
	cpufreq: qcom: Implement clk_ops::determine_rate() for qcom_cpufreq* clocks
	udp: Deal with race between UDP socket address change and rehash
	clk: imx8mp: Fix clkout1/2 support
	dt-bindings: clock: imx93: Drop IMX93_CLK_END macro definition
	dt-bindings: clock: Add i.MX91 clock support
	dt-bindings: clock: imx93: Add SPDIF IPG clk
	clk: imx93: Move IMX93_CLK_END macro to clk driver
	clk: imx: add i.MX91 clk
	clk: imx93: Add IMX93_CLK_SPDIF_IPG clock
	arm64: dts: imx93: Use IMX93_CLK_SPDIF_IPG as SPDIF IPG clock
	clk: imx: Apply some clks only for i.MX93
	clk: qcom: camcc-x1e80100: Set titan_top_gdsc as the parent GDSC of subordinate GDSCs
	team: prevent adding a device which is already a team device lower
	dt-bindings: clock: sunxi: Export PLL_VIDEO_2X and PLL_MIPI
	clk: sunxi-ng: a64: drop redundant CLK_PLL_VIDEO0_2X and CLK_PLL_MIPI
	clk: sunxi-ng: a64: stop force-selecting PLL-MIPI as TCON0 parent
	regulator: of: Implement the unwind path of of_regulator_match()
	ax25: rcu protect dev->ax25_ptr
	net/mlx5: HWS, fix definer's HWS_SET32 macro for negative offset
	OPP: OF: Fix an OF node leak in _opp_add_static_v2()
	ipmi: ssif_bmc: Fix new request loss when bmc ready for a response
	wifi: ath12k: fix tx power, max reg power update to firmware
	clk: qcom: gcc-sdm845: Do not use shared clk_ops for QUPs
	HID: hid-thrustmaster: Fix warning in thrustmaster_probe by adding endpoint check
	HID: fix generic desktop D-Pad controls
	leds: cht-wcove: Use devm_led_classdev_register() to avoid memory leak
	mfd: syscon: Fix race in device_node_get_regmap()
	samples/landlock: Fix possible NULL dereference in parse_path()
	wifi: mt76: mt7996: fix invalid interface combinations
	wifi: wlcore: fix unbalanced pm_runtime calls
	wifi: rtw89: handle entity active flag per PHY
	wifi: rtw89: chan: manage active interfaces
	wifi: rtw89: tweak setting of channel and TX power for MLO
	wifi: rtw89: fix proceeding MCC with wrong scanning state after sequence changes
	wifi: rtw89: chan: fix soft lockup in rtw89_entity_recalc_mgnt_roles()
	wifi: rtw89: avoid to init mgnt_entry list twice when WoWLAN failed
	wifi: rtw89: mcc: consider time limits not divisible by 1024
	wifi: rtw89: fix race between cancel_hw_scan and hw_scan completion
	hwmon: Fix help text for aspeed-g6-pwm-tach
	wifi: mt76: mt7925: fix off by one in mt7925_load_clc()
	wifi: mt76: mt7915: Fix mesh scan on MT7916 DBDC
	wifi: iwlwifi: fw: read STEP table from correct UEFI var
	wifi: iwlwifi: mvm: avoid NULL pointer dereference
	wifi: iwlwifi: mvm: don't count mgmt frames as MPDU
	wifi: mac80211: prohibit deactivating all links
	wifi: cfg80211: Move cfg80211_scan_req_add_chan() n_channels increment earlier
	wifi: mac80211: fix tid removal during mesh forwarding
	wifi: mac80211: Fix common size calculation for ML element
	wifi: mac80211: don't flush non-uploaded STAs
	clk: ralink: mtmips: remove duplicated 'xtal' clock for Ralink SoC RT3883
	clk: thead: Fix clk gate registration to pass flags
	clk: thead: Add CLK_IGNORE_UNUSED to fix TH1520 boot
	clk: thead: Fix cpu2vp_clk for TH1520 AP_SUBSYS clocks
	net/smc: fix data error when recvmsg with MSG_PEEK flag
	landlock: Handle weird files
	wifi: mt76: mt76u_vendor_request: Do not print error messages when -EPROTO
	wifi: mt76: mt7921: fix using incorrect group cipher after disconnection.
	wifi: mt76: mt7915: Fix an error handling path in mt7915_add_interface()
	wifi: mt76: mt7925: fix NULL deref check in mt7925_change_vif_links
	wifi: mt76: mt7925: fix wrong band_idx setting when enable sniffer mode
	wifi: mt76: mt7925: fix get wrong chip cap from incorrect pointer
	wifi: mt76: mt7925: fix the invalid ip address for arp offload
	wifi: mt76: mt7996: fix overflows seen when writing limit attributes
	wifi: mt76: mt7915: fix overflows seen when writing limit attributes
	wifi: mt76: connac: Extend mt76_connac_mcu_uni_add_dev for MLO
	wifi: mt76: mt7925: Fix incorrect MLD address in bss_mld_tlv for MLO support
	wifi: mt76: mt7925: Fix incorrect WCID assignment for MLO
	wifi: mt76: mt7925: Fix incorrect WCID phy_idx assignment
	wifi: mt76: mt7925: fix wrong parameter for related cmd of chan info
	wifi: mt76: mt7925: Fix CNM Timeout with Single Active Link in MLO
	wifi: mt76: mt7925: Enhance mt7925_mac_link_bss_add to support MLO
	wifi: mt76: Enhance mt7925_mac_link_sta_add to support MLO
	wifi: mt76: mt7925: Update mt7925_mcu_sta_update for BC in ASSOC state
	wifi: mt76: mt7925: Update mt792x_rx_get_wcid for per-link STA
	wifi: mt76: mt7925: Update mt7925_unassign_vif_chanctx for per-link BSS
	wifi: mt76: mt7925: Update secondary link PS flow
	wifi: mt76: mt7925: Init secondary link PM state
	wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO
	wifi: mt76: mt7925: Cleanup MLO settings post-disconnection
	wifi: mt76: mt7925: Properly handle responses for commands with events
	wifi: mt76: mt7996: fix rx filter setting for bfee functionality
	wifi: mt76: only enable tx worker after setting the channel
	wifi: mt76: mt7915: firmware restart on devices with a second pcie link
	wifi: mt76: mt7915: fix omac index assignment after hardware reset
	wifi: mt76: mt7915: fix register mapping
	wifi: mt76: mt7996: fix register mapping
	wifi: mt76: mt7996: add max mpdu len capability
	wifi: mt76: mt7996: fix the capability of reception of EHT MU PPDU
	wifi: mt76: mt7996: fix HE Phy capability
	wifi: mt76: mt7996: fix incorrect indexing of MIB FW event
	wifi: mt76: mt7996: fix definition of tx descriptor
	wifi: mt76: mt7996: fix ldpc setting
	i2c: designware: Actually make use of the I2C_DW_COMMON and I2C_DW symbol namespaces
	cpufreq: ACPI: Fix max-frequency computation
	selftests: timers: clocksource-switch: Adapt progress to kselftest framework
	selftests: harness: fix printing of mismatch values in __EXPECT()
	wifi: cfg80211: adjust allocation of colocated AP data
	Bluetooth: btbcm: Fix NULL deref in btbcm_get_board_name()
	Bluetooth: btrtl: check for NULL in btrtl_setup_realtek()
	inet: ipmr: fix data-races
	clk: analogbits: Fix incorrect calculation of vco rate delta
	dev: Acquire netdev_rename_lock before restoring dev->name in dev_change_name().
	pwm: stm32: Add check for clk_enable()
	selftests/landlock: Fix build with non-default pthread linking
	selftests/landlock: Fix error message
	net: let net.core.dev_weight always be non-zero
	net/mlxfw: Drop hard coded max FW flash image size
	octeon_ep: remove firmware stats fetch in ndo_get_stats64
	octeon_ep_vf: remove firmware stats fetch in ndo_get_stats64
	net: avoid race between device unregistration and ethnl ops
	net: sched: Disallow replacing of child qdisc from one parent to another
	netfilter: nf_tables: fix set size with rbtree backend
	netfilter: nft_flow_offload: update tcp state flags under lock
	net: sched: refine software bypass handling in tc_run
	net: ethernet: ti: am65-cpsw: fix freeing IRQ in am65_cpsw_nuss_remove_tx_chns()
	tcp_cubic: fix incorrect HyStart round start detection
	net/rose: prevent integer overflows in rose_setsockopt()
	platform/mellanox: mlxbf-pmc: incorrect type in assignment
	platform/x86: x86-android-tablets: make platform data be static
	pinctrl: samsung: Fix irq handling if an error occurs in exynos_irq_demux_eint16_31()
	libbpf: don't adjust USDT semaphore address if .stapsdt.base addr is missing
	ASoC: cs40l50: Use *-y for Makefile
	ASoC: mediatek: mt8365: Use *-y for Makefile
	ASoC: wcd937x: Use *-y for Makefile
	tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind
	libbpf: Fix segfault due to libelf functions not setting errno
	ASoC: Intel: sof_sdw: correct mach_params->dmic_num
	ASoC: sun4i-spdif: Add clock multiplier settings
	selftests/bpf: Fix fill_link_info selftest on powerpc
	iommu/arm-smmuv3: Update comments about ATS and bypass
	crypto: tegra - do not transfer req when tegra init fails
	crypto: api - Fix boot-up self-test race
	crypto: caam - use JobR's space to access page 0 regs
	perf header: Fix one memory leakage in process_bpf_btf()
	perf header: Fix one memory leakage in process_bpf_prog_info()
	perf bpf: Fix two memory leakages when calling perf_env__insert_bpf_prog_info()
	ASoC: renesas: rz-ssi: Use only the proper amount of dividers
	perf expr: Initialize is_test value in expr__ctx_new()
	pinctrl: nomadik: Add check for clk_enable()
	ktest.pl: Remove unused declarations in run_bisect_test function
	bpf: bpf_local_storage: Always use bpf_mem_alloc in PREEMPT_RT
	rhashtable: Fix potential deadlock by moving schedule_work outside lock
	crypto: hisilicon/sec2 - fix for aead icv error
	crypto: hisilicon/sec2 - fix for aead invalid authsize
	crypto: ixp4xx - fix OF node reference leaks in init_ixp_crypto()
	crypto: iaa - Fix IAA disabling that occurs when sync_mode is set to 'async'
	bpf: Use refcount_t instead of atomic_t for mmap_count
	ALSA: seq: Make dependency on UMP clearer
	bpf: Reject struct_ops registration that uses module ptr and the module btf_id is missing
	padata: fix sysfs store callback check
	selftests/bpf: Avoid generating untracked files when running bpf selftests
	perf top: Don't complain about lack of vmlinux when not resolving some kernel samples
	perf maps: Fix display of kernel symbols
	perf machine: Don't ignore _etext when not a text symbol
	perf namespaces: Introduce nsinfo__set_in_pidns()
	perf namespaces: Fixup the nsinfo__in_pidns() return type, its bool
	ASoC: Intel: avs: Do not readq() u32 registers
	ASoC: Intel: avs: Fix the minimum firmware version numbers
	ASoC: Intel: avs: Fix theoretical infinite loop
	ASoC: Intel: avs: Fix init-config parsing
	perf MANIFEST: Add arch/*/include/uapi/asm/bpf_perf_event.h to the perf tarball
	ALSA: hda: Fix compilation of snd_hdac_adsp_xxx() helpers
	perf report: Fix misleading help message about --demangle
	pinctrl: stm32: Add check for clk_enable()
	pinctrl: amd: Take suspend type into consideration which pins are non-wake
	perf inject: Fix use without initialization of local variables
	ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 83LC
	ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 83JX, 83MC and 83NM
	bpf: Send signals asynchronously if !preemptible
	selftests/bpf: Fix btf leak on new btf alloc failure in btf_distill test
	libbpf: Fix return zero when elf_begin failed
	libbpf: Fix incorrect traversal end type ID when marking BTF_IS_EMBEDDED
	bpf: tcp: Mark bpf_load_hdr_opt() arg2 as read-write
	iommu/amd: Remove unused amd_iommu_domain_update()
	ALSA: hda/realtek - Fixed headphone distorted sound on Acer Aspire A115-31 laptop
	tools: Sync if_xdp.h uapi tooling header
	perf lock: Fix parse_lock_type which only retrieve one lock flag
	padata: fix UAF in padata_reorder
	padata: add pd get/put refcnt helper
	padata: avoid UAF for reorder_work
	rhashtable: Fix rhashtable_try_insert test
	smb: client: fix oops due to unset link speed
	cifs: Use cifs_autodisable_serverino() for disabling CIFS_MOUNT_SERVER_INUM in readdir.c
	bpf: Cancel the running bpf_timer through kworker for PREEMPT_RT
	soc: atmel: fix device_node release in atmel_soc_device_init()
	ARM: at91: pm: change BU Power Switch to automatic mode
	ARM: dts: imx7-tqma7: add missing vs-supply for LM75A (rev. 01xxx)
	arm64: dts: mediatek: mt8186: Move wakeup to MTU3 to get working suspend
	arm64: dts: mt8183: set DMIC one-wire mode on Damu
	arm64: dts: mediatek: mt8516: fix GICv2 range
	arm64: dts: mediatek: mt8516: fix wdt irq type
	arm64: dts: mediatek: mt8516: add i2c clock-div property
	arm64: dts: mediatek: mt8516: reserve 192 KiB for TF-A
	ARM: dts: stm32: Increase CPU core voltage on STM32MP13xx DHCOR SoM
	ARM: dts: stm32: Fix IPCC EXTI declaration on stm32mp151
	RDMA/mlx4: Avoid false error about access to uninitialized gids array
	arm64: dts: renesas: rzg3s-smarc: Fix the debug serial alias
	rdma/cxgb4: Prevent potential integer overflow on 32bit
	arm64: dts: mediatek: mt8173-evb: Drop regulator-compatible property
	arm64: dts: mediatek: mt8173-elm: Drop regulator-compatible property
	arm64: dts: mediatek: mt8192-asurada: Drop regulator-compatible property
	arm64: dts: mediatek: mt8195-cherry: Drop regulator-compatible property
	arm64: dts: mediatek: mt8195-demo: Drop regulator-compatible property
	arm64: dts: medaitek: mt8395-nio-12l: Drop regulator-compatible property
	arm64: dts: mediatek: mt8395-genio-1200-evk: Drop regulator-compatible property
	arm64: dts: mediatek: mt8173-elm: Fix MT6397 PMIC sub-node names
	arm64: dts: mediatek: mt8173-evb: Fix MT6397 PMIC sub-node names
	ARM: dts: aspeed: yosemite4: correct the compatible string of adm1272
	ARM: dts: aspeed: yosemite4: Add required properties for IOE on fan boards
	ARM: dts: aspeed: yosemite4: correct the compatible string for max31790
	arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb"
	RDMA/rxe: Fix mismatched max_msg_sz
	arm64: dts: mediatek: mt8183: kenzo: Support second source touchscreen
	arm64: dts: mediatek: mt8183: willow: Support second source touchscreen
	RDMA/srp: Fix error handling in srp_add_port
	arm64: dts: mediatek: mt8195: Remove suspend-breaking reset from pcie1
	ARM: dts: stm32: Deduplicate serial aliases and chosen node for STM32MP15xx DHCOM SoM
	ARM: dts: stm32: Swap USART3 and UART8 alias on STM32MP15xx DHCOM SoM
	memory: tegra20-emc: fix an OF node reference bug in tegra_emc_find_node_by_ram_code()
	arm64: dts: mediatek: mt8183-kukui-jacuzzi: Drop pp3300_panel voltage settings
	arm64: dts: qcom: msm8996-xiaomi-gemini: Fix LP5562 LED1 reg property
	arm64: dts: qcom: sa8775p: Update sleep_clk frequency
	arm64: defconfig: remove obsolete CONFIG_SM_DISPCC_8650
	arm64: dts: qcom: msm8996: Fix up USB3 interrupts
	arm64: dts: qcom: msm8994: Describe USB interrupts
	arm64: dts: qcom: sm7225-fairphone-fp4: Drop extra qcom,msm-id value
	arm64: dts: qcom: msm8916: correct sleep clock frequency
	arm64: dts: qcom: msm8939: correct sleep clock frequency
	arm64: dts: qcom: msm8994: correct sleep clock frequency
	arm64: dts: qcom: qcs404: correct sleep clock frequency
	arm64: dts: qcom: q[dr]u1000: correct sleep clock frequency
	arm64: dts: qcom: qrb4210-rb2: correct sleep clock frequency
	arm64: dts: qcom: sc7280: correct sleep clock frequency
	arm64: dts: qcom: sdx75: correct sleep clock frequency
	arm64: dts: qcom: sm4450: correct sleep clock frequency
	arm64: dts: qcom: sm6125: correct sleep clock frequency
	arm64: dts: qcom: sm6375: correct sleep clock frequency
	arm64: dts: qcom: sm8250: correct sleep clock frequency
	arm64: dts: qcom: sm8350: correct sleep clock frequency
	arm64: dts: qcom: sm8450: correct sleep clock frequency
	arm64: dts: qcom: sm8550: correct sleep clock frequency
	arm64: dts: qcom: sm8650: correct sleep clock frequency
	arm64: dts: qcom: x1e80100: correct sleep clock frequency
	arm64: dts: qcom: sm8650: Fix CDSP context banks unit addresses
	ARM: dts: microchip: sama5d29_curiosity: Add no-1-8-v property to sdmmc0 node
	ARM: dts: microchip: sama5d27_wlsom1_ek: Add no-1-8-v property to sdmmc0 node
	arm64: dts: ti: k3-am62: Remove duplicate GICR reg
	arm64: dts: ti: k3-am62a: Remove duplicate GICR reg
	arm64: dts: rockchip: Fix sdmmc access on rk3308-rock-s0 v1.1 boards
	arm64: dts: allwinner: a64: explicitly assign clock parent for TCON0
	RDMA/bnxt_re: Fix to drop reference to the mmap entry in case of error
	RDMA/rtrs: Add missing deinit() call
	RDMA/hns: Clean up the legacy CONFIG_INFINIBAND_HNS
	ARM: omap1: Fix up the Retu IRQ on Nokia 770
	arm64: dts: qcom: qcm6490-shift-otter: remove invalid orientation-switch
	arm64: dts: qcom: sdm845-db845c-navigation-mezzanine: Convert mezzanine riser to dtso
	arm64: dts: qcom: sdm845-db845c-navigation-mezzanine: remove disabled ov7251 camera
	arm64: dts: qcom: sc7180-trogdor-quackingstick: add missing avee-supply
	arm64: dts: qcom: sc7180-trogdor-pompom: rename 5v-choke thermal zone
	arm64: dts: qcom: sc7180: change labels to lower-case
	arm64: dts: qcom: sc7180: fix psci power domain node names
	arm64: dts: qcom: sm8150-microsoft-surface-duo: fix typos in da7280 properties
	arm64: dts: qcom: sc8280xp: Fix up remoteproc register space sizes
	firmware: qcom: scm: Cleanup global '__scm' on probe failures
	arm64: dts: mediatek: mt7988: Add missing clock-div property for i2c
	dts: arm64: mediatek: mt8195: Remove MT8183 compatible for OVL
	arm64: dts: mediatek: add per-SoC compatibles for keypad nodes
	arm64: dts: qcom: sc8280xp: Fix interrupt type of camss interrupts
	arm64: dts: qcom: sdm845: Fix interrupt types of camss interrupts
	arm64: dts: qcom: sm8250: Fix interrupt types of camss interrupts
	arm64: dts: marvell: cn9131-cf-solidwan: fix cp1 comphy links
	ARM: dts: mediatek: mt7623: fix IR nodename
	arm64: dts: rockchip: fix num-channels property of wolfvision pf5 mic
	arm64: dts: ti: k3-am642-hummingboard-t: Convert overlay to board dts
	fbdev: omapfb: Fix an OF node leak in dss_of_port_get_parent_device()
	arm64: tegra: Fix DMA ID for SPI2
	arm64: dts: qcom: x1e80100-romulus: Update firmware nodes
	i3c: dw: Fix use-after-free in dw_i3c_master driver due to race condition
	RDMA/mlx5: Fix indirect mkey ODP page count
	of: property: Avoiding using uninitialized variable @imaplen in parse_interrupt_map()
	of: reserved-memory: Do not make kmemleak ignore freed address
	efi: sysfb_efi: fix W=1 warnings when EFI is not set
	RDMA/cxgb4: Notify rdma stack for IB_EVENT_QP_LAST_WQE_REACHED event
	RDMA/rxe: Fix the warning "__rxe_cleanup+0x12c/0x170 [rdma_rxe]"
	iommu: iommufd: fix WARNING in iommufd_device_unbind
	iommufd/iova_bitmap: Fix shift-out-of-bounds in iova_bitmap_offset_to_index()
	spi: omap2-mcspi: Correctly handle devm_clk_get_optional() errors
	of: reserved_mem: Restructure how the reserved memory regions are processed
	of/fdt: Restore possibility to use both ACPI and FDT from bootloader
	media: rc: iguanair: handle timeouts
	media: lmedm04: Handle errors for lme2510_int_read
	PCI: endpoint: Destroy the EPC device in devm_pci_epc_destroy()
	remoteproc: mtk_scp: Only populate devices for SCP cores
	media: marvell: Add check for clk_enable()
	media: i2c: imx290: Register 0x3011 varies between imx327 and imx290
	media: i2c: imx412: Add missing newline to prints
	media: i2c: ov9282: Correct the exposure offset
	media: mipi-csis: Add check for clk_enable()
	media: camif-core: Add check for clk_enable()
	media: uvcvideo: Propagate buf->error to userspace
	mtd: rawnand: brcmnand: fix status read of brcmnand_waitfunc
	mtd: hyperbus: hbmc-am654: fix an OF node reference leak
	media: nxp: imx8-isi: fix v4l2-compliance test errors
	watchdog: rti_wdt: Fix an OF node leak in rti_wdt_probe()
	staging: media: imx: fix OF node leak in imx_media_add_of_subdevs()
	media: dvb-usb-v2: af9035: fix ISO C90 compilation error on af9035_i2c_master_xfer
	PCI: rcar-ep: Fix incorrect variable used when calling devm_request_mem_region()
	PCI: imx6: Configure PHY based on Root Complex or Endpoint mode
	PCI: imx6: Skip controller_id generation logic for i.MX7D
	PCI: imx6: Deassert apps_reset in imx_pcie_deassert_core_reset()
	PCI: imx6: Add missing reference clock disable logic
	PCI: qcom: Update ICC and OPP values after Link Up event
	PCI: dwc: Always stop link in the dw_pcie_suspend_noirq
	PCI: endpoint: pci-epf-test: Set dma_chan_rx pointer to NULL on error
	PCI: endpoint: pci-epf-test: Fix check for DMA MEMCPY test
	PCI: microchip: Add support for using either Root Port 1 or 2
	PCI: microchip: Set inbound address translation for coherent or non-coherent mode
	scsi: mpt3sas: Set ioc->manu_pg11.EEDPTagMode directly to 1
	scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails
	scsi: mpi3mr: Fix possible crash when setting up bsg fails
	firewire: test: Fix potential null dereference in firewire kunit test
	erofs: get rid of erofs_{find,insert}_workgroup
	erofs: move erofs_workgroup operations into zdata.c
	erofs: sunset `struct erofs_workgroup`
	erofs: fix potential return value overflow of z_erofs_shrink_scan()
	ocfs2: mark dquot as inactive if failed to start trans while releasing dquot
	nilfs2: do not force clear folio if buffer is referenced
	nilfs2: protect access to buffers with no active references
	nilfs2: handle errors that nilfs_prepare_chunk() may return
	module: Extend the preempt disabled section in dereference_symbol_descriptor().
	module: Don't fail module loading when setting ro_after_init section RO failed
	driver core: class: Fix wild pointer dereferences in API class_dev_iter_next()
	tty: mips_ejtag_fdc: fix one more u8 warning
	serial: 8250: Adjust the timeout for FIFO mode
	nfs: fix incorrect error handling in LOCALIO
	NFSv4.2: fix COPY_NOTIFY xdr buf size calculation
	NFSv4.2: mark OFFLOAD_CANCEL MOVEABLE
	LoongArch: Fix warnings during S3 suspend
	tools/bootconfig: Fix the wrong format specifier
	xfrm: replay: Fix the update of replay_esn->oseq_hi for GSO
	xfrm: Add support for per cpu xfrm state handling.
	xfrm: Cache used outbound xfrm states at the policy.
	xfrm: Add an inbound percpu state cache.
	xfrm: state: fix out-of-bounds read during lookup
	dmaengine: ti: edma: fix OF node reference leaks in edma_driver
	xfrm: delete intermediate secpath entry in packet offload mode
	rtc: tps6594: Fix integer overflow on 32bit systems
	rtc: pcf85063: fix potential OOB write in PCF85063 NVMEM read
	rtc: loongson: clear TOY_MATCH0_REG in loongson_rtc_isr()
	ubifs: skip dumping tnc tree when zroot is null
	regulator: core: Add missing newline character
	net: airoha: Fix wrong GDM4 register definition
	net: hns3: fix oops when unload drivers paralleling
	gpio: mxc: remove dead code after switch to DT-only
	net: phy: marvell-88q2xxx: Fix temperature measurement with reset-gpios
	net: fec: implement TSO descriptor cleanup
	ipmr: do not call mr_mfc_uses_dev() for unres entries
	PM: hibernate: Add error handling for syscore_suspend()
	perf trace: Fix BPF loading failure (-E2BIG)
	xfrm: Don't disable preemption while looking up cache state.
	idpf: add read memory barrier when checking descriptor done bit
	idpf: fix transaction timeouts on reset
	idpf: Acquire the lock before accessing the xn->salt
	idpf: convert workqueues to unbound
	ice: fix ice_parser_rt::bst_key array size
	ice: rework of dump serdes equalizer values feature
	ice: extend dump serdes equalizer values feature
	ice: remove invalid parameter of equalizer
	iavf: allow changing VLAN state without calling PF
	s390/mm: Allow large pages for KASAN shadow mapping
	net/ncsi: use dev_set_mac_address() for Get MC MAC Address handling
	net: rose: fix timer races against user threads
	net: netdevsim: try to close UDP port harness races
	tools: ynl: c: correct reverse decode of empty attrs
	selftests: mptcp: extend CFLAGS to keep options from environment
	selftests: net/{lib,openvswitch}: extend CFLAGS to keep options from environment
	rxrpc, afs: Fix peer hash locking vs RCU callback
	vxlan: Fix uninit-value in vxlan_vnifilter_dump()
	net: davicom: fix UAF in dm9000_drv_remove
	ptp: Properly handle compat ioctls
	net: ethtool: only allow set_rxnfc with rss + ring_cookie if driver opts in
	ethtool: Fix set RXNFC command with symmetric RSS hash
	net: stmmac: Limit the number of MTL queues to hardware capability
	net: stmmac: Limit FIFO size by hardware capability
	s390/sclp: Initialize sclp subsystem via arch_cpu_finalize_init()
	perf trace: Fix runtime error of index out of bounds
	perf test: Skip syscall enum test if no landlock syscall
	Bluetooth: btusb: mediatek: Add locks for usb_driver_claim_interface()
	Bluetooth: btnxpuart: Fix glitches seen in dual A2DP streaming
	vsock: Allow retrying on connect() failure
	bgmac: reduce max frame size to support just MTU 1500
	tcp: correct handling of extreme memory squeeze
	net: xdp: Disallow attaching device-bound programs in generic mode
	net: ravb: Fix missing rtnl lock in suspend/resume path
	net: sh_eth: Fix missing rtnl lock in suspend/resume path
	net: hsr: fix fill_frame_info() regression vs VLAN packets
	genksyms: fix memory leak when the same symbol is added from source
	genksyms: fix memory leak when the same symbol is read from *.symref file
	hostfs: fix string handling in __dentry_name()
	tools/power turbostat: Allow using cpu device in perf counters on hybrid platforms
	tools/power turbostat: Fix PMT mmaped file size rounding
	RISC-V: Mark riscv_v_init() as __init
	ASoC: rockchip: i2s_tdm: Re-add the set_sysclk callback
	io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock()
	ASoC: amd: acp: Fix possible deadlock
	tools/power turbostat: Fix forked child affinity regression
	cifs: Validate EAs for WSL reparse points
	cifs: Fix getting and setting SACLs over SMB1
	kconfig: fix file name in warnings when loading KCONFIG_DEFCONFIG_LIST
	kconfig: fix memory leak in sym_warn_unmet_dep()
	hexagon: fix using plain integer as NULL pointer warning in cmpxchg
	hexagon: Fix unbalanced spinlock in die()
	f2fs: Introduce linear search for dentries
	md/md-bitmap: factor behind write counters out from bitmap_{start/end}write()
	md/md-bitmap: remove the last parameter for bimtap_ops->endwrite()
	md: add a new callback pers->bitmap_sector()
	md/raid5: implement pers->bitmap_sector()
	md/md-bitmap: move bitmap_{start, end}write to md upper layer
	Revert "SUNRPC: Reduce thread wake-up rate when receiving large RPC messages"
	kbuild: switch from lz4c to lz4 for compression
	netfilter: nf_tables: reject mismatching sum of field_len with set key length
	drm/amd/display: Reduce accessing remote DPCD overhead
	selftests/rseq: Fix handling of glibc without rseq support
	selftests/ftrace: Fix to use remount when testing mount GID option
	ktest.pl: Check kernelrelease return in get_version
	xfs: check for dead buffers in xfs_buf_find_insert
	xfs: don't shut down the filesystem for media failures beyond end of log
	ALSA: usb-audio: Add delay quirk for iBasso DC07 Pro
	net: usb: rtl8150: enable basic endpoint checking
	usb: xhci: Fix NULL pointer dereference on certain command aborts
	drivers/card_reader/rtsx_usb: Restore interrupt based detection
	usb: gadget: f_tcm: Fix Get/SetInterface return value
	usb: dwc3-am62: Fix an OF node leak in phy_syscon_pll_refclk()
	usb: dwc3: core: Defer the probe until USB power supply ready
	usb: dwc3: Skip resume if pm_runtime_set_active() fails
	usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE
	usb: typec: tcpci: Prevent Sink disconnection before vPpsShutdown in SPR PPS
	clk: qcom: gcc-x1e80100: Do not turn off usb_2 controller GDSC
	mptcp: consolidate suboption status
	mptcp: pm: only set fullmesh for subflow endp
	mptcp: handle fastopen disconnect correctly
	mptcp: blackhole only if 1st SYN retrans w/o MPC is accepted
	RDMA/mlx5: Fix implicit ODP use after free
	remoteproc: core: Fix ida_free call while not allocated
	media: uvcvideo: Fix double free in error path
	pps: Fix a use-after-free
	usb: gadget: f_tcm: Don't free command immediately
	staging: media: max96712: fix kernel oops when removing module
	media: imx-jpeg: Fix potential error pointer dereference in detach_pm()
	powerpc/pseries/iommu: Don't unset window if it was never set
	md/md-bitmap: Synchronize bitmap_get_stats() with bitmap lifetime
	btrfs: output the reason for open_ctree() failure
	of: reserved-memory: Warn for missing static reserved memory regions
	dma-mapping: save base/size instead of pointer to shared DMA pool
	xfrm: Add error handling when nla_put_u32() returns an error
	xfrm: Fix acquire state insertion.
	ethtool: Fix access to uninitialized fields in set RXNFC command
	Revert "s390/mm: Allow large pages for KASAN shadow mapping"
	selftests/bpf: Add test to verify tailcall and freplace restrictions
	ASoC: da7213: Initialize the mutex
	s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS
	drm/amd/display: Add hubp cache reset when powergating
	KVM: x86: Plumb in the vCPU to kvm_x86_ops.hwapic_isr_update()
	memcg: fix soft lockup in the OOM process
	LoongArch: Change 8 to 14 for LOONGARCH_MAX_{BRP,WRP}
	btrfs: do proper folio cleanup when run_delalloc_nocow() failed
	ethtool: ntuple: fix rss + ring_cookie check
	Linux 6.12.13

Change-Id: I0b4278d2911ea7c72e068418ed56d1514b393980
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2025-02-10 07:46:27 -08:00
Masahiro Yamada
889433a2ed module: Convert default symbol namespace to string literal
[ Upstream commit ceb8bf2ceaa77fe222fe8fe32cb7789c9099ddf1 ]

Commit cdd30ebb1b9f ("module: Convert symbol namespace to string
literal") only converted MODULE_IMPORT_NS() and EXPORT_SYMBOL_NS(),
leaving DEFAULT_SYMBOL_NAMESPACE as a macro expansion.

This commit converts DEFAULT_SYMBOL_NAMESPACE in the same way to avoid
annoyance for the default namespace as well.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stable-dep-of: 2505f87eb3af ("hwmon: (nct6775): Actually make use of the HWMON_NCT6775 symbol namespace")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-02-08 09:57:05 +01:00
Sami Tolvanen
bbbb64a40f FROMGIT: export: Add __gendwarfksyms_ptr_ references to exported symbols
With gendwarfksyms, we need each TU where the EXPORT_SYMBOL() macro
is used to also contain DWARF type information for the symbols it
exports.  However, as a TU can also export external symbols and
compilers may choose not to emit debugging information for symbols not
defined in the current TU, the missing types will result in missing
symbol versions. Stand-alone assembly code also doesn't contain type
information for exported symbols, so we need to compile a temporary
object file with asm-prototypes.h instead, and similarly need to
ensure the DWARF in the temporary object file contains the necessary
types.

To always emit type information for external exports, add explicit
__gendwarfksyms_ptr_<symbol> references to them in EXPORT_SYMBOL().
gendwarfksyms will use the type information for __gendwarfksyms_ptr_*
if needed. Discard the pointers from the final binary to avoid further
bloat.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit d7476f24c9aa93d02ef3fd8d587a6114387b7667
 https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
Bug: 347787665
Signed-off-by: Matthew Maurer <mmaurer@google.com>

Change-Id: Iee2f513ee109b7a1d55104b6a6bc47ed260cf26f
Signed-off-by: Matthew Maurer <mmaurer@google.com>
2025-01-14 00:20:38 -08:00
Masahiro Yamada
5b20755b77 init: move THIS_MODULE from <linux/export.h> to <linux/init.h>
Commit f50169324d ("module.h: split out the EXPORT_SYMBOL into
export.h") appropriately separated EXPORT_SYMBOL into <linux/export.h>
because modules and EXPORT_SYMBOL are orthogonal; modules are symbol
consumers, while EXPORT_SYMBOL are used by symbol providers, which
may not be necessarily a module.

However, that commit also relocated THIS_MODULE. As explained in the
commit description, the intention was to define THIS_MODULE in a
lightweight header, but I do not believe <linux/export.h> was the
best location because EXPORT_SYMBOL and THIS_MODULE are unrelated.

Move it to another lightweight header, <linux/init.h>. The reason for
choosing <linux/init.h> is to make <linux/moduleparam.h> self-contained
without relying on <linux/linkage.h> incorrectly including
<linux/export.h>.

With this adjustment, the role of <linux/export.h> becomes clearer as
it only defines EXPORT_SYMBOL.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2023-12-10 15:32:48 +09:00
Masahiro Yamada
481461f510 linux/export.h: make <linux/export.h> independent of CONFIG_MODULES
Currently, all files with EXPORT_SYMBOL() are rebuilt when CONFIG_MODULES
is flipped due to <linux/export.h> depending on CONFIG_MODULES.

Now that modpost can make a final decision about export symbols,
<linux/export.h> does not need to make EXPORT_SYMBOL() no-op.
Instead, modpost can skip emitting KSYMTAB when CONFIG_MODULES is unset.

This commit will reduce the number of recompilation when CONFIG_MODULES
is toggled.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-07-25 00:59:32 +09:00
Masahiro Yamada
8ed7e33a68 linux/export.h: rename 'sec' argument to 'license'
Now, EXPORT_SYMBOL() is populated in two stages. In the first stage,
all of EXPORT_SYMBOL/EXPORT_SYMBOL_GPL go into the same section,
'.export_symbol'.

'sec' does not make sense any more. Rename it to 'license'.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
2023-06-22 21:21:06 +09:00
Masahiro Yamada
5e9e95cc91 kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion
When CONFIG_TRIM_UNUSED_KSYMS is enabled, Kbuild recursively traverses
the directory tree to determine which EXPORT_SYMBOL to trim. If an
EXPORT_SYMBOL turns out to be unused by anyone, Kbuild begins the
second traverse, where some source files are recompiled with their
EXPORT_SYMBOL() tuned into a no-op.

Linus stated negative opinions about this slowness in commits:

 - 5cf0fd591f ("Kbuild: disable TRIM_UNUSED_KSYMS option")
 - a555bdd0c5 ("Kbuild: enable TRIM_UNUSED_KSYMS again, with some guarding")

We can do this better now. The final data structures of EXPORT_SYMBOL
are generated by the modpost stage, so modpost can selectively emit
KSYMTAB entries that are really used by modules.

Commit f73edc8951 ("kbuild: unify two modpost invocations") is another
ground-work to do this in a one-pass algorithm. With the list of modules,
modpost sets sym->used if it is used by a module. modpost emits KSYMTAB
only for symbols with sym->used==true.

BTW, Nicolas explained why the trimming was implemented with recursion:

  https://lore.kernel.org/all/2o2rpn97-79nq-p7s2-nq5-8p83391473r@syhkavp.arg/

Actually, we never achieved that level of optimization where the chain
reaction of trimming comes into play because:

 - CONFIG_LTO_CLANG cannot remove any unused symbols
 - CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is enabled only for vmlinux,
   but not modules

If deeper trimming is required, we need to revisit this, but I guess
that is unlikely to happen.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-06-22 21:21:06 +09:00
Masahiro Yamada
ddb5cdbafa kbuild: generate KSYMTAB entries by modpost
Commit 7b4537199a ("kbuild: link symbol CRCs at final link, removing
CONFIG_MODULE_REL_CRCS") made modpost output CRCs in the same way
whether the EXPORT_SYMBOL() is placed in *.c or *.S.

For further cleanups, this commit applies a similar approach to the
entire data structure of EXPORT_SYMBOL().

The EXPORT_SYMBOL() compilation is split into two stages.

When a source file is compiled, EXPORT_SYMBOL() will be converted into
a dummy symbol in the .export_symbol section.

For example,

    EXPORT_SYMBOL(foo);
    EXPORT_SYMBOL_NS_GPL(bar, BAR_NAMESPACE);

will be encoded into the following assembly code:

    .section ".export_symbol","a"
    __export_symbol_foo:
            .asciz ""                      /* license */
            .asciz ""                      /* name space */
            .balign 8
            .quad foo                      /* symbol reference */
    .previous

    .section ".export_symbol","a"
    __export_symbol_bar:
            .asciz "GPL"                   /* license */
            .asciz "BAR_NAMESPACE"         /* name space */
            .balign 8
            .quad bar                      /* symbol reference */
    .previous

They are mere markers to tell modpost the name, license, and namespace
of the symbols. They will be dropped from the final vmlinux and modules
because the *(.export_symbol) will go into /DISCARD/ in the linker script.

Then, modpost extracts all the information about EXPORT_SYMBOL() from the
.export_symbol section, and generates the final C code:

    KSYMTAB_FUNC(foo, "", "");
    KSYMTAB_FUNC(bar, "_gpl", "BAR_NAMESPACE");

KSYMTAB_FUNC() (or KSYMTAB_DATA() if it is data) is expanded to struct
kernel_symbol that will be linked to the vmlinux or a module.

With this change, EXPORT_SYMBOL() works in the same way for *.c and *.S
files, providing the following benefits.

[1] Deprecate EXPORT_DATA_SYMBOL()

In the old days, EXPORT_SYMBOL() was only available in C files. To export
a symbol in *.S, EXPORT_SYMBOL() was placed in a separate *.c file.
arch/arm/kernel/armksyms.c is one example written in the classic manner.

Commit 22823ab419 ("EXPORT_SYMBOL() for asm") removed this limitation.
Since then, EXPORT_SYMBOL() can be placed close to the symbol definition
in *.S files. It was a nice improvement.

However, as that commit mentioned, you need to use EXPORT_DATA_SYMBOL()
for data objects on some architectures.

In the new approach, modpost checks symbol's type (STT_FUNC or not),
and outputs KSYMTAB_FUNC() or KSYMTAB_DATA() accordingly.

There are only two users of EXPORT_DATA_SYMBOL:

  EXPORT_DATA_SYMBOL_GPL(empty_zero_page)    (arch/ia64/kernel/head.S)
  EXPORT_DATA_SYMBOL(ia64_ivt)               (arch/ia64/kernel/ivt.S)

They are transformed as follows and output into .vmlinux.export.c

  KSYMTAB_DATA(empty_zero_page, "_gpl", "");
  KSYMTAB_DATA(ia64_ivt, "", "");

The other EXPORT_SYMBOL users in ia64 assembly are output as
KSYMTAB_FUNC().

EXPORT_DATA_SYMBOL() is now deprecated.

[2] merge <linux/export.h> and <asm-generic/export.h>

There are two similar header implementations:

  include/linux/export.h        for .c files
  include/asm-generic/export.h  for .S files

Ideally, the functionality should be consistent between them, but they
tend to diverge.

Commit 8651ec01da ("module: add support for symbol namespaces.") did
not support the namespace for *.S files.

This commit shifts the essential implementation part to C, which supports
EXPORT_SYMBOL_NS() for *.S files.

<asm/export.h> and <asm-generic/export.h> will remain as a wrapper of
<linux/export.h> for a while.

They will be removed after #include <asm/export.h> directives are all
replaced with #include <linux/export.h>.

[3] Implement CONFIG_TRIM_UNUSED_KSYMS in one-pass algorithm (by a later commit)

When CONFIG_TRIM_UNUSED_KSYMS is enabled, Kbuild recursively traverses
the directory tree to determine which EXPORT_SYMBOL to trim. If an
EXPORT_SYMBOL turns out to be unused by anyone, Kbuild begins the
second traverse, where some source files are recompiled with their
EXPORT_SYMBOL() tuned into a no-op.

We can do this better now; modpost can selectively emit KSYMTAB entries
that are really used by modules.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
2023-06-22 21:17:10 +09:00
Linus Torvalds
500a434fc5 Merge tag 'driver-core-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg KH:
 "Here is the set of driver core changes for 5.19-rc1.

  Lots of tiny driver core changes and cleanups happened this cycle, but
  the two major things are:

   - firmware_loader reorganization and additions including the ability
     to have XZ compressed firmware images and the ability for userspace
     to initiate the firmware load when it needs to, instead of being
     always initiated by the kernel. FPGA devices specifically want this
     ability to have their firmware changed over the lifetime of the
     system boot, and this allows them to work without having to come up
     with yet-another-custom-uapi interface for loading firmware for
     them.

   - physical location support added to sysfs so that devices that know
     this information, can tell userspace where they are located in a
     common way. Some ACPI devices already support this today, and more
     bus types should support this in the future.

  Smaller changes include:

   - driver_override api cleanups and fixes

   - error path cleanups and fixes

   - get_abi script fixes

   - deferred probe timeout changes.

  It's that last change that I'm the most worried about. It has been
  reported to cause boot problems for a number of systems, and I have a
  tested patch series that resolves this issue. But I didn't get it
  merged into my tree before 5.18-final came out, so it has not gotten
  any linux-next testing.

  I'll send the fixup patches (there are 2) as a follow-on series to this
  pull request.

  All have been tested in linux-next for weeks, with no reported issues
  other than the above-mentioned boot time-outs"

* tag 'driver-core-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (55 commits)
  driver core: fix deadlock in __device_attach
  kernfs: Separate kernfs_pr_cont_buf and rename_lock.
  topology: Remove unused cpu_cluster_mask()
  driver core: Extend deferred probe timeout on driver registration
  MAINTAINERS: add Russ Weight as a firmware loader maintainer
  driver: base: fix UAF when driver_attach failed
  test_firmware: fix end of loop test in upload_read_show()
  driver core: location: Add "back" as a possible output for panel
  driver core: location: Free struct acpi_pld_info *pld
  driver core: Add "*" wildcard support to driver_async_probe cmdline param
  driver core: location: Check for allocations failure
  arch_topology: Trace the update thermal pressure
  kernfs: Rename kernfs_put_open_node to kernfs_unlink_open_file.
  export: fix string handling of namespace in EXPORT_SYMBOL_NS
  rpmsg: use local 'dev' variable
  rpmsg: Fix calling device_lock() on non-initialized device
  firmware_loader: describe 'module' parameter of firmware_upload_register()
  firmware_loader: Move definitions from sysfs_upload.h to sysfs.h
  firmware_loader: Fix configs for sysfs split
  selftests: firmware: Add firmware upload selftests
  ...
2022-06-03 11:48:47 -07:00
Masahiro Yamada
7b4537199a kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS
include/{linux,asm-generic}/export.h defines a weak symbol, __crc_*
as a placeholder.

Genksyms writes the version CRCs into the linker script, which will be
used for filling the __crc_* symbols. The linker script format depends
on CONFIG_MODULE_REL_CRCS. If it is enabled, __crc_* holds the offset
to the reference of CRC.

It is time to get rid of this complexity.

Now that modpost parses text files (.*.cmd) to collect all the CRCs,
it can generate C code that will be linked to the vmlinux or modules.

Generate a new C file, .vmlinux.export.c, which contains the CRCs of
symbols exported by vmlinux. It is compiled and linked to vmlinux in
scripts/link-vmlinux.sh.

Put the CRCs of symbols exported by modules into the existing *.mod.c
files. No additional build step is needed for modules. As before,
*.mod.c are compiled and linked to *.ko in scripts/Makefile.modfinal.

No linker magic is used here. The new C implementation works in the
same way, whether CONFIG_RELOCATABLE is enabled or not.
CONFIG_MODULE_REL_CRCS is no longer needed.

Previously, Kbuild invoked additional $(LD) to update the CRCs in
objects, but this step is unneeded too.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nicolas Schier <nicolas@fjasle.eu>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
2022-05-24 16:33:20 +09:00
Greg Kroah-Hartman
d143b9db80 export: fix string handling of namespace in EXPORT_SYMBOL_NS
Commit c3a6cf19e6 ("export: avoid code duplication in
include/linux/export.h") broke the ability for a defined string to be
used as a namespace value.  Fix this up by using stringify to properly
encode the namespace name.

Fixes: c3a6cf19e6 ("export: avoid code duplication in include/linux/export.h")
Cc: Miroslav Benes <mbenes@suse.cz>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Cc: Matthias Maennich <maennich@google.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20220427090442.2105905-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-06 09:52:41 +02:00
Quentin Perret
e1327a1277 export: Make CRCs robust to symbol trimming
The CRC calculation done by genksyms is triggered when the parser hits
EXPORT_SYMBOL*() macros. At this point, genksyms recursively expands the
types, and uses that as the input for the CRC calculation. In the case
of forward-declared structs, the type expands to 'UNKNOWN'. Next, the
result of the expansion of each type is cached, and is re-used when/if
the same type is seen again for another exported symbol in the file.

Unfortunately, this can cause CRC 'stability' issues when a struct
definition becomes visible in the middle of a C file. For example, let's
assume code with the following pattern:

    struct foo;

    int bar(struct foo *arg)
    {
	/* Do work ... */
    }
    EXPORT_SYMBOL_GPL(bar);

    /* This contains struct foo's definition */
    #include "foo.h"

    int baz(struct foo *arg)
    {
	/* Do more work ... */
    }
    EXPORT_SYMBOL_GPL(baz);

Here, baz's CRC will be computed using the expansion of struct foo that
was cached after bar's CRC calculation ('UNKOWN' here). But if
EXPORT_SYMBOL_GPL(bar) is removed from the file (because of e.g. symbol
trimming using CONFIG_TRIM_UNUSED_KSYMS), struct foo will be expanded
late, during baz's CRC calculation, which now has visibility over the
full struct definition, hence resulting in a different CRC for baz.

This can cause annoying issues for distro kernel (such as the Android
Generic Kernel Image) which use CONFIG_UNUSED_KSYMS_WHITELIST. Indeed,
as per the above, adding a symbol to the whitelist can change the CRC of
symbols that are already kept exported. As such, modules built against a
kernel with a trimmed ABI may not load against the same kernel built
with an extended whitelist, even though they are still strictly binary
compatible. While rebuilding the modules would obviously solve the
issue, I believe this classifies as an odd genksyms corner case, and it
gets in the way of kernel updates in the GKI context.

To work around the issue, make sure to keep issuing the
__GENKSYMS_EXPORT_SYMBOL macros for all trimmed symbols, hence making
the genksyms parsing insensitive to symbol trimming.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20210408180105.2496212-1-qperret@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 13:15:39 +02:00
Christoph Hellwig
367948220f module: remove EXPORT_UNUSED_SYMBOL*
EXPORT_UNUSED_SYMBOL* is not actually used anywhere.  Remove the
unused functionality as we generally just remove unused code anyway.

Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2021-02-08 12:28:07 +01:00
Christoph Hellwig
f1c3d73e97 module: remove EXPORT_SYMBOL_GPL_FUTURE
As far as I can tell this has never been used at all, and certainly
not any time recently.

Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2021-02-08 12:28:02 +01:00
Joe Perches
33def8498f treewide: Convert macro and uses of __section(foo) to __section("foo")
Use a more generic form for __section that requires quotes to avoid
complications with clang and gcc differences.

Remove the quote operator # from compiler_attributes.h __section macro.

Convert all unquoted __section(foo) uses to quoted __section("foo").
Also convert __attribute__((section("foo"))) uses to __section("foo")
even if the __attribute__ has multiple list entry forms.

Conversion done using the script at:

    https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/2-convert_section.pl

Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@gooogle.com>
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-10-25 14:51:49 -07:00
Nick Desaulniers
4d6fb34acb export.h: fix section name for CONFIG_TRIM_UNUSED_KSYMS for Clang
When enabling CONFIG_TRIM_UNUSED_KSYMS, the linker will warn about the
orphan sections:

(".discard.ksym") is being placed in '".discard.ksym"'

repeatedly when linking vmlinux.  This is because the stringification
operator, `#`, in the preprocessor escapes strings.  GCC and Clang differ
in how they treat section names that contain \".

The portable solution is to not use a string literal with the preprocessor
stringification operator.

Fixes: commit bbda5ec671 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS")
Reported-by: kbuild test robot <lkp@intel.com>
Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Matthias Maennich <maennich@google.com>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Will Deacon <will@kernel.org>
Link: https://bugs.llvm.org/show_bug.cgi?id=42950
Link: https://github.com/ClangBuiltLinux/linux/issues/1166
Link: https://lkml.kernel.org/r/20200929190701.398762-1-ndesaulniers@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-10-13 18:38:26 -07:00
Jessica Yu
ce2b617ce8 export.h: reduce __ksymtab_strings string duplication by using "MS" section flags
Commit c3a6cf19e6 ("export: avoid code duplication in
include/linux/export.h") refactors export.h quite nicely, but introduces
a slight increase in memory usage due to using the empty string ""
instead of NULL to indicate that an exported symbol has no namespace. As
mentioned in that commit, this meant an increase of 1 byte per exported
symbol without a namespace. For example, if a kernel configuration has
about 10k exported symbols, this would mean that the size of
__ksymtab_strings would increase by roughly 10kB.

We can alleviate this situation by utilizing the SHF_MERGE and
SHF_STRING section flags. SHF_MERGE|SHF_STRING indicate to the linker
that the data in the section are null-terminated strings that can be
merged to eliminate duplication. More specifically, from the binutils
documentation - "for sections with both M and S, a string which is a
suffix of a larger string is considered a duplicate. Thus "def" will be
merged with "abcdef"; A reference to the first "def" will be changed to
a reference to "abcdef"+3". Thus, all the empty strings would be merged
as well as any strings that can be merged according to the cited method
above. For example, "memset" and "__memset" would be merged to just
"__memset" in __ksymtab_strings.

As of v5.4-rc5, the following statistics were gathered with x86
defconfig with approximately 10.7k exported symbols.

Size of __ksymtab_strings in vmlinux:
-------------------------------------
v5.4-rc5: 213834 bytes
v5.4-rc5 with commit c3a6cf19e6: 224455 bytes
v5.4-rc5 with this patch: 205759 bytes

So, we already see memory savings of ~8kB compared to vanilla -rc5 and
savings of nearly 18.7kB compared to -rc5 with commit c3a6cf19e6 on top.

Unfortunately, as of this writing, strings will not get deduplicated for
kernel modules, as ld does not do the deduplication for
SHF_MERGE|SHF_STRINGS sections for relocatable files (ld -r), which
kernel modules are. A patch for ld is currently being worked on to
hopefully allow for string deduplication in relocatable files in the
future.

Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-12-16 10:35:33 +01:00
Linus Torvalds
0f13741624 Merge tag 'modules-for-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux
Pull modules updates from Jessica Yu:
 "Summary of modules changes for the 5.5 merge window:

   - Refactor include/linux/export.h and remove code duplication between
     EXPORT_SYMBOL and EXPORT_SYMBOL_NS to make it more readable.

     The most notable change is that no namespace is represented by an
     empty string "" rather than NULL.

   - Fix a module load/unload race where waiter(s) trying to load the
     same module weren't being woken up when a module finally goes away"

* tag 'modules-for-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
  kernel/module.c: wakeup processes in module_wq on module unload
  moduleparam: fix parameter description mismatch
  export: avoid code duplication in include/linux/export.h
2019-12-05 12:27:16 -08:00
Masahiro Yamada
bf49d9dd6f export,module: add SPDX GPL-2.0 license identifier to headers with no license
Commit b24413180f ("License cleanup: add SPDX GPL-2.0 license
identifier to files with no license") took care of a lot of files
without any license information.

These headers were not processed by the tool perhaps because they
contain "GPL" in the code.

I do not see any license boilerplate in them, so they fall back to
GPL version 2 only, which is the project default.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Link: https://lore.kernel.org/r/20191018045053.8424-1-yamada.masahiro@socionext.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-14 11:36:53 +08:00
Masahiro Yamada
c3a6cf19e6 export: avoid code duplication in include/linux/export.h
include/linux/export.h has lots of code duplication between
EXPORT_SYMBOL and EXPORT_SYMBOL_NS.

To improve the maintainability and readability, unify the
implementation.

When the symbol has no namespace, pass the empty string "" to
the 'ns' parameter.

The drawback of this change is, it grows the code size.
When the symbol has no namespace, sym->namespace was previously
NULL, but it is now an empty string "". So, it increases 1 byte
for every no namespace EXPORT_SYMBOL.

A typical kernel configuration has 10K exported symbols, so it
increases 10KB in rough estimation.

I did not come up with a good idea to refactor it without increasing
the code size.

I am not sure how big a deal it is, but at least include/linux/export.h
looks nicer.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[maennich: rebase on top of 3 fixes for the namespace feature]
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-10-28 16:38:26 +01:00
Matthias Maennich
6992320843 symbol namespaces: revert to previous __ksymtab name scheme
The introduction of Symbol Namespaces changed the naming schema of the
__ksymtab entries from __kysmtab__symbol to __ksymtab_NAMESPACE.symbol.

That caused some breakages in tools that depend on the name layout in
either the binaries(vmlinux,*.ko) or in System.map. E.g. kmod's depmod
would not be able to read System.map without a patch to support symbol
namespaces. A warning reported by depmod for namespaced symbols would
look like

  depmod: WARNING: [...]/uas.ko needs unknown symbol usb_stor_adjust_quirks

In order to address this issue, revert to the original naming scheme and
rather read the __kstrtabns_<symbol> entries and their corresponding
values from __ksymtab_strings to update the namespace values for
symbols. After having read all symbols and handled them in
handle_modversions(), the symbols are created. In a second pass, read
the __kstrtabns_ entries and update the namespaces accordingly.

Fixes: 8651ec01da ("module: add support for symbol namespaces.")
Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Will Deacon <will@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-10-18 15:32:52 +02:00
Masahiro Yamada
fa6643cdc5 module: rename __kstrtab_ns_* to __kstrtabns_* to avoid symbol conflict
The module namespace produces __strtab_ns_<sym> symbols to store
namespace strings, but it does not guarantee the name uniqueness.
This is a potential problem because we have exported symbols starting
with "ns_".

For example, kernel/capability.c exports the following symbols:

  EXPORT_SYMBOL(ns_capable);
  EXPORT_SYMBOL(capable);

Assume a situation where those are converted as follows:

  EXPORT_SYMBOL_NS(ns_capable, some_namespace);
  EXPORT_SYMBOL_NS(capable, some_namespace);

The former expands to "__kstrtab_ns_capable" and "__kstrtab_ns_ns_capable",
and the latter to "__kstrtab_capable" and "__kstrtab_ns_capable".
Then, we have the duplicated "__kstrtab_ns_capable".

To ensure the uniqueness, rename "__kstrtab_ns_*" to "__kstrtabns_*".

Reviewed-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-10-07 18:25:06 +02:00
Masahiro Yamada
bf70b0503a module: swap the order of symbol.namespace
Currently, EXPORT_SYMBOL_NS(_GPL) constructs the kernel symbol as
follows:

  __ksymtab_SYMBOL.NAMESPACE

The sym_extract_namespace() in modpost allocates memory for the part
SYMBOL.NAMESPACE when '.' is contained. One problem is that the pointer
returned by strdup() is lost because the symbol name will be copied to
malloc'ed memory by alloc_symbol(). No one will keep track of the
pointer of strdup'ed memory.

sym->namespace still points to the NAMESPACE part. So, you can free it
with complicated code like this:

   free(sym->namespace - strlen(sym->name) - 1);

It complicates memory free.

To fix it elegantly, I swapped the order of the symbol and the
namespace as follows:

  __ksymtab_NAMESPACE.SYMBOL

then, simplified sym_extract_namespace() so that it allocates memory
only for the NAMESPACE part.

I prefer this order because it is intuitive and also matches to major
languages. For example, NAMESPACE::NAME in C++, MODULE.NAME in Python.

Reviewed-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-10-07 18:24:48 +02:00
Linus Torvalds
e070355664 Merge tag 'modules-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux
Pull modules updates from Jessica Yu:
 "The main bulk of this pull request introduces a new exported symbol
  namespaces feature. The number of exported symbols is increasingly
  growing with each release (we're at about 31k exports as of 5.3-rc7)
  and we currently have no way of visualizing how these symbols are
  "clustered" or making sense of this huge export surface.

  Namespacing exported symbols allows kernel developers to more
  explicitly partition and categorize exported symbols, as well as more
  easily limiting the availability of namespaced symbols to other parts
  of the kernel. For starters, we have introduced the USB_STORAGE
  namespace to demonstrate the API's usage. I have briefly summarized
  the feature and its main motivations in the tag below.

  Summary:

   - Introduce exported symbol namespaces.

     This new feature allows subsystem maintainers to partition and
     categorize their exported symbols into explicit namespaces. Module
     authors are now required to import the namespaces they need.

     Some of the main motivations of this feature include: allowing
     kernel developers to better manage the export surface, allow
     subsystem maintainers to explicitly state that usage of some
     exported symbols should only be limited to certain users (think:
     inter-module or inter-driver symbols, debugging symbols, etc), as
     well as more easily limiting the availability of namespaced symbols
     to other parts of the kernel.

     With the module import requirement, it is also easier to spot the
     misuse of exported symbols during patch review.

     Two new macros are introduced: EXPORT_SYMBOL_NS() and
     EXPORT_SYMBOL_NS_GPL(). The API is thoroughly documented in
     Documentation/kbuild/namespaces.rst.

   - Some small code and kbuild cleanups here and there"

* tag 'modules-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
  module: Remove leftover '#undef' from export header
  module: remove unneeded casts in cmp_name()
  module: move CONFIG_UNUSED_SYMBOLS to the sub-menu of MODULES
  module: remove redundant 'depends on MODULES'
  module: Fix link failure due to invalid relocation on namespace offset
  usb-storage: export symbols in USB_STORAGE namespace
  usb-storage: remove single-use define for debugging
  docs: Add documentation for Symbol Namespaces
  scripts: Coccinelle script for namespace dependencies.
  modpost: add support for generating namespace dependencies
  export: allow definition default namespaces in Makefiles or sources
  module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
  modpost: add support for symbol namespaces
  module: add support for symbol namespaces.
  export: explicitly align struct kernel_symbol
  module: support reading multiple values per modinfo tag
2019-09-22 10:34:46 -07:00
Masahiro Yamada
69a94abb82 export.h, genksyms: do not make genksyms calculate CRC of trimmed symbols
Arnd Bergmann reported false-positive modpost warnings detected by his
randconfig testing of linux-next.

Actually, this happens under the combination of CONFIG_MODVERSIONS
and CONFIG_TRIM_UNUSED_KSYMS since commit 15bfc2348d ("modpost:
check for static EXPORT_SYMBOL* functions").

For example, arch/arm/config/multi_v7_defconfig + CONFIG_MODVERSIONS
+ CONFIG_TRIM_UNUSED_KSYMS produces the following false-positives:

WARNING: "__lshrdi3" [vmlinux] is a static (unknown)
WARNING: "__ashrdi3" [vmlinux] is a static (unknown)
WARNING: "__aeabi_lasr" [vmlinux] is a static (unknown)
WARNING: "__aeabi_llsr" [vmlinux] is a static (unknown)
WARNING: "ftrace_set_clr_event" [vmlinux] is a static (unknown)
WARNING: "__muldi3" [vmlinux] is a static (unknown)
WARNING: "__aeabi_ulcmp" [vmlinux] is a static (unknown)
WARNING: "__ucmpdi2" [vmlinux] is a static (unknown)
WARNING: "__aeabi_lmul" [vmlinux] is a static (unknown)
WARNING: "__bswapsi2" [vmlinux] is a static (unknown)
WARNING: "__bswapdi2" [vmlinux] is a static (unknown)
WARNING: "__ashldi3" [vmlinux] is a static (unknown)
WARNING: "__aeabi_llsl" [vmlinux] is a static (unknown)

The root cause of the problem is not in the modpost, but in the
implementation of CONFIG_TRIM_UNUSED_KSYMS.

If there is at least one untrimmed symbol in the file, genksyms is
invoked to calculate CRC of *all* the exported symbols in that file
even if some of them have been trimmed due to no caller existing.

As a result, .tmp_*.ver files contain CRC of trimmed symbols, thus
unneeded, orphan __crc* symbols are added to objects. It had been
harmless until recently.

With commit 15bfc2348d ("modpost: check for static EXPORT_SYMBOL*
functions"), it is now harmful because the bogus __crc* symbols make
modpost call sym_update_crc() to add the symbols to the hash table,
but there is no one that clears the ->is_static member.

I gave Fixes to the first commit that uncovered the issue, but the
potential problem has long existed since commit f235541699
("export.h: allow for per-symbol configurable EXPORT_SYMBOL()").

Fixes: 15bfc2348d ("modpost: check for static EXPORT_SYMBOL* functions")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Arnd Bergmann <arnd@arndb.de>
2019-09-14 11:40:13 +09:00
Will Deacon
069e1c07c1 module: Fix link failure due to invalid relocation on namespace offset
Commit 8651ec01da ("module: add support for symbol namespaces.")
broke linking for arm64 defconfig:

  | lib/crypto/arc4.o: In function `__ksymtab_arc4_setkey':
  | arc4.c:(___ksymtab+arc4_setkey+0x8): undefined reference to `no symbol'
  | lib/crypto/arc4.o: In function `__ksymtab_arc4_crypt':
  | arc4.c:(___ksymtab+arc4_crypt+0x8): undefined reference to `no symbol'

This is because the dummy initialisation of the 'namespace_offset' field
in 'struct kernel_symbol' when using EXPORT_SYMBOL on architectures with
support for PREL32 locations uses an offset from an absolute address (0)
in an effort to trick 'offset_to_pointer' into behaving as a NOP,
allowing non-namespaced symbols to be treated in the same way as those
belonging to a namespace.

Unfortunately, place-relative relocations require a symbol reference
rather than an absolute value and, although x86 appears to get away with
this due to placing the kernel text at the top of the address space, it
almost certainly results in a runtime failure if the kernel is relocated
dynamically as a result of KASLR.

Rework 'namespace_offset' so that a value of 0, which cannot occur for a
valid namespaced symbol, indicates that the corresponding symbol does
not belong to a namespace.

Cc: Matthias Maennich <maennich@google.com>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Fixes: 8651ec01da ("module: add support for symbol namespaces.")
Reported-by: kbuild test robot <lkp@intel.com>
Tested-by: Matthias Maennich <maennich@google.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Matthias Maennich <maennich@google.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-09-11 18:53:30 +02:00
Masahiro Yamada
a0469f989f export.h: remove defined(__KERNEL__), which is no longer needed
The conditional, define(__KERNEL__), was added by commit f235541699
("export.h: allow for per-symbol configurable EXPORT_SYMBOL()").

It was needed at that time to avoid the build error of modpost
with CONFIG_TRIM_UNUSED_KSYMS=y.

Since commit b2c5cdcfd4 ("modpost: remove symbol prefix support"),
modpost no longer includes linux/export.h, thus the define(__KERNEL__)
is unneeded.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
2019-09-10 23:51:05 +09:00
Matthias Maennich
8e2adc6a00 export: allow definition default namespaces in Makefiles or sources
To avoid excessive usage of EXPORT_SYMBOL_NS(sym, MY_NAMESPACE), where
MY_NAMESPACE will always be the namespace we are exporting to, allow
exporting all definitions of EXPORT_SYMBOL() and friends by defining
DEFAULT_SYMBOL_NAMESPACE.

For example, to export all symbols defined in usb-common into the
namespace USB_COMMON, add a line like this to drivers/usb/common/Makefile:

  ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=USB_COMMON

That is equivalent to changing all EXPORT_SYMBOL(sym) definitions to
EXPORT_SYMBOL_NS(sym, USB_COMMON). Subsequently all symbol namespaces
functionality will apply.

Another way of making use of this feature is to define the namespace
within source or header files similar to how TRACE_SYSTEM defines are
used:
  #undef DEFAULT_SYMBOL_NAMESPACE
  #define DEFAULT_SYMBOL_NAMESPACE USB_COMMON

Please note that, as opposed to TRACE_SYSTEM, DEFAULT_SYMBOL_NAMESPACE
has to be defined before including include/linux/export.h.

If DEFAULT_SYMBOL_NAMESPACE is defined, a symbol can still be exported
to another namespace by using EXPORT_SYMBOL_NS() and friends with
explicitly specifying the namespace.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Martijn Coenen <maco@android.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-09-10 10:30:31 +02:00
Matthias Maennich
8651ec01da module: add support for symbol namespaces.
The EXPORT_SYMBOL_NS() and EXPORT_SYMBOL_NS_GPL() macros can be used to
export a symbol to a specific namespace.  There are no _GPL_FUTURE and
_UNUSED variants because these are currently unused, and I'm not sure
they are necessary.

I didn't add EXPORT_SYMBOL_NS() for ASM exports; this patch sets the
namespace of ASM exports to NULL by default. In case of relative
references, it will be relocatable to NULL. If there's a need, this
should be pretty easy to add.

A module that wants to use a symbol exported to a namespace must add a
MODULE_IMPORT_NS() statement to their module code; otherwise, modpost
will complain when building the module, and the kernel module loader
will emit an error and fail when loading the module.

MODULE_IMPORT_NS() adds a modinfo tag 'import_ns' to the module. That
tag can be observed by the modinfo command, modpost and kernel/module.c
at the time of loading the module.

The ELF symbols are renamed to include the namespace with an asm label;
for example, symbol 'usb_stor_suspend' in namespace USB_STORAGE becomes
'usb_stor_suspend.USB_STORAGE'.  This allows modpost to do namespace
checking, without having to go through all the effort of parsing ELF and
relocation records just to get to the struct kernel_symbols.

On x86_64 I saw no difference in binary size (compression), but at
runtime this will require a word of memory per export to hold the
namespace. An alternative could be to store namespaced symbols in their
own section and use a separate 'struct namespaced_kernel_symbol' for
that section, at the cost of making the module loader more complex.

Co-developed-by: Martijn Coenen <maco@android.com>
Signed-off-by: Martijn Coenen <maco@android.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-09-10 10:30:17 +02:00
Matthias Maennich
ed13fc33f7 export: explicitly align struct kernel_symbol
This change allows growing struct kernel_symbol without wasting bytes to
alignment. It also concretized the alignment of ksymtab entries if
relative references are used for ksymtab entries.

struct kernel_symbol was already implicitly being aligned to the word
size, except on x86_64 and m68k, where it is aligned to 16 and 2 bytes,
respectively.

As far as I can tell there is no requirement for aligning struct
kernel_symbol to 16 bytes on x86_64, but gcc aligns structs to their
size, and the linker aligns the custom __ksymtab sections to the largest
data type contained within, so setting KSYM_ALIGN to 16 was necessary to
stay consistent with the code generated for non-ASM EXPORT_SYMBOL(). Now
that non-ASM EXPORT_SYMBOL() explicitly aligns to word size (8),
KSYM_ALIGN is no longer necessary.

In case of relative references, the alignment has been changed
accordingly to not waste space when adding new struct members.

As for m68k, struct kernel_symbol is aligned to 2 bytes even though the
structure itself is 8 bytes; using a 4-byte alignment shouldn't hurt.

I manually verified the output of the __ksymtab sections didn't change
on x86, x86_64, arm, arm64 and m68k. As expected, the section contents
didn't change, and the ELF section alignment only changed on x86_64 and
m68k. Feedback from other archs more than welcome.

Co-developed-by: Martijn Coenen <maco@android.com>
Signed-off-by: Martijn Coenen <maco@android.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-09-10 10:30:09 +02:00
Masahiro Yamada
bbda5ec671 kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS
My main motivation of this commit is to clean up scripts/Kbuild.include
and scripts/Makefile.build.

Currently, CONFIG_TRIM_UNUSED_KSYMS works with a tricky gimmick;
possibly exported symbols are detected by letting $(CPP) replace
EXPORT_SYMBOL* with a special string '=== __KSYM_*===', which is
post-processed by sed, and passed to fixdep. The extra preprocessing
is costly, and hacking cmd_and_fixdep is ugly.

I came up with a new way to find exported symbols; insert a dummy
symbol __ksym_marker_* to each potentially exported symbol. Those
dummy symbols are picked up by $(NM), post-processed by sed, then
appended to .*.cmd files. I collected the post-process part to a
new shell script scripts/gen_ksymdeps.sh for readability. The dummy
symbols are put into the .discard.* section so that the linker
script rips them off the final vmlinux or modules.

A nice side-effect is building with CONFIG_TRIM_UNUSED_KSYMS will
be much faster.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
2018-12-01 23:13:14 +09:00
Linus Torvalds
1bc276775d Merge tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild updates from Masahiro Yamada:

 - add build_{menu,n,g,x}config targets for compile-testing Kconfig

 - fix and improve recursive dependency detection in Kconfig

 - fix parallel building of menuconfig/nconfig

 - fix syntax error in clang-version.sh

 - suppress distracting log from syncconfig

 - remove obsolete "rpm" target

 - remove VMLINUX_SYMBOL(_STR) macro entirely

 - fix microblaze build with CONFIG_DYNAMIC_FTRACE

 - move compiler test for dead code/data elimination to Kconfig

 - rename well-known LDFLAGS variable to KBUILD_LDFLAGS

 - misc fixes and cleanups

* tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: rename LDFLAGS to KBUILD_LDFLAGS
  kbuild: pass LDFLAGS to recordmcount.pl
  kbuild: test dead code/data elimination support in Kconfig
  initramfs: move gen_initramfs_list.sh from scripts/ to usr/
  vmlinux.lds.h: remove stale <linux/export.h> include
  export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
  Coccinelle: remove pci_alloc_consistent semantic to detect in zalloc-simple.cocci
  kbuild: make sorting initramfs contents independent of locale
  kbuild: remove "rpm" target, which is alias of "rpm-pkg"
  kbuild: Fix LOADLIBES rename in Documentation/kbuild/makefiles.txt
  kconfig: suppress "configuration written to .config" for syncconfig
  kconfig: fix "Can't open ..." in parallel build
  kbuild: Add a space after `!` to prevent parsing as file pattern
  scripts: modpost: check memory allocation results
  kconfig: improve the recursive dependency report
  kconfig: report recursive dependency involving 'imply'
  kconfig: error out when seeing recursive dependency
  kconfig: add build-only configurator targets
  scripts/dtc: consolidate include path options in Makefile
2018-08-25 13:40:38 -07:00
Ard Biesheuvel
7290d58095 module: use relative references for __ksymtab entries
An ordinary arm64 defconfig build has ~64 KB worth of __ksymtab entries,
each consisting of two 64-bit fields containing absolute references, to
the symbol itself and to a char array containing its name, respectively.

When we build the same configuration with KASLR enabled, we end up with an
additional ~192 KB of relocations in the .init section, i.e., one 24 byte
entry for each absolute reference, which all need to be processed at boot
time.

Given how the struct kernel_symbol that describes each entry is completely
local to module.c (except for the references emitted by EXPORT_SYMBOL()
itself), we can easily modify it to contain two 32-bit relative references
instead.  This reduces the size of the __ksymtab section by 50% for all
64-bit architectures, and gets rid of the runtime relocations entirely for
architectures implementing KASLR, either via standard PIE linking (arm64)
or using custom host tools (x86).

Note that the binary search involving __ksymtab contents relies on each
section being sorted by symbol name.  This is implemented based on the
input section names, not the names in the ksymtab entries, so this patch
does not interfere with that.

Given that the use of place-relative relocations requires support both in
the toolchain and in the module loader, we cannot enable this feature for
all architectures.  So make it dependent on whether
CONFIG_HAVE_ARCH_PREL32_RELOCATIONS is defined.

Link: http://lkml.kernel.org/r/20180704083651.24360-4-ard.biesheuvel@linaro.org
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Jessica Yu <jeyu@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morris <james.morris@microsoft.com>
Cc: James Morris <jmorris@namei.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Nicolas Pitre <nico@linaro.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Garnier <thgarnie@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-08-22 10:52:47 -07:00
Ard Biesheuvel
f922c4abdf module: allow symbol exports to be disabled
To allow existing C code to be incorporated into the decompressor or the
UEFI stub, introduce a CPP macro that turns all EXPORT_SYMBOL_xxx
declarations into nops, and #define it in places where such exports are
undesirable.  Note that this gets rid of a rather dodgy redefine of
linux/export.h's header guard.

Link: http://lkml.kernel.org/r/20180704083651.24360-3-ard.biesheuvel@linaro.org
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morris <james.morris@microsoft.com>
Cc: James Morris <jmorris@namei.org>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Garnier <thgarnie@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-08-22 10:52:47 -07:00
Masahiro Yamada
c4df32c80d export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
With the special case handling for Blackfin and Metag was removed by
commit 94e58e0ac3 ("export.h: remove code for prefixing symbols with
underscore"), VMLINUX_SYMBOL() is no-op.

Replace the remaining usages, then remove the definition of
VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-08-22 23:21:44 +09:00
Masahiro Yamada
94e58e0ac3 export.h: remove code for prefixing symbols with underscore
CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX was selected by BLACKFIN, METAG.
They were removed by commit 4ba66a9760 ("arch: remove blackfin port"),
commit bb6fb6dfcc ("metag: Remove arch/metag/"), respectively.

No more architecture enables CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX.
Clean up the export.h headers.  I am keeping VMLINUX_SYMBOL() and
VMLINUX_SYMBOL_STR() because they are widely used.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
2018-05-17 22:44:57 +09:00
Ard Biesheuvel
4b9eee96fc module: unify absolute krctab definitions for 32-bit and 64-bit
The previous patch introduced a separate inline asm version of the
krcrctab declaration template for use with 64-bit architectures, which
cannot refer to ELF symbols using 32-bit quantities.

This declaration should be equivalent to the C one for 32-bit
architectures, but just in case - unify them in a separate patch, which
can simply be dropped if it turns out to break anything.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-03 08:28:25 -08:00
Ard Biesheuvel
71810db27c modversions: treat symbol CRCs as 32 bit quantities
The modversion symbol CRCs are emitted as ELF symbols, which allows us
to easily populate the kcrctab sections by relying on the linker to
associate each kcrctab slot with the correct value.

This has a couple of downsides:

 - Given that the CRCs are treated as memory addresses, we waste 4 bytes
   for each CRC on 64 bit architectures,

 - On architectures that support runtime relocation, a R_<arch>_RELATIVE
   relocation entry is emitted for each CRC value, which identifies it
   as a quantity that requires fixing up based on the actual runtime
   load offset of the kernel. This results in corrupted CRCs unless we
   explicitly undo the fixup (and this is currently being handled in the
   core module code)

 - Such runtime relocation entries take up 24 bytes of __init space
   each, resulting in a x8 overhead in [uncompressed] kernel size for
   CRCs.

Switching to explicit 32 bit values on 64 bit architectures fixes most
of these issues, given that 32 bit values are not treated as quantities
that require fixing up based on the actual runtime load offset.  Note
that on some ELF64 architectures [such as PPC64], these 32-bit values
are still emitted as [absolute] runtime relocatable quantities, even if
the value resolves to a build time constant.  Since relative relocations
are always resolved at build time, this patch enables MODULE_REL_CRCS on
powerpc when CONFIG_RELOCATABLE=y, which turns the absolute CRC
references into relative references into .rodata where the actual CRC
value is stored.

So redefine all CRC fields and variables as u32, and redefine the
__CRC_SYMBOL() macro for 64 bit builds to emit the CRC reference using
inline assembler (which is necessary since 64-bit C code cannot use
32-bit types to hold memory addresses, even if they are ultimately
resolved using values that do not exceed 0xffffffff).  To avoid
potential problems with legacy 32-bit architectures using legacy
toolchains, the equivalent C definition of the kcrctab entry is retained
for 32-bit architectures.

Note that this mostly reverts commit d4703aefdb ("module: handle ppc64
relocating kcrctabs when CONFIG_RELOCATABLE=y")

Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-03 08:28:25 -08:00
Linus Torvalds
84d69848c9 Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild updates from Michal Marek:

 - EXPORT_SYMBOL for asm source by Al Viro.

   This does bring a regression, because genksyms no longer generates
   checksums for these symbols (CONFIG_MODVERSIONS). Nick Piggin is
   working on a patch to fix this.

   Plus, we are talking about functions like strcpy(), which rarely
   change prototypes.

 - Fixes for PPC fallout of the above by Stephen Rothwell and Nick
   Piggin

 - fixdep speedup by Alexey Dobriyan.

 - preparatory work by Nick Piggin to allow architectures to build with
   -ffunction-sections, -fdata-sections and --gc-sections

 - CONFIG_THIN_ARCHIVES support by Stephen Rothwell

 - fix for filenames with colons in the initramfs source by me.

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: (22 commits)
  initramfs: Escape colons in depfile
  ppc: there is no clear_pages to export
  powerpc/64: whitelist unresolved modversions CRCs
  kbuild: -ffunction-sections fix for archs with conflicting sections
  kbuild: add arch specific post-link Makefile
  kbuild: allow archs to select link dead code/data elimination
  kbuild: allow architectures to use thin archives instead of ld -r
  kbuild: Regenerate genksyms lexer
  kbuild: genksyms fix for typeof handling
  fixdep: faster CONFIG_ search
  ia64: move exports to definitions
  sparc32: debride memcpy.S a bit
  [sparc] unify 32bit and 64bit string.h
  sparc: move exports to definitions
  ppc: move exports to definitions
  arm: move exports to definitions
  s390: move exports to definitions
  m68k: move exports to definitions
  alpha: move exports to actual definitions
  x86: move exports to actual definitions
  ...
2016-10-14 14:26:58 -07:00
Masahiro Yamada
97139d4a6f treewide: remove redundant #include <linux/kconfig.h>
Kernel source files need not include <linux/kconfig.h> explicitly
because the top Makefile forces to include it with:

  -include $(srctree)/include/linux/kconfig.h

This commit removes explicit includes except the following:

  * arch/s390/include/asm/facilities_src.h
  * tools/testing/radix-tree/linux/kernel.h

These two are used for host programs.

Link: http://lkml.kernel.org/r/1473656164-11929-1-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-10-11 15:06:33 -07:00
Nicholas Piggin
b67067f117 kbuild: allow archs to select link dead code/data elimination
Introduce LD_DEAD_CODE_DATA_ELIMINATION option for architectures to
select to build with -ffunction-sections, -fdata-sections, and link
with --gc-sections. It requires some work (documented) to ensure all
unreferenced entrypoints are live, and requires toolchain and build
verification, so it is made a per-arch option for now.

On a random powerpc64le build, this yelds a significant size saving,
it boots and runs fine, but there is a lot I haven't tested as yet, so
these savings may be reduced if there are bugs in the link.

    text      data        bss        dec   filename
11169741   1180744    1923176	14273661   vmlinux
10445269   1004127    1919707	13369103   vmlinux.dce

~700K text, ~170K data, 6% removed from kernel image size.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
2016-09-09 10:47:00 +02:00
Masahiro Yamada
6023d2369b export.h: use __is_defined() to check if __KSYM_* is defined
Here the need is for a macro that checks whether the given symbol is
defined or not, which has nothing to do with config.

The new macro __is_defined() is a better fit for this case.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Michal Marek <mmarek@suse.com>
2016-06-20 22:42:32 +02:00
Nicolas Pitre
c1a95fda2a kbuild: add fine grained build dependencies for exported symbols
Like with kconfig options, we now have the ability to compile in and
out individual EXPORT_SYMBOL() declarations based on the content of
include/generated/autoksyms.h.  However we don't want the entire
world to be rebuilt whenever that file is touched.

Let's apply the same build dependency trick used for CONFIG_* symbols
where the time stamp of empty files whose paths matching those symbols
is used to trigger fine grained rebuilds. In our case the key is the
symbol name passed to EXPORT_SYMBOL().

However, unlike config options, we cannot just use fixdep to parse
the source code for EXPORT_SYMBOL(ksym) because several variants exist
and parsing them all in a separate tool, and keeping it in synch, is
not trivially maintainable.  Furthermore, there are variants such as

	EXPORT_SYMBOL_GPL(pci_user_read_config_##size);

that are instanciated via a macro for which we can't easily determine
the actual exported symbol name(s) short of actually running the
preprocessor on them.

Storing the symbol name string in a special ELF section doesn't work
for targets that output assembly or preprocessed source.

So the best way is really to leverage the preprocessor by having it
output actual symbol names anchored by a special sequence that can be
easily filtered out. Then the list of symbols is simply fed to fixdep
to be merged with the other dependencies.

That implies the preprocessor is executed twice for each source file.
A previous attempt relied on a warning pragma for each EXPORT_SYMBOL()
instance that was filtered apart from stderr by the build system with
a sed script during the actual compilation pass. Unfortunately the
preprocessor/compiler diagnostic output isn't stable between versions
and this solution, although more efficient, was deemed too fragile.

Because of the lowercasing performed by fixdep, there might be name
collisions triggering spurious rebuilds for similar symbols. But this
shouldn't be a big issue in practice. (This is the case for CONFIG_*
symbols and I didn't want to be different here, whatever the original
reason for doing so.)

To avoid needless build overhead, the exported symbol name gathering is
performed only when CONFIG_TRIM_UNUSED_KSYMS is selected.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
2016-03-29 16:30:56 -04:00
Nicolas Pitre
f235541699 export.h: allow for per-symbol configurable EXPORT_SYMBOL()
Similar to include/generated/autoconf.h, include/generated/autoksyms.h
will contain a list of defines for each EXPORT_SYMBOL() that we want
active. The format is:

  #define __KSYM_<symbol_name> 1

This list will be auto-generated with another patch.  For now we only
include the preprocessor magic to automatically create or omit the
corresponding struct kernel_symbol declaration.

Given the content of include/generated/autoksyms.h may not be known in
advance, an empty file is created early on to let the build proceed.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
2016-03-29 16:18:53 -04:00
Johannes Berg
7b4ec8dd7d export: declare ksymtab symbols
sparse complains about any __ksymtab symbols with the following:

 warning: symbol '__ksymtab_...' was not declared. Should it be static?

due to Andi's patch making it non-static.

Mollify sparse by declaring the symbol extern, otherwise we get
drowned in sparse warnings for anything that uses EXPORT_SYMBOL
in the sources, making it easy to miss real warnings.

Fixes: e0f244c63f ("asmlinkage, module: Make ksymtab [...] __visible")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-01-16 10:23:02 +10:30
Andi Kleen
e0f244c63f asmlinkage, module: Make ksymtab and kcrctab symbols and __this_module __visible
Make the ksymtab symbols for EXPORT_SYMBOL visible.
This prevents the LTO compiler from adding a .NUMBER prefix,
which avoids various problems in later export processing.

Cc: rusty@rustcorp.com.au
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-10-29 09:43:37 +10:30
Rusty Russell
b92021b09d CONFIG_SYMBOL_PREFIX: cleanup.
We have CONFIG_SYMBOL_PREFIX, which three archs define to the string
"_".  But Al Viro broke this in "consolidate cond_syscall and
SYSCALL_ALIAS declarations" (in linux-next), and he's not the first to
do so.

Using CONFIG_SYMBOL_PREFIX is awkward, since we usually just want to
prefix it so something.  So various places define helpers which are
defined to nothing if CONFIG_SYMBOL_PREFIX isn't set:

1) include/asm-generic/unistd.h defines __SYMBOL_PREFIX.
2) include/asm-generic/vmlinux.lds.h defines VMLINUX_SYMBOL(sym)
3) include/linux/export.h defines MODULE_SYMBOL_PREFIX.
4) include/linux/kernel.h defines SYMBOL_PREFIX (which differs from #7)
5) kernel/modsign_certificate.S defines ASM_SYMBOL(sym)
6) scripts/modpost.c defines MODULE_SYMBOL_PREFIX
7) scripts/Makefile.lib defines SYMBOL_PREFIX on the commandline if
   CONFIG_SYMBOL_PREFIX is set, so that we have a non-string version
   for pasting.

(arch/h8300/include/asm/linkage.h defines SYMBOL_NAME(), too).

Let's solve this properly:
1) No more generic prefix, just CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX.
2) Make linux/export.h usable from asm.
3) Define VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR().
4) Make everyone use them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Tested-by: James Hogan <james.hogan@imgtec.com> (metag)
2013-03-15 15:09:43 +10:30
Paul Gortmaker
f50169324d module.h: split out the EXPORT_SYMBOL into export.h
A lot of files pull in module.h when all they are really
looking for is the basic EXPORT_SYMBOL functionality. The
recent data from Ingo[1] shows that this is one of several
instances that has a significant impact on compile times,
and it should be targeted for factoring out (as done here).

Note that several commonly used header files in include/*
directly include <linux/module.h> themselves (some 34 of them!)
The most commonly used ones of these will have to be made
independent of module.h before the full benefit of this change
can be realized.

We also transition THIS_MODULE from module.h to export.h,
since there are lots of files with subsystem structs that
in turn will have a struct module *owner and only be doing:

	.owner = THIS_MODULE;

and absolutely nothing else modular. So, we also want to have
the THIS_MODULE definition present in the lightweight header.

[1] https://lkml.org/lkml/2011/5/23/76

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 09:20:11 -04:00