Re: swapfile security weakeness

Stephen C. Tweedie (sct@redhat.com)
Tue, 10 Nov 1998 14:15:24 GMT


Hi,

On Thu, 5 Nov 1998 20:39:18 +0100 (CET), Jakub Vlasek <www@pilsedu.cz>
said:

> i've found that active swapfile could be deleted, which is
> IMHO very dangerous (set immutable flag on in sys_swapon call?). Also,
> sys_swapon should check whether owner of swapfile is root and is readable
> only to root ( memory readableby anyone? hmm...)

2.0 or 2.1? I've just tried on 2.1.127 and it is working fine: the file
is unlinked but not deleted and the filesystem space remains reserved.

On Fri, 6 Nov 1998 08:40:01 +0100 (CET), Rik van Riel
<H.H.vanRiel@phys.uu.nl> said:

> Unfortunately, there are a few issues with that:
> - it doesn't work on inodeless FSes (msdosfs)

Not true. All filesystems have inodes.

> - you can't swapoff() a deleted file, leaving minor
> fs corruption on reboot (and major corruption on
> umsdos and the like)

That's no different to the normal case of rebooting with a file still
open. At least on ext2, the filesystem will automatically be re-fscked
on boot.

> - since you can't swapoff() the deleted file, you
> can't reclaim the disk space

The fsck will fix things up.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/