stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Qian Cai <cai@gmx.us>, Andrew Morton <akpm@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.9 72/91] drivers/base/platform.c: kmemleak ignore a known leak
Date: Fri, 22 Nov 2019 01:01:10 -0500	[thread overview]
Message-ID: <20191122060129.4239-71-sashal@kernel.org> (raw)
In-Reply-To: <20191122060129.4239-1-sashal@kernel.org>

From: Qian Cai <cai@gmx.us>

[ Upstream commit 967d3010df8b6f6f9aa95c198edc5fe3646ebf36 ]

unreferenced object 0xffff808ec6dc5a80 (size 128):
  comm "swapper/0", pid 1, jiffies 4294938063 (age 2560.530s)
  hex dump (first 32 bytes):
    ff ff ff ff 00 00 00 00 6b 6b 6b 6b 6b 6b 6b 6b  ........kkkkkkkk
    6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
  backtrace:
    [<00000000476dcf8c>] kmem_cache_alloc_trace+0x430/0x500
    [<000000004f708d37>] platform_device_register_full+0xbc/0x1e8
    [<000000006c2a7ec7>] acpi_create_platform_device+0x370/0x450
    [<00000000ef135642>] acpi_default_enumeration+0x34/0x78
    [<000000003bd9a052>] acpi_bus_attach+0x2dc/0x3e0
    [<000000003cf4f7f2>] acpi_bus_attach+0x108/0x3e0
    [<000000003cf4f7f2>] acpi_bus_attach+0x108/0x3e0
    [<000000002968643e>] acpi_bus_scan+0xb0/0x110
    [<0000000010dd0bd7>] acpi_scan_init+0x1a8/0x410
    [<00000000965b3c5a>] acpi_init+0x408/0x49c
    [<00000000ed4b9fe2>] do_one_initcall+0x178/0x7f4
    [<00000000a5ac5a74>] kernel_init_freeable+0x9d4/0xa9c
    [<0000000070ea6c15>] kernel_init+0x18/0x138
    [<00000000fb8fff06>] ret_from_fork+0x10/0x1c
    [<0000000041273a0d>] 0xffffffffffffffff

Then, faddr2line pointed out this line,

/*
 * This memory isn't freed when the device is put,
 * I don't have a nice idea for that though.  Conceptually
 * dma_mask in struct device should not be a pointer.
 * See http://thread.gmane.org/gmane.linux.kernel.pci/9081
 */
pdev->dev.dma_mask =
	kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL);

Since this leak has existed for more than 8 years and it does not
reference other parts of the memory, let kmemleak ignore it, so users
don't need to waste time reporting this in the future.

Link: http://lkml.kernel.org/r/20181206160751.36211-1-cai@gmx.us
Signed-off-by: Qian Cai <cai@gmx.us>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/base/platform.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 14ff40371f013..f90b1b9bbad0d 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -27,6 +27,7 @@
 #include <linux/clk/clk-conf.h>
 #include <linux/limits.h>
 #include <linux/property.h>
+#include <linux/kmemleak.h>
 
 #include "base.h"
 #include "power/power.h"
@@ -516,6 +517,8 @@ struct platform_device *platform_device_register_full(
 		if (!pdev->dev.dma_mask)
 			goto err;
 
+		kmemleak_ignore(pdev->dev.dma_mask);
+
 		*pdev->dev.dma_mask = pdevinfo->dma_mask;
 		pdev->dev.coherent_dma_mask = pdevinfo->dma_mask;
 	}
