Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.security > #92 > unrolled thread

tmps and swap

Started byGünther Schwarz <strap@gmx.de>
First post2012-02-07 20:50 +0000
Last post2012-02-09 21:51 +0000
Articles 10 — 6 participants

Back to article view | Back to comp.os.linux.security


Contents

  tmps and swap Günther Schwarz <strap@gmx.de> - 2012-02-07 20:50 +0000
    Re: tmps and swap Lew Pitcher <lpitcher@teksavvy.com> - 2012-02-07 16:15 -0500
      Re: tmps and swap Günther Schwarz <strap@gmx.de> - 2012-02-07 23:01 +0000
        Re: tmps and swap Alexander Schreiber <als@usenet.thangorodrim.de> - 2012-05-31 21:52 +0200
    Re: tmps and swap Richard Kettlewell <rjk@greenend.org.uk> - 2012-02-07 22:40 +0000
      Re: tmps and swap Günther Schwarz <strap@gmx.de> - 2012-02-07 23:01 +0000
        Re: tmps and swap "Stachu 'Dozzie' K." <dozzie@go.eat.some.screws.spammer.invalid> - 2012-02-08 09:18 +0000
          Re: tmps and swap Günther Schwarz <strap@gmx.de> - 2012-02-09 21:51 +0000
    Re: tmps and swap Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2012-02-08 00:34 +0100
      Re: tmps and swap Günther Schwarz <strap@gmx.de> - 2012-02-09 21:51 +0000

#92 — tmps and swap

FromGünther Schwarz <strap@gmx.de>
Date2012-02-07 20:50 +0000
Subjecttmps and swap
Message-ID<9pdh5dF5ksU1@mid.individual.net>
Any hints on how to prevent a tmpfs file system to be written to the swap 
partition? Other than omitting a swap partition completely, of course. I 
do not want some files to end up on the hard disk.

Günther

[toc] | [next] | [standalone]


#93

FromLew Pitcher <lpitcher@teksavvy.com>
Date2012-02-07 16:15 -0500
Message-ID<gwgYq.199$hJ4.174@newsfe20.iad>
In reply to#92
On Tuesday 07 February 2012 15:50, in comp.os.linux.security, strap@gmx.de
wrote:

> Any hints on how to prevent a tmpfs file system to be written to the swap
> partition? Other than omitting a swap partition completely, of course. I
> do not want some files to end up on the hard disk.

I'm afraid that you can't do that.

To quote /usr/src/linux/Documentation/filesystems/tmpfs.txt
  "Since tmpfs lives completely in the page cache and on swap, all tmpfs
   pages currently in memory will show up as cached."

tmpfs lives in cache and swap. There are no tmpfs tuning parameters to
prevent tmpfs pages from being written to swap (mount(8) only lists size=,
nr_blocks=, nr_inodes, and mode= (initial permissions) ), tmpfs will be
written to swap, with the same rules as any other cache.

Sorry
-- 
Lew Pitcher

[toc] | [prev] | [next] | [standalone]


#95

FromGünther Schwarz <strap@gmx.de>
Date2012-02-07 23:01 +0000
Message-ID<9pdopqF5ksU3@mid.individual.net>
In reply to#93
Lew Pitcher wrote:

> On Tuesday 07 February 2012 15:50, in comp.os.linux.security,
> strap@gmx.de wrote:
> 
>> Any hints on how to prevent a tmpfs file system to be written to the
>> swap partition? Other than omitting a swap partition completely, of
>> course. I do not want some files to end up on the hard disk.
> 
> I'm afraid that you can't do that.
> 
> To quote /usr/src/linux/Documentation/filesystems/tmpfs.txt
>   "Since tmpfs lives completely in the page cache and on swap, all tmpfs
>    pages currently in memory will show up as cached."

Thanks a lot for the clarification. So this is how I did suspect it to 
be. I will have to live with a small risk. No risk, no fun.  
 
Günther

[toc] | [prev] | [next] | [standalone]


#130

FromAlexander Schreiber <als@usenet.thangorodrim.de>
Date2012-05-31 21:52 +0200
Message-ID<slrnjsfj0e.tr9.als@mordor.angband.thangorodrim.de>
In reply to#95
Günther Schwarz <strap@gmx.de> wrote:
> Lew Pitcher wrote:
>
>> On Tuesday 07 February 2012 15:50, in comp.os.linux.security,
>> strap@gmx.de wrote:
>> 
>>> Any hints on how to prevent a tmpfs file system to be written to the
>>> swap partition? Other than omitting a swap partition completely, of
>>> course. I do not want some files to end up on the hard disk.
>> 
>> I'm afraid that you can't do that.
>> 
>> To quote /usr/src/linux/Documentation/filesystems/tmpfs.txt
>>   "Since tmpfs lives completely in the page cache and on swap, all tmpfs
>>    pages currently in memory will show up as cached."
>
> Thanks a lot for the clarification. So this is how I did suspect it to 
> be. I will have to live with a small risk. No risk, no fun.  

Well, you could
 - use RAM disk instead
 - encrypt swap with a random key (set up freshly from /dev/urandom
   at every boot and not stored anywhere)

