Re: [PATCH] mm: Make sendfile(2) killable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 16 Oct 2015 08:40:27 +0200 Jan Kara <jack@xxxxxxx> wrote:

> > >  		balance_dirty_pages_ratelimited(mapping);
> > > -		if (fatal_signal_pending(current)) {
> > > -			status = -EINTR;
> > > -			break;
> > > -		}
> > >  	} while (iov_iter_count(i));
> > >  
> > >  	return written ? written : status;
> > 
> > This won't work, will it?  If user hits ^C after we've written a few
> > pages, `written' is non-zero and the same thing happens?
> 
> It does work - I've tested it :). Sure, the generic_perform_write() call
> that is running when the signal is delivered will return with value > 0.
> But the interesting thing is what happens after that: Either we return to
> userspace (and then we are fine) or generic_perform_write() gets called
> again because there's more to write and *that* call will return -EINTR
> which ends up terminating the whole sendfile syscall.

OK.  I guess that's better behaviour than overwriting a non-zero
`written' when signalled.

I'm going to tag this one for -stable.  It's a bit of a DoS.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]