Re: mlock(1)

From: Andrea Arcangeli
Date: Fri Sep 24 2004 - 21:17:54 EST


On Fri, Sep 24, 2004 at 09:46:59PM -0400, Valdis.Kletnieks@xxxxxx wrote:
> On Sat, 25 Sep 2004 03:30:13 +0200, Andrea Arcangeli said:
> > On Fri, Sep 24, 2004 at 06:21:27PM -0700, David Lang wrote:
> > > if you don't do a -c mkswap runs fast enough that it shouldn't be a
> > > problem to do it every boot.
> >
> > yep, speed isn't my worry, my worry is a misconfigured /etc/fstab wiping
> > out a filesystem...
>
> If the mkswap doesn't nuke the filesystem, the first time we actually
> send a page to swap will do the job. Plus, there's more chance of paging

how can a page be sent to swap if sys_swapon refuses to run? The whole
point of avoiding running mkswap is to forbid sys_swapon to run.

> Maybe have mkswap check the partition table and not do it if the partition
> isn't id=82 (Linux swap) unless -f is specified? Not sure what to do if
> the space is a loop or LVM device though.....

or also if you mkswap on the whole device without partitions.

doing crypto-swap with cryptoapi inside the swap layer (without using
cryptoloop and dm-crypt) with a transparently randomly choosen password
and the metadata written in cleartext sounds just a lot cleaner and
safer.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/