-- 
2.20.1


  parent reply	other threads:[~2019-11-22  6:04 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22  6:00 [PATCH AUTOSEL 4.9 01/91] scsi: lpfc: Fix dif and first burst use in write commands Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 03/91] ARM: dts: imx53-voipac-dmm-668: Fix memory node duplication Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 04/91] parisc: Fix serio address output Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 05/91] parisc: Fix HP SDC hpa " Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 06/91] arm64: mm: Prevent mismatched 52-bit VA support Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 07/91] arm64: smp: Handle errors reported by the firmware Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 08/91] PM / AVS: SmartReflex: NULL check before some freeing functions is not needed Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 09/91] ARM: ks8695: fix section mismatch warning Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 10/91] ACPI / LPSS: Ignore acpi_device_fix_up_power() return value Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 11/91] crypto: user - support incremental algorithm dumps Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 12/91] mwifiex: fix potential NULL dereference and use after free Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 13/91] mwifiex: debugfs: correct histogram spacing, formatting Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 14/91] rtl818x: fix potential use after free Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 15/91] xfs: require both realtime inodes to mount Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 16/91] ubi: Put MTD device after it is not used Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 17/91] ubi: Do not drop UBI device reference before using Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 18/91] microblaze: adjust the help to the real behavior Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 19/91] microblaze: move "... is ready" messages to arch/microblaze/Makefile Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 20/91] gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 21/91] VSOCK: bind to random port for VMADDR_PORT_ANY Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 22/91] mtd: rawnand: sunxi: Write pageprog related opcodes to WCMD_SET Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 23/91] btrfs: only track ref_heads in delayed_ref_updates Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 24/91] HID: intel-ish-hid: fixes incorrect error handling Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 25/91] xen/pciback: Check dev_data before using it Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 26/91] pinctrl: xway: fix gpio-hog related boot issues Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 27/91] net/mlx5: Continue driver initialization despite debugfs failure Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 28/91] KVM: s390: unregister debug feature on failing arch init Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 29/91] pinctrl: sh-pfc: sh7264: Fix PFCR3 and PFCR0 register configuration Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 30/91] pinctrl: sh-pfc: sh7734: Fix shifted values in IPSR10 Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 31/91] HID: doc: fix wrong data structure reference for UHID_OUTPUT Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 32/91] dm flakey: Properly corrupt multi-page bios Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 33/91] gfs2: take jdata unstuff into account in do_grow Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 34/91] xfs: Align compat attrlist_by_handle with native implementation Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 35/91] xfs: Fix bulkstat compat ioctls on x32 userspace Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 36/91] IB/qib: Fix an error code in qib_sdma_verbs_send() Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 37/91] powerpc/book3s/32: fix number of bats in p/v_block_mapped() Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 38/91] powerpc/xmon: fix dump_segments() Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 39/91] drivers/regulator: fix a missing check of return value Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 40/91] serial: max310x: Fix tx_empty() callback Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 41/91] openrisc: Fix broken paths to arch/or32 Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 42/91] RDMA/srp: Propagate ib_post_send() failures to the SCSI mid-layer Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 43/91] scsi: qla2xxx: deadlock by configfs_depend_item Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 44/91] scsi: csiostor: fix incorrect dma device in case of vport Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 45/91] ath6kl: Only use match sets when firmware supports it Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 46/91] ath6kl: Fix off by one error in scan completion Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 47/91] powerpc/prom: fix early DEBUG messages Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 48/91] powerpc/mm: Make NULL pointer deferences explicit on bad page faults Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 49/91] powerpc/44x/bamboo: Fix PCI range Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 50/91] vfio/spapr_tce: Get rid of possible infinite loop Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 51/91] powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 52/91] drbd: ignore "all zero" peer volume sizes in handshake Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 53/91] drbd: reject attach of unsuitable uuids even if connected Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 54/91] drbd: do not block when adjusting "disk-options" while IO is frozen Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 55/91] drbd: fix print_st_err()'s prototype to match the definition Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 56/91] regulator: tps65910: fix a missing check of return value Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 57/91] powerpc/83xx: handle machine check caused by watchdog timer Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 58/91] powerpc/pseries: Fix node leak in update_lmb_associativity_index() Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 59/91] crypto: mxc-scc - fix build warnings on ARM64 Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 60/91] pwm: clps711x: Fix period calculation Sasha Levin
2019-11-22  6:00 ` [PATCH AUTOSEL 4.9 61/91] net/net_namespace: Check the return value of register_pernet_subsys() Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 62/91] um: Make GCOV depend on !KCOV Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 63/91] net: stmicro: fix a missing check of clk_prepare Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 64/91] net: dsa: bcm_sf2: Propagate error value from mdio_write Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 65/91] atl1e: checking the status of atl1e_write_phy_reg Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 66/91] tipc: fix a missing check of genlmsg_put Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 67/91] net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe() Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 68/91] ocfs2: clear journal dirty flag after shutdown journal Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 69/91] vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 70/91] lib/genalloc.c: fix allocation of aligned buffer from non-aligned chunk Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 71/91] lib/genalloc.c: use vzalloc_node() to allocate the bitmap Sasha Levin
2019-11-22  6:01 ` Sasha Levin [this message]
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 73/91] lib/genalloc.c: include vmalloc.h Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 74/91] mtd: Check add_mtd_device() ret code Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 75/91] tipc: fix memory leak in tipc_nl_compat_publ_dump Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 76/91] net/core/neighbour: tell kmemleak about hash tables Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 77/91] net/core/neighbour: fix kmemleak minimal reference count for " Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 78/91] sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 79/91] ip_tunnel: Make none-tunnel-dst tunnel port work with lwtunnel Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 80/91] decnet: fix DN_IFREQ_SIZE Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 81/91] tipc: fix skb may be leaky in tipc_link_input Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 82/91] sfc: initialise found bitmap in efx_ef10_mtd_probe Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 83/91] net: fix possible overflow in __sk_mem_raise_allocated() Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 84/91] sctp: don't compare hb_timer expire date before starting it Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 85/91] net: dev: Use unsigned integer as an argument to left-shift Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 86/91] iommu/amd: Fix NULL dereference bug in match_hid_uid Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 87/91] scsi: libsas: Support SATA PHY connection rate unmatch fixing during discovery Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 88/91] ACPI / APEI: Switch estatus pool to use vmalloc memory Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 89/91] scsi: libsas: Check SMP PHY control function result Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 90/91] powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property() Sasha Levin
2019-11-22  6:01 ` [PATCH AUTOSEL 4.9 91/91] mtd: Remove a debug trace in mtdpart.c Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191122060129.4239-71-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cai@gmx.us \
    --cc=catalin.marinas@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).