lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200707171354.46957.rjw@sisk.pl>
Date:	Tue, 17 Jul 2007 13:54:45 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	david@...g.hm
Cc:	Joseph Fannin <jfannin@...il.com>,
	Oliver Neukum <oliver@...kum.org>,
	Jeremy Maitin-Shepard <jbms@....edu>,
	"Huang, Ying" <ying.huang@...el.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Pavel Machek <pavel@....cz>, nigel@...el.suspend2.net,
	linux-kernel@...r.kernel.org, linux-pm@...ts.linux-foundation.org
Subject: Re: Hibernating To Swap Considered Harmful

On Tuesday, 17 July 2007 09:34, david@...g.hm wrote:
> On Tue, 17 Jul 2007, Joseph Fannin wrote:
> 
> > On Mon, Jul 16, 2007 at 11:42:08PM -0700, david@...g.hm wrote:
> >> On Tue, 17 Jul 2007, Joseph Fannin wrote:
> >
> >>> root is free to "dd if=/dev/random of=/dev/mem".  Root owned
> >>> daemons which do bad things are bugs.
> >>
> >> in this case it would be more like
> >>
> >> dd if=/block0 of=/dev/sda1 count=1 bs=4096 skip=5000
> >> dd if=/block1 of=/dev/sda1 count=1 bs=4096 skip=5050
> >> dd if=/block2 of=/dev/sda1 count=1 bs=4096 skip=5400
> >> etc
> >>
> >> to write the blocks to the raw parition in the right place
> >
> > What I meant by that was that root is allowed to shoot himself in the
> > foot.  Nothing stops root from opening a swap/hibernate file, which
> > would put it in cache, and cause it to be inconsistant if a
> > hibernation image was written to it behind the kernel's back.
> >
> > That would be a very stupid thing to do, however.  There's no reason
> > to open that file, unless you know *exactly* what you are doing, in
> > which case the onus is on you to get it right.
> >
> > But you have a point.  The swap file could be very fragmented.  It
> > might often be so, even.
> >
> > Still, is this better than exporting the kernel's swap internals
> > (which has never been a public interface before)?
> >
> > Does it make the interface that writing hibernation images to swap
> > imposes any better?
> >
> > Even if hibernation files are no less complicated to support than
> > hibernating to swap files (which isn't a forgone conclusion) , there
> > are plenty of reasons writing hibernation images to swap doesn't make
> > sense.
> >
> >
> >>> Again, supporting swap files (*which is not optional*) requires the
> >>> very same support.
> >>
> >> in the kexec model why would the second kernel care about swap files at
> >> all? (unles it chooses to write to them, in which case it is exactly the
> >> same support, but unless it writes to them it doesn't need to care)
> >
> > My point is that no extra work is required to write hibernation images
> > to dedicated files than to write hibernation images to swap files.
> >
> > If swap files are to be supported, then, there's no technical reason
> > not to support dedicated hibernation files.  Dedicated hibernation
> > files are better, and there's no reason not to implement them.
> 
> I agree with your point, but the reverse is not true, the ability to write 
> to a dedicated hibernation file does not produce the capacity to write to 
> a swap file, and I do question the 'requirement' to write the hibernation 
> image to the swap file.

There's no such requirement, it's just been easier to implement.

Greetings,
Rafael


-- 
"Premature optimization is the root of all evil." - Donald Knuth
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