linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] vfs: make active swap files unwritable
@ 2019-08-15 16:05 Darrick J. Wong
  2019-08-15 16:05 ` [PATCH 1/2] mm: set S_SWAPFILE on blockdev swap devices Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Darrick J. Wong @ 2019-08-15 16:05 UTC (permalink / raw)
  To: hch, akpm, tytso, viro, darrick.wong
  Cc: linux-xfs, linux-fsdevel, linux-kernel, linux-mm

Hi all,

I discovered that it's possible for userspace to write to active swap
files and swap devices.  While activated, the kernel effectively holds
an irrevocable (except by swapoff) longterm lease on the storage
associated with the swap device, so we need to shut down this vector for
memory corruption of userspace programs.

Nothing new for v3 other than rebasing against 5.3-rc4.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This has been lightly tested with fstests.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=immutable-swapfiles

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=immutable-swapfiles

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH v2 0/2] vfs: make active swap files unwritable
@ 2019-06-28 18:35 Darrick J. Wong
  2019-06-28 18:35 ` [PATCH 2/2] vfs: don't allow writes to swap files Darrick J. Wong
  0 siblings, 1 reply; 13+ messages in thread
From: Darrick J. Wong @ 2019-06-28 18:35 UTC (permalink / raw)
  To: hch, akpm, tytso, viro, darrick.wong
  Cc: linux-xfs, linux-fsdevel, linux-kernel, linux-mm

Hi all,

I discovered that it's possible for userspace to write to active swap
files and swap devices.  While activated, the kernel effectively holds
an irrevocable (except by swapoff) longterm lease on the storage
associated with the swap device, so we need to shut down this vector for
memory corruption of userspace programs.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This has been lightly tested with fstests.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=immutable-swapfiles

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=immutable-swapfiles

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-08-18  8:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15 16:05 [PATCH v3 0/2] vfs: make active swap files unwritable Darrick J. Wong
2019-08-15 16:05 ` [PATCH 1/2] mm: set S_SWAPFILE on blockdev swap devices Darrick J. Wong
2019-08-16  6:39   ` Christoph Hellwig
2019-08-15 16:05 ` [PATCH 2/2] vfs: don't allow writes to swap files Darrick J. Wong
2019-08-16  6:41   ` Christoph Hellwig
2019-08-16  6:48     ` Darrick J. Wong
2019-08-16 16:19   ` [PATCH v2 " Darrick J. Wong
2019-08-18  8:39     ` Christoph Hellwig
2019-08-15 16:34 ` [PATCH RFC 3/2] fstests: check that we can't write " Darrick J. Wong
2019-08-15 21:26   ` Andrew Morton
2019-08-16  2:13     ` Darrick J. Wong
2019-08-17  2:05   ` [PATCH v2 " Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2019-06-28 18:35 [PATCH v2 0/2] vfs: make active swap files unwritable Darrick J. Wong
2019-06-28 18:35 ` [PATCH 2/2] vfs: don't allow writes to swap files Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).