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]
Date:	Wed, 6 Jun 2012 20:37:20 -0400
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	Cesar Eduardo Barros <cesarb@...arb.net>
Cc:	linux-kernel@...r.kernel.org,
	Dan Magenheimer <dan.magenheimer@...cle.com>,
	linux-mm@...ck.org
Subject: Re: frontswap: is frontswap_init called from swapoff safe?

On Tue, Jun 05, 2012 at 07:41:52AM -0300, Cesar Eduardo Barros wrote:
> I was looking at the swapfile.c parts of the recently-merged
> frontswap, and noticed that frontswap_init can be called from
> swapoff when try_to_unuse fails.
> 
> This looks odd to me. Whether it is safe or not depends on what
> frontswap_ops.init does, but the comment for __frontswap_init
> ("Called when a swap device is swapon'd") and the function name
> itself seem to imply it should be called only for swapon, not when
> relinking the swap_info after a failed swapoff.

<nods>
> 
> In particular, if frontswap_ops.init assumes the swap map is empty,
> it would break, since as far as I know when try_to_unuse fails there
> are still pages in the swap.

Let me look at this - can't do it this week - but will get back to you
shortly.
> 
> (By the way, the comment above enable_swap_info at sys_swapoff needs
> to be updated to also explain why reading p->frontswap_map outside
> the lock is safe at that point, like it does for p->prio and
> p->swap_map.)
> 
> -- 
> Cesar Eduardo Barros
> cesarb@...arb.net
> cesar.barros@...il.com
--
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