Commit 61057764 authored by Domenico Andreoli's avatar Domenico Andreoli Committed by Cheng Jian
Browse files

hibernate: Allow uswsusp to write to swap



mainline inclusion
from mainline-5.7-rc1
commit 56939e01
category: bugfix
bugzilla: 50612
CVE: NA
---------------------------

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: dc617f29 ("vfs: don't allow writes to swap files")
Reported-by: default avatarDomenico Andreoli <domenico.andreoli@linux.com>
Reported-by: default avatarMarian Klein <mkleinsoft@gmail.com>
Signed-off-by: default avatarDomenico Andreoli <domenico.andreoli@linux.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: default avatarYang Erkun <yangerkun@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarCheng Jian <cj.chengjian@huawei.com>
parent 70d7dd5d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment