]> git.baikalelectronics.ru Git - kernel.git/commit
hibernate: Allow uswsusp to write to swap
authorDomenico Andreoli <domenico.andreoli@linux.com>
Mon, 23 Mar 2020 15:22:15 +0000 (08:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Apr 2020 08:36:34 +0000 (10:36 +0200)
commitf5bf18f51c2d216013057892bf7adef6dc354ac4
treeb828ca25008ae7c8e122144dfd246d4e9a841f5e
parent35c5cd092dbfb5a457a6c6bc191cd292e3654ee1
hibernate: Allow uswsusp to write to swap

[ Upstream commit 4da82c381be1e09050e42c26406d0a88cd59f8d9 ]

It turns out that there is one use case for programs being able to
write to swap devices, and that is the userspace hibernation code.

Quick fix: disable the S_SWAPFILE check if hibernation is configured.

Fixes: 11a2a23dcf0b ("vfs: don't allow writes to swap files")
Reported-by: Domenico Andreoli <domenico.andreoli@linux.com>
Reported-by: Marian Klein <mkleinsoft@gmail.com>
Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/block_dev.c