Commit 4e23aaf2 authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Cheng Jian
Browse files

vfs: don't allow writes to swap files



mainline inclusion
from mainline-5.4-rc1
commit dc617f29
category: bugfix
bugzilla: 50612
CVE: NA
---------------------------

Don't let userspace write to an active swap file because the kernel
effectively has a long term lease on the storage and things could get
seriously corrupted if we let this happen.

Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>

Conflict:
  include/linux/fs.h
  mm/filemap.c
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 af2457f4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment