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: <20090514172935.GR4140@kernel.dk>
Date:	Thu, 14 May 2009 19:29:35 +0200
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	akpm@...ux-foundation.org, max@...mpel.org,
	torvalds@...ux-foundation.org, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [patch 2/3] splice: implement default splice_read method

On Wed, May 13 2009, Miklos Szeredi wrote:
> On Wed, 13 May 2009, Jens Axboe wrote:
> > On Tue, May 12 2009, Andrew Morton wrote:
> > > On Thu, 07 May 2009 15:37:36 +0200 Miklos Szeredi <miklos@...redi.hu> wrote:
> > > 
> > > > +	for (i = 0; i < spd.nr_pages; i++) {
> > > > +		kunmap(pages[i]);
> > > 
> > > It is deadlockable if any thread of control holds more than a single
> > > kmap at a time.
> > > 
> > > Because there are a finite number of kmaps available, and if one is
> > > unavailable, kmap() waits for one to become free.  If the number of
> > > waiting threads equals the number of available slots, nobody makes any
> > > progress.
> 
> Ouch.
> 
> > 
> > Good catch, that will not work reliably. I've applied the below.
> 
> Thanks.
> 
> The bigger problem is that the default_file_splice_write()
> implementation in the other patch does the same (it calls
> buf->ops->map() on all buffers).

Yep that's even worse, as that should go BUG() pretty much immediately
when the KM_USER0 slot is reused!

> Hmm.  Simple solution would be to do a write() for each buffer.  But
> this only affects HIGHMEM kernels, so it's a bit pointless to do that
> on all archs.  Sigh...

It is unfortunate, we are going to be stuck with that for some time
still...

-- 
Jens Axboe

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