Kind regards,
           Alex.
-- 
"Opportunity is missed by most people because it is dressed in overalls and
 looks like work."                                      -- Thomas A. Edison

[toc] | [prev] | [next] | [standalone]


#94

FromRichard Kettlewell <rjk@greenend.org.uk>
Date2012-02-07 22:40 +0000
Message-ID<874nv2qnbj.fsf@araminta.anjou.terraraq.org.uk>
In reply to#92
Günther Schwarz <strap@gmx.de> writes:
> Any hints on how to prevent a tmpfs file system to be written to the swap 
> partition? Other than omitting a swap partition completely, of course. I 
> do not want some files to end up on the hard disk.

Encrypted swap, with a throwaway key generated on boot?

-- 
http://www.greenend.org.uk/rjk/

[toc] | [prev] | [next] | [standalone]


#96

FromGünther Schwarz <strap@gmx.de>
Date2012-02-07 23:01 +0000
Message-ID<9pdoqsF5ksU4@mid.individual.net>
In reply to#94
Richard Kettlewell wrote:

> Günther Schwarz <strap@gmx.de> writes:
>> Any hints on how to prevent a tmpfs file system to be written to the
>> swap partition? Other than omitting a swap partition completely, of
>> course. I do not want some files to end up on the hard disk.
> 
> Encrypted swap, with a throwaway key generated on boot?

Do you have a link on a howto for that? I need unassisted boot up, so 
typing a password at boot time is not an option.

Günther

[toc] | [prev] | [next] | [standalone]


#98

From"Stachu 'Dozzie' K." <dozzie@go.eat.some.screws.spammer.invalid>
Date2012-02-08 09:18 +0000
Message-ID<slrnjj4fe6.j5o.dozzie@jarowit.net>
In reply to#96
On 2012-02-07, Günther Schwarz <strap@gmx.de> wrote:
> Richard Kettlewell wrote:
>
>> Günther Schwarz <strap@gmx.de> writes:
>>> Any hints on how to prevent a tmpfs file system to be written to the
>>> swap partition? Other than omitting a swap partition completely, of
>>> course. I do not want some files to end up on the hard disk.
>> 
>> Encrypted swap, with a throwaway key generated on boot?
>
> Do you have a link on a howto for that? I need unassisted boot up, so 
> typing a password at boot time is not an option.

http://www.google.com/search?q=encrypted+swap+linux+howto

-- 
Secunia non olet.
Stanislaw Klekot

[toc] | [prev] | [next] | [standalone]


#99

FromGünther Schwarz <strap@gmx.de>
Date2012-02-09 21:51 +0000
Message-ID<9pitegF61gU1@mid.individual.net>
In reply to#98
Stachu 'Dozzie' K. wrote:

> On 2012-02-07, Günther Schwarz <strap@gmx.de> wrote:
>> Richard Kettlewell wrote:
>>
>>> Günther Schwarz <strap@gmx.de> writes:
>>>> Any hints on how to prevent a tmpfs file system to be written to the
>>>> swap partition? Other than omitting a swap partition completely, of
>>>> course. I do not want some files to end up on the hard disk.
>>> 
>>> Encrypted swap, with a throwaway key generated on boot?
>>
>> Do you have a link on a howto for that? I need unassisted boot up, so
>> typing a password at boot time is not an option.
> 
> http://www.google.com/search?q=encrypted+swap+linux+howto

This is interesting, thanks a lot. The swap partition set up with a key 
from /dev/urandom might well solve some other issues related to the swap 
partition. I will give it a try.

Günther

[toc] | [prev] | [next] | [standalone]


#97

FromPascal Hambourg <boite-a-spam@plouf.fr.eu.org>
Date2012-02-08 00:34 +0100
Message-ID<jgscf0$22d2$1@saria.nerim.net>
In reply to#92
Hello,

Günther Schwarz a écrit :
> Any hints on how to prevent a tmpfs file system to be written to the swap 
> partition? Other than omitting a swap partition completely, of course. I 
> do not want some files to end up on the hard disk.

You can use ramfs instead of tmpfs. But the drawback is that you cannot
limit the size. See Documentation/filesystems/ramfs-rootfs-initramfs.txt

[toc] | [prev] | [next] | [standalone]


#100

FromGünther Schwarz <strap@gmx.de>
Date2012-02-09 21:51 +0000
Message-ID<9piteiF61gU2@mid.individual.net>
In reply to#97
Pascal Hambourg wrote:

> Günther Schwarz a écrit :
>> Any hints on how to prevent a tmpfs file system to be written to the
>> swap partition? Other than omitting a swap partition completely, of
>> course. I do not want some files to end up on the hard disk.
> 
> You can use ramfs instead of tmpfs. But the drawback is that you cannot
> limit the size. See Documentation/filesystems/ramfs-rootfs-initramfs.txt

An interesting option also. But it might be too easy for an user to fill 
the memory completely. I will first try with an encrypted swap with a key 
form /dev/urandom as suggested by Stachu.

Günther

[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.linux.security


csiph-web