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: <Pine.LNX.4.64.0910011252220.13515@sister.anvils>
Date:	Thu, 1 Oct 2009 12:53:14 +0100 (BST)
From:	Hugh Dickins <hugh.dickins@...cali.co.uk>
To:	Suresh Jayaraman <sjayaraman@...e.de>
cc:	Rafael Wysocki <rjw@...k.pl>, Jens Axboe <axboe@...nel.dk>,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] swapfile: avoid NULL pointer dereference in swapon when
 s_bdev is NULL

On Thu, 1 Oct 2009, Suresh Jayaraman wrote:
> 
> Yeah, perhaps. I stumbled upon one more of such error - a NULL pointer
> dereference in blkdev_issue_discard() called from get_swap_page() when I ran
> memhog, a simple program to generate a memory hog with Swap over NFS patches.
> 
> The call sequence is add_to_swap() -> get_swap_page() ->  scan_swap_map()
> -> discard_swap_cluster() -> blkdev_issue_discard().
> 
> Wrapping the code around a NULL check fixes the Oops for me.

That's odd: scan_swap_map() should only discard_swap_cluster() if
SWP_DISCARDABLE got set, and your first patch made sure that it wasn't.

So I don't think this second patch should be necessary: you did have
your first applied when you found this?

I wonder if there's a funny little issue like si->lowest_alloc not
being reset to 0 where it should be.  Were you switching between
NFS swap and SSD swap in your testing?

Hugh
--
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