All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	syzbot+f90a420dfe2b1b03cb2c@syzkaller.appspotmail.com,
	Shakeel Butt <shakeelb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	Kirill Tkhai <ktkhai@virtuozzo.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH 4.19 14/75] mm/list_lru.c: fix memory leak in __memcg_init_list_lru_node
Date: Mon, 17 Jun 2019 23:09:25 +0200	[thread overview]
Message-ID: <20190617210753.425090475@linuxfoundation.org> (raw)
In-Reply-To: <20190617210752.799453599@linuxfoundation.org>

From: Shakeel Butt <shakeelb@google.com>

commit 3510955b327176fd4cbab5baa75b449f077722a2 upstream.

Syzbot reported following memory leak:

ffffffffda RBX: 0000000000000003 RCX: 0000000000441f79
BUG: memory leak
unreferenced object 0xffff888114f26040 (size 32):
  comm "syz-executor626", pid 7056, jiffies 4294948701 (age 39.410s)
  hex dump (first 32 bytes):
    40 60 f2 14 81 88 ff ff 40 60 f2 14 81 88 ff ff  @`......@`......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
     slab_post_alloc_hook mm/slab.h:439 [inline]
     slab_alloc mm/slab.c:3326 [inline]
     kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553
     kmalloc include/linux/slab.h:547 [inline]
     __memcg_init_list_lru_node+0x58/0xf0 mm/list_lru.c:352
     memcg_init_list_lru_node mm/list_lru.c:375 [inline]
     memcg_init_list_lru mm/list_lru.c:459 [inline]
     __list_lru_init+0x193/0x2a0 mm/list_lru.c:626
     alloc_super+0x2e0/0x310 fs/super.c:269
     sget_userns+0x94/0x2a0 fs/super.c:609
     sget+0x8d/0xb0 fs/super.c:660
     mount_nodev+0x31/0xb0 fs/super.c:1387
     fuse_mount+0x2d/0x40 fs/fuse/inode.c:1236
     legacy_get_tree+0x27/0x80 fs/fs_context.c:661
     vfs_get_tree+0x2e/0x120 fs/super.c:1476
     do_new_mount fs/namespace.c:2790 [inline]
     do_mount+0x932/0xc50 fs/namespace.c:3110
     ksys_mount+0xab/0x120 fs/namespace.c:3319
     __do_sys_mount fs/namespace.c:3333 [inline]
     __se_sys_mount fs/namespace.c:3330 [inline]
     __x64_sys_mount+0x26/0x30 fs/namespace.c:3330
     do_syscall_64+0x76/0x1a0 arch/x86/entry/common.c:301
     entry_SYSCALL_64_after_hwframe+0x44/0xa9

This is a simple off by one bug on the error path.

Link: http://lkml.kernel.org/r/20190528043202.99980-1-shakeelb@google.com
Fixes: 60d3fd32a7a9 ("list_lru: introduce per-memcg lists")
Reported-by: syzbot+f90a420dfe2b1b03cb2c@syzkaller.appspotmail.com
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: <stable@vger.kernel.org>	[4.0+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/list_lru.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/list_lru.c
+++ b/mm/list_lru.c
@@ -353,7 +353,7 @@ static int __memcg_init_list_lru_node(st
 	}
 	return 0;
 fail:
-	__memcg_destroy_list_lru_node(memcg_lrus, begin, i - 1);
+	__memcg_destroy_list_lru_node(memcg_lrus, begin, i);
 	return -ENOMEM;
 }
 



  parent reply	other threads:[~2019-06-17 21:24 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 21:09 [PATCH 4.19 00/75] 4.19.53-stable review Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 01/75] drm/nouveau: add kconfig option to turn off nouveau legacy contexts. (v3) Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 02/75] nouveau: Fix build with CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT disabled Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 03/75] HID: multitouch: handle faulty Elo touch device Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 04/75] HID: wacom: Dont set tool type until were in range Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 05/75] HID: wacom: Dont report anything prior to the tool entering range Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 06/75] HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 07/75] HID: wacom: Correct button numbering 2nd-gen Intuos Pro over Bluetooth Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 08/75] HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 09/75] Revert "ALSA: hda/realtek - Improve the headset mic for Acer Aspire laptops" Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 10/75] ALSA: oxfw: allow PCM capture for Stanton SCS.1m Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 11/75] ALSA: hda/realtek - Update headset mode for ALC256 Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 12/75] ALSA: firewire-motu: fix destruction of data for isochronous resources Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 13/75] libata: Extend quirks for the ST1000LM024 drives with NOLPM quirk Greg Kroah-Hartman
