https://github.com/torvalds/linux
Revision 2127d22509aec3a83dffb2a3c736df7ba747a7ce authored by Miaohe Lin on 18 October 2021, 22:15:52 UTC, committed by Linus Torvalds on 19 October 2021, 06:22:03 UTC
Patch series "Fixups for slub".

This series contains various bug fixes for slub.  We fix memoryleak,
use-afer-free, NULL pointer dereferencing and so on in slub.  More
details can be found in the respective changelogs.

This patch (of 5):

It's possible that __seq_open_private() will return NULL.  So we should
check it before using lest dereferencing NULL pointer.  And in error
paths, we forgot to release private buffer via seq_release_private().
Memory will leak in these paths.

Link: https://lkml.kernel.org/r/20210916123920.48704-1-linmiaohe@huawei.com
Link: https://lkml.kernel.org/r/20210916123920.48704-2-linmiaohe@huawei.com
Fixes: 64dd68497be7 ("mm: slub: move sysfs slab alloc/free interfaces to debugfs")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Faiyaz Mohammed <faiyazm@codeaurora.org>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Bharata B Rao <bharata@linux.ibm.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6d2aec9
Raw File
Tip revision: 2127d22509aec3a83dffb2a3c736df7ba747a7ce authored by Miaohe Lin on 18 October 2021, 22:15:52 UTC
mm, slub: fix two bugs in slab_debug_trace_open()
Tip revision: 2127d22
Kconfig
# SPDX-License-Identifier: GPL-2.0-only
config SSB_POSSIBLE
	bool
	depends on HAS_IOMEM && HAS_DMA
	default y

menuconfig SSB
	tristate "Sonics Silicon Backplane support"
	depends on SSB_POSSIBLE
	help
	  Support for the Sonics Silicon Backplane bus.
	  You only need to enable this option, if you are
	  configuring a kernel for an embedded system with
	  this bus.
	  It will be auto-selected if needed in other
	  environments.

	  The module will be called ssb.

	  If unsure, say N.

if SSB

# Common SPROM support routines
config SSB_SPROM
	bool

# Support for Block-I/O. SELECT this from the driver that needs it.
config SSB_BLOCKIO
	bool
	depends on SSB

config SSB_PCIHOST_POSSIBLE
	bool
	depends on SSB && (PCI = y || PCI = SSB) && (PCI_DRIVERS_LEGACY || !MIPS)
	default y

config SSB_PCIHOST
	bool "Support for SSB on PCI-bus host"
	depends on SSB_PCIHOST_POSSIBLE
	select SSB_SPROM
	default y
	help
	  Support for a Sonics Silicon Backplane on top
	  of a PCI device.

	  If unsure, say Y

config SSB_B43_PCI_BRIDGE
	bool
	depends on SSB_PCIHOST
	default n

config SSB_PCMCIAHOST_POSSIBLE
	bool
	depends on SSB && (PCMCIA = y || PCMCIA = SSB)
	default y

config SSB_PCMCIAHOST
	bool "Support for SSB on PCMCIA-bus host"
	depends on SSB_PCMCIAHOST_POSSIBLE
	select SSB_SPROM
	help
	  Support for a Sonics Silicon Backplane on top
	  of a PCMCIA device.

	  If unsure, say N

config SSB_SDIOHOST_POSSIBLE
	bool
	depends on SSB && (MMC = y || MMC = SSB)
	default y

config SSB_SDIOHOST
	bool "Support for SSB on SDIO-bus host"
	depends on SSB_SDIOHOST_POSSIBLE
	help
	  Support for a Sonics Silicon Backplane on top
	  of a SDIO device.

	  If unsure, say N

config SSB_HOST_SOC
	bool "Support for SSB bus on SoC"
	depends on SSB && BCM47XX_NVRAM
	select SSB_SPROM
	help
	  Host interface for a SSB directly mapped into memory. This is
	  for some Broadcom SoCs from the BCM47xx and BCM53xx lines.

	  If unsure, say N

config SSB_SERIAL
	bool
	depends on SSB
	# ChipCommon and ExtIf serial support routines.

config SSB_DRIVER_PCICORE_POSSIBLE
	bool
	depends on SSB_PCIHOST
	default y

config SSB_DRIVER_PCICORE
	bool "SSB PCI core driver"
	depends on SSB_DRIVER_PCICORE_POSSIBLE
	help
	  Driver for the Sonics Silicon Backplane attached
	  Broadcom PCI core.

	  If unsure, say Y

config SSB_PCICORE_HOSTMODE
	bool "Hostmode support for SSB PCI core"
	depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS && SSB = y
	help
	  PCIcore hostmode operation (external PCI bus).

config SSB_DRIVER_MIPS
	bool "SSB Broadcom MIPS core driver"
	depends on SSB && MIPS
	select SSB_SERIAL
	select SSB_SFLASH
	help
	  Driver for the Sonics Silicon Backplane attached
	  Broadcom MIPS core.

	  If unsure, say N

config SSB_SFLASH
	bool "SSB serial flash support"
	depends on SSB_DRIVER_MIPS
	default y

# Assumption: We are on embedded, if we compile the MIPS core.
config SSB_EMBEDDED
	bool
	depends on SSB_DRIVER_MIPS && SSB_PCICORE_HOSTMODE
	default y

config SSB_DRIVER_EXTIF
	bool "SSB Broadcom EXTIF core driver"
	depends on SSB_DRIVER_MIPS
	help
	  Driver for the Sonics Silicon Backplane attached
	  Broadcom EXTIF core.

	  If unsure, say N

config SSB_DRIVER_GIGE
	bool "SSB Broadcom Gigabit Ethernet driver"
	depends on SSB_PCIHOST_POSSIBLE && SSB_EMBEDDED && MIPS
	help
	  Driver for the Sonics Silicon Backplane attached
	  Broadcom Gigabit Ethernet.

	  If unsure, say N

config SSB_DRIVER_GPIO
	bool "SSB GPIO driver"
	depends on SSB && GPIOLIB
	select IRQ_DOMAIN if SSB_EMBEDDED
	help
	  Driver to provide access to the GPIO pins on the bus.

	  If unsure, say N

endif # SSB
back to top