Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015Ab3C0PUe (ORCPT ); Wed, 27 Mar 2013 11:20:34 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:42283 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751643Ab3C0PUd (ORCPT ); Wed, 27 Mar 2013 11:20:33 -0400 Date: Wed, 27 Mar 2013 15:20:30 +0000 From: Al Viro To: Dave Jones , Linus Torvalds , Linux Kernel Subject: Re: Yet another pipe related oops. Message-ID: <20130327152030.GY21522@ZenIV.linux.org.uk> References: <20130310221047.GA21522@ZenIV.linux.org.uk> <20130311003530.GE21522@ZenIV.linux.org.uk> <20130311180543.GF21522@ZenIV.linux.org.uk> <20130312130614.GA32237@ZenIV.linux.org.uk> <20130312194353.GI21522@ZenIV.linux.org.uk> <20130327135127.GB1738@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130327135127.GB1738@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1238 Lines: 33 On Wed, Mar 27, 2013 at 09:51:27AM -0400, Dave Jones wrote: > Could be that Al's patches refactored this bug away, or it could just be > that I've been lucky the last few weeks, and just haven't had the right > entropy to get the sequence of events right.. > > thoughts ? Actually, that's my fault - check lost in patch reordering. My apologies ;-/ Eventually, we want that in fs/splice.c side of things (no point repeating it for every buffer, after all), but for now this is the obvious minimal fix. Signed-off-by: Al Viro --- diff --git a/fs/read_write.c b/fs/read_write.c index f7b5a23..e6ddc8d 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -424,6 +424,9 @@ ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t const char __user *p; ssize_t ret; + if (!file->f_op || (!file->f_op->write && !file->f_op->aio_write)) + return -EINVAL; + old_fs = get_fs(); set_fs(get_ds()); p = (__force const char __user *)buf; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/