2019-06-17 21:09 ` Greg Kroah-Hartman [this message]
2019-06-17 21:09 ` [PATCH 4.19 15/75] fs/ocfs2: fix race in ocfs2_dentry_attach_lock() Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 16/75] mm/vmscan.c: fix trying to reclaim unevictable LRU page Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 17/75] [PATCH] signal/ptrace: Dont leak unitialized kernel memory with PTRACE_PEEK_SIGINFO Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 18/75] ptrace: restore smp_rmb() in __ptrace_may_access() Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 19/75] iommu/arm-smmu: Avoid constant zero in TLBI writes Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 20/75] i2c: acorn: fix i2c warning Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 21/75] bcache: fix stack corruption by PRECEDING_KEY() Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 22/75] bcache: only set BCACHE_DEV_WB_RUNNING when cached device attached Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 23/75] cgroup: Use css_tryget() instead of css_tryget_online() in task_get_css() Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 24/75] ASoC: cs42xx8: Add regcache mask dirty Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 25/75] ASoC: fsl_asrc: Fix the issue about unsupported rate Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 26/75] drm/i915/sdvo: Implement proper HDMI audio support for SDVO Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 27/75] x86/uaccess, kcov: Disable stack protector Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 28/75] ALSA: seq: Protect in-kernel ioctl calls with mutex Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 29/75] ALSA: seq: Fix race of get-subscription call vs port-delete ioctls Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 30/75] Revert "ALSA: seq: Protect in-kernel ioctl calls with mutex" Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 31/75] s390/kasan: fix strncpy_from_user kasan checks Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 32/75] Drivers: misc: fix out-of-bounds access in function param_set_kgdbts_var Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 33/75] f2fs: fix to avoid accessing xattr across the boundary Greg Kroah-Hartman
2019-06-19 12:32   ` Pavel Machek
2019-06-20  1:46     ` Chao Yu
2019-06-17 21:09 ` [PATCH 4.19 34/75] scsi: qedi: remove memset/memcpy to nfunc and use func instead Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 35/75] scsi: qedi: remove set but not used variables cdev and udev Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 36/75] scsi: lpfc: correct rcu unlock issue in lpfc_nvme_info_show Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 37/75] scsi: lpfc: add check for loss of ndlp when sending RRQ Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 38/75] arm64/mm: Inhibit huge-vmap with ptdump Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 39/75] nvme: fix srcu locking on error return in nvme_get_ns_from_disk Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 40/75] nvme: remove the ifdef around nvme_nvm_ioctl Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 41/75] nvme: merge nvme_ns_ioctl into nvme_ioctl Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 42/75] nvme: release namespace SRCU protection before performing controller ioctls Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 43/75] nvme: fix memory leak for power latency tolerance Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 44/75] platform/x86: pmc_atom: Add Lex 3I380D industrial PC to critclk_systems DMI table Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 45/75] platform/x86: pmc_atom: Add several Beckhoff Automation boards " Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 46/75] scsi: bnx2fc: fix incorrect cast to u64 on shift operation Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 47/75] libnvdimm: Fix compilation warnings with W=1 Greg Kroah-Hartman
2019-06-17 21:09 ` [PATCH 4.19 48/75] selftests: fib_rule_tests: fix local IPv4 address typo Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 49/75] selftests/timers: Add missing fflush(stdout) calls Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 50/75] tracing: Prevent hist_field_var_ref() from accessing NULL tracing_map_elts Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 51/75] usbnet: ipheth: fix racing condition Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 52/75] KVM: arm/arm64: Move cc/it checks under hyps Makefile to avoid instrumentation Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 53/75] KVM: x86/pmu: mask the result of rdpmc according to the width of the counters Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 54/75] KVM: x86/pmu: do not mask the value that is written to fixed PMUs Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 55/75] KVM: s390: fix memory slot handling for KVM_SET_USER_MEMORY_REGION Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 56/75] tools/kvm_stat: fix fields filter for child events Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 57/75] drm/vmwgfx: integer underflow in vmw_cmd_dx_set_shader() leading to an invalid read Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 58/75] drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define() Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 59/75] usb: dwc2: Fix DMA cache alignment issues Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 60/75] usb: dwc2: host: Fix wMaxPacketSize handling (fix webcam regression) Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 61/75] USB: Fix chipmunk-like voice when using Logitech C270 for recording audio Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 62/75] USB: usb-storage: Add new ID to ums-realtek Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 63/75] USB: serial: pl2303: add Allied Telesis VT-Kit3 Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 64/75] USB: serial: option: add support for Simcom SIM7500/SIM7600 RNDIS mode Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 65/75] USB: serial: option: add Telit 0x1260 and 0x1261 compositions Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 66/75] timekeeping: Repair ktime_get_coarse*() granularity Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 67/75] RAS/CEC: Convert the timer callback to a workqueue Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 68/75] RAS/CEC: Fix binary search function Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 69/75] x86/microcode, cpuhotplug: Add a microcode loader CPU hotplug callback Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 70/75] x86/kasan: Fix boot with 5-level paging and KASAN Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 71/75] x86/mm/KASLR: Compute the size of the vmemmap section properly Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 72/75] x86/resctrl: Prevent NULL pointer dereference when local MBM is disabled Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 73/75] drm/edid: abstract override/firmware EDID retrieval Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 74/75] drm: add fallback override/firmware EDID modes workaround Greg Kroah-Hartman
2019-06-17 21:10 ` [PATCH 4.19 75/75] rtc: pcf8523: dont return invalid date when battery is low Greg Kroah-Hartman
2019-06-18  2:10 ` [PATCH 4.19 00/75] 4.19.53-stable review kernelci.org bot
2019-06-18  7:44 ` Naresh Kamboju
2019-06-18 13:42 ` shuah
2019-06-18 16:37 ` Guenter Roeck
2019-06-19  8:45 ` Jon Hunter
2019-06-19  8:45   ` Jon Hunter

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=20190617210753.425090475@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=ktkhai@virtuozzo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=shakeelb@google.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+f90a420dfe2b1b03cb2c@syzkaller.appspotmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.