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] [day] [month] [year] [list]
Message-ID: <20100816154443.GA9860@redhat.com>
Date:	Mon, 16 Aug 2010 11:44:43 -0400
From:	Mike Snitzer <snitzer@...hat.com>
To:	Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Jens Axboe <jaxboe@...ionio.com>,
	unsik Kim <donari75@...il.com>,
	Martin Schwidefsky <mschwid2@...ux.vnet.ibm.com>,
	Heiko Carstens <heicars2@...ux.vnet.ibm.com>
Subject: Re: Switching block device elevators

On Mon, Aug 16 2010 at 10:52am -0400,
Peter Oberparleiter <oberpar@...ux.vnet.ibm.com> wrote:

> After commit 1abec4fdbb142e3ccb6ce99832fae42129134a96, "block: make
> blk_init_free_list and elevator_init idempotent", we're seeing
> kernel panics in our s390 tape block device driver. The panic is
> triggered because our driver tries to replace the default elevator
> with a noop elevator by calling elevator_exit() directly followed by
> elevator_init().

Maybe we should look to export elevator_switch() -- rather than
confining its use to the sysfs interface.

> Since the commit, elevator_init() returns 0 if
> request_queue->elevator is non-null, even though it does not install
> a new elevator. As a result, the next access to the elevator finds a
> pointer to the old one which was already freed and a panic is
> triggered. Our current fix consists of setting the elevator pointer
> to NULL after elevator_exit().

elevator_exit() triggers a call, via kobj, to elevator_release() which
doesn't have access to the request_queue to reset it.

Unfortunately, commit 1abec4fdbb imposes that the elevator_exit() caller
must take care to reset q->elevator to NULL -- like dasd_alloc_queue()
does.

Though I suppose we _could_ pass request_queue to elevator_exit.

> There is at least one other driver where the problem currently
> exists (drivers/block/mg_disk.c, author on cc) and another s390
> driver where the problem was only accidentally fixed before 2.6.35.
> I'm wondering if there's a better solution (apart from not forcing
> an elevator) and would like to hear everyone's opinion on this
> matter. How about declaring elevator_switch() non-static, for
> example?

Right, updating drivers/block/mg_disk.c and drivers/s390/block/dasd.c to
use elevator_switch would work.

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