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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZlSDinoWgqLt21QD@infradead.org>
Date: Mon, 27 May 2024 05:58:50 -0700
From: Christoph Hellwig <hch@...radead.org>
To: "Sukrit.Bhatnagar@...y.com" <Sukrit.Bhatnagar@...y.com>
Cc: Christoph Hellwig <hch@...radead.org>, Pavel Machek <pavel@....cz>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Christian Brauner <brauner@...nel.org>,
	"Darrick J. Wong" <djwong@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH 0/2] Improve dmesg output for swapfile+hibernation

On Mon, May 27, 2024 at 12:51:07PM +0000, Sukrit.Bhatnagar@...y.com wrote:
> In my understanding, the resume offset in hibernate is used as follows.
> 
> Suspend
> - Hibernate looks up the swap/swapfile using the details we pass in the
>   sysfs entries, in the function swsusp_swap_check():
>   * /sys/power/resume - path/uuid/major:minor of the swap partition (or
>                         non-swap partition for swapfile)
>   * /sys/power/resume_offset - physical offset of the swapfile in that
>                                partition
>   * If no resume device is specified, it just uses the first available swap!
> - It then proceeds to write the image to the specified swap.
>   (The allocation of swap pages is done by the swapfile code internally.)

Where "it" is userspace code?  If so, that already seems unsafe for
a swap device, but definitely is a no-go for a swapfile.

> - Hibernate gets the partition and offset values from kernel command-line
>   parameters "resume" and "resume_offset" (which must be set from
>   userspace, not ideal).

Or is it just for these parameters?  In which case we "only" need to
specify the swap file, which would then need code in the file system
driver to resolve the logical to physical mapping as swap files don't
need to be contiguous.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