linux-stable/include
Kefeng Wang b79ba5953f mm: memcg: fix NULL pointer in mem_cgroup_track_foreign_dirty_slowpath()
commit ac86f547ca upstream.

As commit 18365225f0 ("hwpoison, memcg: forcibly uncharge LRU pages"),
hwpoison will forcibly uncharg a LRU hwpoisoned page, the folio_memcg
could be NULl, then, mem_cgroup_track_foreign_dirty_slowpath() could
occurs a NULL pointer dereference, let's do not record the foreign
writebacks for folio memcg is null in mem_cgroup_track_foreign_dirty() to
fix it.

Link: https://lkml.kernel.org/r/20230129040945.180629-1-wangkefeng.wang@huawei.com
Fixes: 97b27821b4 ("writeback, memcg: Implement foreign dirty flushing")
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reported-by: Ma Wupeng <mawupeng1@huawei.com>
Tested-by: Miko Larsson <mikoxyzzz@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Ma Wupeng <mawupeng1@huawei.com>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-09 11:28:21 +01:00
..
acpi ACPI: Fix selecting wrong ACPI fwnode for the iGPU on some Dell laptops 2023-01-18 11:58:11 +01:00
asm-generic 15 hotfixes. 11 marked cc:stable. Only three or four of the latter 2022-12-02 13:39:38 -08:00
clocksource
crypto
drm drm/drm_vma_manager: Add drm_vma_node_allow_once() 2023-02-01 08:34:42 +01:00
dt-bindings dt-bindings: clocks: imx8mp: Add ID for usb suspend clock 2022-12-31 13:33:09 +01:00
keys
kunit kunit: fix kunit_test_init_section_suites(...) 2023-02-09 11:28:08 +01:00
kvm
linux mm: memcg: fix NULL pointer in mem_cgroup_track_foreign_dirty_slowpath() 2023-02-09 11:28:21 +01:00
math-emu
media media: dvbdev: fix build warning due to comments 2022-12-31 13:33:12 +01:00
memory
misc
net wifi: mac80211: Proper mark iTXQs for resumption 2023-02-01 08:34:35 +01:00
pcmcia
ras
rdma
rv
scsi scsi: iscsi_tcp: Fix UAF during logout when accessing the shost ipaddress 2023-02-09 11:28:12 +01:00
soc ARM: at91: pm: avoid soft resetting AC DLL 2022-11-01 12:25:19 +02:00
sound ALSA: hda/hdmi: fix stream-id config keep-alive for rt suspend 2022-12-31 13:33:07 +01:00
target
trace btrfs: fix trace event name typo for FLUSH_DELAYED_REFS 2023-01-24 07:24:30 +01:00
uapi netfilter: conntrack: unify established states for SCTP paths 2023-02-01 08:34:51 +01:00
ufs scsi: ufs: core: Fix devfreq deadlocks 2023-02-01 08:34:39 +01:00
vdso
video
xen