This is a note to let you know that I've just added the patch titled staging: greybus: audio_helper: remove unused and wrong debugfs usage to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: staging-greybus-audio_helper-remove-unused-and-wrong-debugfs-usage.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From d517cdeb904ddc0cbebcc959d43596426cac40b0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Date: Fri, 2 Sep 2022 16:37:15 +0200 Subject: staging: greybus: audio_helper: remove unused and wrong debugfs usage From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> commit d517cdeb904ddc0cbebcc959d43596426cac40b0 upstream. In the greybus audio_helper code, the debugfs file for the dapm has the potential to be removed and memory will be leaked. There is also the very real potential for this code to remove ALL debugfs entries from the system, and it seems like this is what will really happen if this code ever runs. This all is very wrong as the greybus audio driver did not create this debugfs file, the sound core did and controls the lifespan of it. So remove all of the debugfs logic from the audio_helper code as there's no way it could be correct. If this really is needed, it can come back with a fixup for the incorrect usage of the debugfs_lookup() call which is what caused this to be noticed at all. Cc: Johan Hovold <johan@xxxxxxxxxx> Cc: Alex Elder <elder@xxxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: stable <stable@xxxxxxxxxx> Link: https://lore.kernel.org/r/20220902143715.320500-1-gregkh@xxxxxxxxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/staging/greybus/audio_helper.c | 11 ----------- 1 file changed, 11 deletions(-) --- a/drivers/staging/greybus/audio_helper.c +++ b/drivers/staging/greybus/audio_helper.c @@ -3,7 +3,6 @@ * Greybus Audio Sound SoC helper APIs */ -#include <linux/debugfs.h> #include <sound/core.h> #include <sound/soc.h> #include <sound/soc-dapm.h> @@ -116,10 +115,6 @@ int gbaudio_dapm_free_controls(struct sn { int i; struct snd_soc_dapm_widget *w, *tmp_w; -#ifdef CONFIG_DEBUG_FS - struct dentry *parent = dapm->debugfs_dapm; - struct dentry *debugfs_w = NULL; -#endif mutex_lock(&dapm->card->dapm_mutex); for (i = 0; i < num; i++) { @@ -139,12 +134,6 @@ int gbaudio_dapm_free_controls(struct sn continue; } widget++; -#ifdef CONFIG_DEBUG_FS - if (!parent) - debugfs_w = debugfs_lookup(w->name, parent); - debugfs_remove(debugfs_w); - debugfs_w = NULL; -#endif gbaudio_dapm_free_widget(w); } mutex_unlock(&dapm->card->dapm_mutex); Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are queue-6.0/drm-nouveau-kms-nv140-disable-interlacing.patch queue-6.0/i2c-designware-fix-handling-of-real-but-unexpected-device-interrupts.patch queue-6.0/net-thunderbolt-enable-dma-paths-only-after-rings-are-enabled.patch queue-6.0/riscv-always-honor-the-config_cmdline_force-when-parsing-dtb.patch queue-6.0/btrfs-fix-missed-extent-on-fsync-after-dropping-extent-maps.patch queue-6.0/loadpin-fix-kconfig-doc-about-format-of-file-with-verity-digests.patch queue-6.0/nvme-multipath-fix-possible-hang-in-live-ns-resize-with-ana-access.patch queue-6.0/fs-dlm-handle-ebusy-first-in-lock-arg-validation.patch queue-6.0/tracing-fix-reading-strings-from-synthetic-events.patch queue-6.0/io_uring-correct-pinned_vm-accounting.patch queue-6.0/kvm-nvmx-unconditionally-purge-queued-injected-events-on-nested-exit.patch queue-6.0/iio-pressure-dps310-refactor-startup-procedure.patch queue-6.0/serial-ar933x-deassert-transmit-enable-on-rs485_config.patch queue-6.0/revert-drm-amdgpu-use-dirty-framebuffer-helper.patch queue-6.0/parisc-fbdev-stifb-align-graphics-memory-size-to-4mb.patch queue-6.0/ext4-update-state-fc_regions_size-after-successful-memory-allocation.patch queue-6.0/alsa-rawmidi-drop-register_mutex-in-snd_rawmidi_free.patch queue-6.0/riscv-vdso-fix-null-deference-in-vdso_join_timens-when-vfork.patch queue-6.0/tracing-add-ioctl-to-force-ring-buffer-waiters-to-wake-up.patch queue-6.0/serial-stm32-deassert-transmit-enable-on-rs485_config.patch queue-6.0/mtd-rawnand-atmel-unmap-streaming-dma-mappings.patch queue-6.0/ext4-fix-null-ptr-deref-in-ext4_write_info.patch queue-6.0/nfsd-protect-against-send-buffer-overflow-in-nfsv2-read.patch queue-6.0/drm-i915-gt-use-i915_vm_put-on-ppgtt_create-error-paths.patch queue-6.0/drm-virtio-unlock-reservations-on-dma_resv_reserve_fences-error.patch queue-6.0/ring-buffer-have-the-shortest_full-queue-be-the-shortest-not-longest.patch queue-6.0/clocksource-drivers-arm_arch_timer-fix-cntpct_lo-and-cntvct_lo-value.patch queue-6.0/hwrng-core-let-sleep-be-interrupted-when-unregistering-hwrng.patch queue-6.0/tracing-eprobe-fix-alloc-event-dir-failed-when-event-name-no-set.patch queue-6.0/thunderbolt-explicitly-enable-lane-adapter-hotplug-events-at-startup.patch queue-6.0/fs-dlm-fix-race-between-test_bit-and-queue_work.patch queue-6.0/riscv-allow-prot_write-only-mmap.patch queue-6.0/iio-dac-ad5593r-fix-i2c-read-protocol-requirements.patch queue-6.0/ring-buffer-add-ring_buffer_wake_waiters.patch queue-6.0/kvm-vmx-drop-bits-31-16-when-shoving-exception-error-code-into-vmcs.patch queue-6.0/asoc-wcd9335-fix-order-of-slimbus-unprepare-disable.patch queue-6.0/io_uring-net-don-t-update-msg_name-if-not-provided.patch queue-6.0/nfsd-protect-against-send-buffer-overflow-in-nfsv3-read.patch queue-6.0/tracing-move-duplicate-code-of-trace_kprobe-eprobe.c-into-header.patch queue-6.0/jbd2-fix-potential-buffer-head-reference-count-leak.patch queue-6.0/fs-dlm-fix-invalid-derefence-of-sb_lvbptr.patch queue-6.0/io_uring-rw-fix-unexpected-link-breakage.patch queue-6.0/riscv-pass-mno-relax-only-on-lld-15.0.0.patch queue-6.0/arm64-dts-qcom-sdm845-mtp-correct-adc-settle-time.patch queue-6.0/f2fs-increase-the-limit-for-reserve_root.patch queue-6.0/alsa-oss-fix-potential-deadlock-at-unregistration.patch queue-6.0/serial-8250-request-full-16550a-feature-probing-for-oxsemi-pcie-devices.patch queue-6.0/powerpc-boot-explicitly-disable-usage-of-spe-instructions.patch queue-6.0/tracing-add-fault-name-injection-to-kernel-probes.patch queue-6.0/serial-8250-let-drivers-request-full-16550a-feature-probing.patch queue-6.0/kvm-nvmx-don-t-propagate-vmcs12-s-perf_global_ctrl-settings-to-vmcs02.patch queue-6.0/mm-hugetlb-fix-races-when-looking-up-a-cont-pte-pmd-size-hugetlb-page.patch queue-6.0/f2fs-fix-to-do-sanity-check-on-destination-blkaddr-during-recovery.patch queue-6.0/btrfs-fix-alignment-of-vma-for-memory-mapped-files-on-thp.patch queue-6.0/ext4-fix-miss-release-buffer-head-in-ext4_fc_write_inode.patch queue-6.0/platform-chrome-cros_ec_proto-update-version-on-get_next_event-failure.patch queue-6.0/alsa-usb-audio-fix-potential-memory-leaks.patch queue-6.0/btf-export-bpf_dynptr-definition.patch queue-6.0/scsi-lpfc-rework-mib-rx-monitor-debug-info-logic.patch queue-6.0/ext4-ext4_read_bh_lock-should-submit-io-if-the-buffer-isn-t-uptodate.patch queue-6.0/xen-gntdev-accommodate-vma-splitting.patch queue-6.0/ext4-place-buffer-head-allocation-before-handle-start.patch queue-6.0/ring-buffer-fix-race-between-reset-page-and-reading-page.patch queue-6.0/fbdev-smscufx-fix-use-after-free-in-ufx_ops_open.patch queue-6.0/jbd2-fix-potential-use-after-free-in-jbd2_fc_wait_bufs.patch queue-6.0/arm64-mte-avoid-setting-pg_mte_tagged-if-no-tags-cleared-or-restored.patch queue-6.0/tracing-wake-up-ring-buffer-waiters-on-closing-of-the-file.patch queue-6.0/blk-throttle-fix-that-io-throttle-can-only-work-for-single-bio.patch queue-6.0/ftrace-still-disable-enabled-records-marked-as-disabled.patch queue-6.0/tracing-disable-interrupt-or-preemption-before-acquiring-arch_spinlock_t.patch queue-6.0/arm64-errata-add-cortex-a55-to-the-repeat-tlbi-list.patch queue-6.0/media-cedrus-set-the-platform-driver-data-earlier.patch queue-6.0/xhci-dbc-fix-memory-leak-in-xhci_alloc_dbc.patch queue-6.0/can-kvaser_usb_leaf-fix-overread-with-an-invalid-command.patch queue-6.0/iio-pressure-dps310-reset-chip-after-timeout.patch queue-6.0/drm-virtio-check-whether-transferred-2d-bo-is-shmem.patch queue-6.0/mm-damon-validate-if-the-pmd-entry-is-present-before-accessing.patch queue-6.0/riscv-make-vm_write-imply-vm_read.patch queue-6.0/tracing-do-not-free-snapshot-if-tracer-is-on-cmdline.patch queue-6.0/serial-deassert-transmit-enable-on-probe-in-driver-specific-way.patch queue-6.0/media-cedrus-fix-watchdog-race-condition.patch queue-6.0/asoc-wcd934x-fix-order-of-slimbus-unprepare-disable.patch queue-6.0/scsi-qedf-populate-sysfs-attributes-for-vport.patch queue-6.0/riscv-topology-fix-default-topology-reporting.patch queue-6.0/risc-v-make-port-i-o-string-accessors-actually-work.patch queue-6.0/efi-libstub-drop-pointless-get_memory_map-call.patch queue-6.0/can-kvaser_usb_leaf-fix-can-state-after-restart.patch queue-6.0/slimbus-qcom-ngd-use-correct-error-in-message-of-pdr_add_lookup-failure.patch queue-6.0/rpmsg-char-avoid-double-destroy-of-default-endpoint.patch queue-6.0/hid-multitouch-add-memory-barriers.patch queue-6.0/ksmbd-fix-incorrect-handling-of-iterate_dir.patch queue-6.0/dm-verity-loadpin-only-trust-verity-targets-with-enforcement.patch queue-6.0/tracing-wake-up-waiters-when-tracing-is-disabled.patch queue-6.0/io_uring-net-don-t-lose-partial-send-recv-on-fail.patch queue-6.0/mmc-renesas_sdhi-fix-rounding-errors.patch queue-6.0/can-kvaser_usb-fix-use-of-uninitialized-completion.patch queue-6.0/io_uring-rw-don-t-lose-partial-io-result-on-fail.patch queue-6.0/alsa-hda-realtek-add-quirk-for-asus-gv601r-laptop.patch queue-6.0/io_uring-net-fix-fast_iov-assignment-in-io_setup_async_msg.patch queue-6.0/f2fs-allow-direct-read-for-zoned-device.patch queue-6.0/f2fs-complete-checkpoints-during-remount.patch queue-6.0/staging-greybus-audio_helper-remove-unused-and-wrong-debugfs-usage.patch queue-6.0/alsa-hda-realtek-correct-pin-configs-for-asus-g533z.patch queue-6.0/arm64-topology-move-store_cpu_topology-to-shared-code.patch queue-6.0/ring-buffer-allow-splice-to-read-previous-partially-read-pages.patch queue-6.0/alsa-hda-realtek-remove-alc289_fixup_dual_spk-for-dell-5530.patch queue-6.0/alsa-hda-realtek-add-intel-reference-ssid-to-support-headset-keys.patch queue-6.0/ext4-fix-dir-corruption-when-ext4_dx_add_entry-fails.patch queue-6.0/media-cedrus-fix-endless-loop-in-cedrus_h265_skip_bits.patch queue-6.0/io_uring-limit-registration-w-single_issuer.patch queue-6.0/risc-v-re-enable-counter-access-from-userspace.patch queue-6.0/ksmbd-fix-user-namespace-mapping.patch queue-6.0/dmaengine-qcom-adm-fix-wrong-sizeof-config-in-slave_config.patch queue-6.0/f2fs-flush-pending-checkpoints-when-freezing-super.patch queue-6.0/btrfs-fix-race-between-quota-enable-and-quota-rescan-ioctl.patch queue-6.0/ext2-add-sanity-checks-for-group-and-filesystem-size.patch queue-6.0/ext4-fix-potential-memory-leak-in-ext4_fc_record_modified_inode.patch queue-6.0/cpufreq-qcom-cpufreq-hw-fix-uninitialized-throttled_freq-warning.patch queue-6.0/ext4-unconditionally-enable-the-i_version-counter.patch queue-6.0/btrfs-set-generation-before-calling-btrfs_clean_tree_block-in-btrfs_init_new_buffer.patch queue-6.0/nvmem-core-fix-memleak-in-nvmem_register.patch queue-6.0/um-cpuinfo-fix-a-warning-for-config_cpumask_offstack.patch queue-6.0/ksmbd-fix-wrong-return-value-and-message-length-check-in-smb2_ioctl.patch queue-6.0/iio-ltc2497-fix-reading-conversion-results.patch queue-6.0/cifs-fix-the-error-length-of-validate_negotiate_info-message.patch queue-6.0/mm-mmap-undo-mmap-when-arch_validate_flags-fails.patch queue-6.0/arm64-mte-move-register-initialization-to-c.patch queue-6.0/cifs-destage-dirty-pages-before-re-reading-them-for-cache-none.patch queue-6.0/mm-uffd-fix-warning-without-pte_marker_uffd_wp-compiled-in.patch queue-6.0/serial-cpm_uart-don-t-request-irq-too-early-for-console-port.patch queue-6.0/hwmon-gsc-hwmon-call-of_node_get-before-of_find_xxx-api.patch queue-6.0/ext4-make-ext4_lazyinit_thread-freezable.patch queue-6.0/nfsd-protect-against-send-buffer-overflow-in-nfsv3-readdir.patch queue-6.0/io_uring-add-custom-opcode-hooks-on-fail.patch queue-6.0/btrfs-enhance-unsupported-compat-ro-flags-handling.patch queue-6.0/ext4-fix-potential-memory-leak-in-ext4_fc_record_regions.patch queue-6.0/kvm-x86-emulator-fix-handing-of-pop-ss-to-correctly-set-interruptibility.patch queue-6.0/regulator-qcom_rpm-fix-circular-deferral-regression.patch queue-6.0/ext4-fix-i_version-handling-in-ext4.patch queue-6.0/jbd2-add-miss-release-buffer-head-in-fc_do_one_pass.patch queue-6.0/f2fs-fix-to-do-sanity-check-on-summary-info.patch queue-6.0/fs-record-i_dirty_time-even-if-inode-already-has-i_dirty_inode.patch queue-6.0/io_uring-net-handle-einprogress-correct-for-ioring_op_connect.patch queue-6.0/ring-buffer-check-pending-waiters-when-doing-wake-ups-as-well.patch queue-6.0/blk-wbt-call-rq_qos_add-after-wb_normal-is-initialized.patch queue-6.0/mmc-sdhci-tegra-use-actual-clock-rate-for-sw-tuning-correction.patch queue-6.0/drm-virtio-unlock-reservations-on-virtio_gpu_object_shmem_init-error.patch queue-6.0/smb3-do-not-log-confusing-message-when-server-returns-no-network-interfaces.patch queue-6.0/io_uring-rw-don-t-lose-short-results-on-io_setup_async_rw.patch queue-6.0/slimbus-qcom-ngd-cleanup-in-probe-error-path.patch queue-6.0/pinctrl-rockchip-add-pinmux_ops.gpio_set_direction-callback.patch queue-6.0/quota-check-next-prev-free-block-number-after-reading-from-quota-file.patch queue-6.0/usb-add-quirks-for-lenovo-onelink-dock.patch queue-6.0/gpio-rockchip-request-gpio-mux-to-pinctrl-when-setting-direction.patch queue-6.0/drm-udl-restore-display-mode-on-resume.patch queue-6.0/xen-gntdev-prevent-leaking-grants.patch queue-6.0/parisc-fix-userspace-graphics-card-breakage-due-to-pgtable-special-bit.patch queue-6.0/pci-sanitise-firmware-bar-assignments-behind-a-pci-pci-bridge.patch queue-6.0/drm-nouveau-fix-a-use-after-free-in-nouveau_gem_prime_import_sg_table.patch queue-6.0/mbcache-avoid-nesting-of-cache-c_list_lock-under-bit-locks.patch queue-6.0/iio-adc-ad7923-fix-channel-readings-for-some-variants.patch queue-6.0/mmc-sdhci-sprd-fix-minimum-clock-limit.patch queue-6.0/drm-virtio-use-appropriate-atomic-state-in-virtio_gpu_plane_cleanup_fb.patch queue-6.0/ext4-don-t-increase-iversion-counter-for-ea_inodes.patch queue-6.0/dmaengine-mxs-use-platform_driver_register.patch queue-6.0/ksmbd-fix-endless-loop-when-encryption-for-response-fails.patch queue-6.0/ext4-avoid-crash-when-inline-data-creation-follows-dio-write.patch queue-6.0/can-kvaser_usb_leaf-fix-tx-queue-out-of-sync-after-restart.patch queue-6.0/io_uring-af_unix-defer-registered-files-gc-to-io_uring-release.patch queue-6.0/hv_netvsc-fix-race-between-vf-offering-and-vf-association-message-from-host.patch queue-6.0/kvm-x86-treat-dbs-from-the-emulator-as-fault-like-code-and-dr7.gd-1.patch queue-6.0/dmaengine-qcom-adm-fix-wrong-calling-convention-for-prep_slave_sg.patch queue-6.0/alsa-usb-audio-fix-null-dererence-at-error-path.patch queue-6.0/mmc-core-add-sd-card-quirk-for-broken-discard.patch queue-6.0/powerpc-kconfig-fix-non-existing-config_ppc_fsl_booke.patch queue-6.0/jbd2-wake-up-journal-waiters-in-fifo-order-not-lifo.patch queue-6.0/ext4-fix-check-for-block-being-out-of-directory-size.patch queue-6.0/ftrace-properly-unset-ftrace_hash_fl_mod.patch queue-6.0/powercap-intel_rapl-use-standard-energy-unit-for-spr-dram-rapl-domain.patch queue-6.0/usb-gadget-uvc-fix-argument-to-sizeof-in-uvc_register_video.patch queue-6.0/livepatch-fix-race-between-fork-and-klp-transition.patch queue-6.0/f2fs-fix-wrong-continue-condition-in-gc.patch