Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932290AbbERP4j (ORCPT ); Mon, 18 May 2015 11:56:39 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:46428 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932272AbbERP4d (ORCPT ); Mon, 18 May 2015 11:56:33 -0400 Date: Mon, 18 May 2015 16:56:31 +0100 From: Al Viro To: Louis Langholtz Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] include/linux: avoid narrowing length parameter values Message-ID: <20150518155631.GX7232@ZenIV.linux.org.uk> References: <45D183F5-DFCC-4FBF-833E-E738E098CF1D@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45D183F5-DFCC-4FBF-833E-E738E098CF1D@me.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: 1133 Lines: 21 On Mon, May 18, 2015 at 09:33:10AM -0600, Louis Langholtz wrote: > memcpy_from_msg() and memcpy_to_msg() functions previously called > memcpy_fromiovec() and memcpy_toiovec() functions respectively. The > memcpy_fromiovec() and memcpy_toiovec() functions took a length parameter > of type int. memcpy_from_msg() and memcpy_to_msg() now call > copy_from_iter() and copy_to_iter() functions respectively which take a length > parameter of type size_t. Most code calling the memcpy_from_msg() and > memcpy_to_msg() functions currently pass a length value of type size_t. > This patch updates the memcpy_from_msg() and memcpy_to_msg() functions > concordantly to take the length parameter of type size_t. This also avoids a potential > for data narrowing. iov_iter for sendmsg or recvmsg *can't* have more than 2Gb of data; if it ever does, it's a serious bug. IOW, NAK - that's pointless. -- 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/