From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751253AbeAVQnP (ORCPT ); Mon, 22 Jan 2018 11:43:15 -0500 Received: from verein.lst.de ([213.95.11.211]:53338 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbeAVQnO (ORCPT ); Mon, 22 Jan 2018 11:43:14 -0500 Date: Mon, 22 Jan 2018 17:43:12 +0100 From: Christoph Hellwig To: Al Viro Cc: netdev@vger.kernel.org, "David S. Miller" , Linus Torvalds , linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH 03/10] ip_rt_ioctl(): take copyin to caller Message-ID: <20180122164312.GC27216@lst.de> References: <20180118193156.GC13338@ZenIV.linux.org.uk> <20180118193755.19997-1-viro@ZenIV.linux.org.uk> <20180118193755.19997-3-viro@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180118193755.19997-3-viro@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > case SIOCGSTAMP: > @@ -884,8 +885,12 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) > break; > case SIOCADDRT: > case SIOCDELRT: > + if (copy_from_user(&rt, p, sizeof(struct rtentry))) > + return -EFAULT; > + err = ip_rt_ioctl(net, cmd, &rt); > + break; > case SIOCRTMSG: > - err = ip_rt_ioctl(net, cmd, (void __user *)arg); > + err = -EINVAL; This looks odd, but ip_rt_ioctl never handled SIOCRTMSG to start with, so it looks fine. Might be worth splitting into another prep patch with a good changelog. ip_rt_ioctl could also use some additional simplification if it's only called for SIOCADDRT/SIOCDELRT and lose a level of indentation while we're at it. But otherwise this looks good: Reviewed-by: Christoph Hellwig