From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zimbra13.linbit.com (zimbra.linbit.com [212.69.161.123]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail09.linbit.com (LINBIT Mail Daemon) with ESMTPS id 314091056478 for ; Wed, 9 Nov 2016 23:04:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra13.linbit.com (Postfix) with ESMTP id D52E936B63B for ; Wed, 9 Nov 2016 23:04:17 +0100 (CET) Received: from zimbra13.linbit.com ([127.0.0.1]) by localhost (zimbra13.linbit.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id pwFiLnDiKY9I for ; Wed, 9 Nov 2016 23:04:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra13.linbit.com (Postfix) with ESMTP id B747836B8B6 for ; Wed, 9 Nov 2016 23:04:17 +0100 (CET) Received: from zimbra13.linbit.com ([127.0.0.1]) by localhost (zimbra13.linbit.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id wOMVJAJIARlN for ; Wed, 9 Nov 2016 23:04:17 +0100 (CET) Received: from soda.linbit (tuerlsteher.linbit.com [86.59.100.100]) by zimbra13.linbit.com (Postfix) with ESMTPS id 9371236B63B for ; Wed, 9 Nov 2016 23:04:17 +0100 (CET) Resent-Message-ID: <20161109220417.GP1382@soda.linbit> Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [195.92.253.2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail09.linbit.com (LINBIT Mail Daemon) with ESMTPS id 29F7C1056482 for ; Tue, 8 Nov 2016 17:43:52 +0100 (CET) Date: Tue, 8 Nov 2016 16:13:24 +0000 From: Al Viro To: Christoph Hellwig Message-ID: <20161108161324.GH19539@ZenIV.linux.org.uk> References: <1478601789-15060-1-git-send-email-richard@nod.at> <20161108154924.GA19063@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161108154924.GA19063@infradead.org> Sender: Al Viro Cc: wolfgang.glas@iteg.at, Richard Weinberger , christoph.lechleitner@iteg.at, philipp.reisner@linbit.com, stable@vger.kernel.org, linux-kernel@vger.kernel.org, lars.ellenberg@linbit.com, drbd-dev@lists.linbit.com Subject: Re: [Drbd-dev] [PATCH] drbd: Fix kernel_sendmsg() usage List-Id: "*Coordination* of development, patches, contributions -- *Questions* \(even to developers\) go to drbd-user, please." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, Nov 08, 2016 at 07:49:24AM -0800, Christoph Hellwig wrote: > On Tue, Nov 08, 2016 at 11:43:09AM +0100, Richard Weinberger wrote: > > Don't pass a size larger than iov_len to kernel_sendmsg(). > > Otherwise it will cause a NULL pointer deref when kernel_sendmsg() > > returns with rv < size. > > > > Although the issue exists since day 0, only on non-ancient kernels > > that contain change 57be5bdad759 ("ip: convert tcp_sendmsg() to iov_iter > > primitives") it seems to trigger [0][1][2][3][4]. > > The real fix here is to convert it to the right primitive, e.g. take > Al's patch from here: > > https://git.kernel.org/cgit/linux/kernel/git/viro/vfs.git/commit/?h=work.sendmsg&id=7a4992299554a9e1ed3c4540bcfa9e40aa9a6376 _After_ the backport-friendly part, please. And that's my ACK-by on Richard's variant. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932414AbcKHQNl (ORCPT ); Tue, 8 Nov 2016 11:13:41 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:56728 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932226AbcKHQNg (ORCPT ); Tue, 8 Nov 2016 11:13:36 -0500 Date: Tue, 8 Nov 2016 16:13:24 +0000 From: Al Viro To: Christoph Hellwig Cc: Richard Weinberger , drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, lars.ellenberg@linbit.com, philipp.reisner@linbit.com, stable@vger.kernel.org, christoph.lechleitner@iteg.at, wolfgang.glas@iteg.at Subject: Re: [PATCH] drbd: Fix kernel_sendmsg() usage Message-ID: <20161108161324.GH19539@ZenIV.linux.org.uk> References: <1478601789-15060-1-git-send-email-richard@nod.at> <20161108154924.GA19063@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161108154924.GA19063@infradead.org> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 08, 2016 at 07:49:24AM -0800, Christoph Hellwig wrote: > On Tue, Nov 08, 2016 at 11:43:09AM +0100, Richard Weinberger wrote: > > Don't pass a size larger than iov_len to kernel_sendmsg(). > > Otherwise it will cause a NULL pointer deref when kernel_sendmsg() > > returns with rv < size. > > > > Although the issue exists since day 0, only on non-ancient kernels > > that contain change 57be5bdad759 ("ip: convert tcp_sendmsg() to iov_iter > > primitives") it seems to trigger [0][1][2][3][4]. > > The real fix here is to convert it to the right primitive, e.g. take > Al's patch from here: > > https://git.kernel.org/cgit/linux/kernel/git/viro/vfs.git/commit/?h=work.sendmsg&id=7a4992299554a9e1ed3c4540bcfa9e40aa9a6376 _After_ the backport-friendly part, please. And that's my ACK-by on Richard's variant.