]> git.baikalelectronics.ru Git - kernel.git/commit
drm/panfrost: Fix shrinker list corruption by madvise IOCTL
authorDmitry Osipenko <dmitry.osipenko@collabora.com>
Thu, 30 Jun 2022 20:06:01 +0000 (23:06 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 18:59:18 +0000 (20:59 +0200)
commita308ef1ba83517c0f2e6c21c27b1d67e27db3fa8
treea5c2da10e614726a61b434cfc2a3ef7be7b55ea4
parentbf0618503bfbb1f4662af262fb935ed3a5c93cad
drm/panfrost: Fix shrinker list corruption by madvise IOCTL

commit 2a8a8168bf8cf94390e5f96442e7dc2f1f94f00c upstream.

Calling madvise IOCTL twice on BO causes memory shrinker list corruption
and crashes kernel because BO is already on the list and it's added to
the list again, while BO should be removed from the list before it's
re-added. Fix it.

Cc: stable@vger.kernel.org
Fixes: 9fbf9ddf49d3 ("drm/panfrost: Add madvise and shrinker support")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220630200601.1884120-3-dmitry.osipenko@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/panfrost/panfrost_drv.c