Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2280154ybl; Thu, 19 Dec 2019 10:56:29 -0800 (PST) X-Google-Smtp-Source: APXvYqzndnBgEq2RYxcxqFSuMzRz+EVBhtgax5vk6+ybl/iaNnPRDTuO8eV220rxviIMsSpsPUT2 X-Received: by 2002:a9d:22:: with SMTP id 31mr9761363ota.173.1576781789078; Thu, 19 Dec 2019 10:56:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576781789; cv=none; d=google.com; s=arc-20160816; b=xpjACEknnDvyWuXu+vBQ5J1r/dYekLZl+oX7xD766QQyPrNE1WGBLJkqFFss+1wLoG IxVN+kVxMW/PbnCqGu91OIMITpblPfA1JzNyqGhJ8GSXL23CNC1mollhfD9DFyi71LlW DdK1a4lUssi2ttmC9B7IimvaWtowDcoGLQAr05hIgYOvMv19qN+MlU71kHxtHhfQKe5l Ua7dR5IoQ7zfzavIegdU9yk1CEZWjB6OOIr/NkIXnqCtF/PvXuZJWDc2X+x2NAMUQOmX V/XkID/FFLN+pZBxqhQRuBhqx+f7zp6K7M2qcctGD9Rfgg2Pu0TU12VxDcaRytS7EPpA RWPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xasi+u9C8R2FvYz8AwGtgq26DsFfIdLGK4xpm0gFtos=; b=Tr+feUVlR/P+9txOTWWGB1FvfoB94XVfTHgDo9ijYusk+33xiRlnGSuWhlJXRdiq6y v7szrNFQSYWB7dSUnrd/pdjuWbakjwdOZ6lK3+AdX8x//5z29WMx528TTSofA/xg7ozl cKfRMDvOFWGnH4gEcNZiyoDsvA+nL2sk+Yl6KQzAoVMqRI8SXxYKnOzgXqInB3kLlKDh 3Pw0ItoWTjl+XT4MpmepvTTofFX9eK3s4e9sRp51XNya1nj0y5IEOa4uSmUR2HELERed t7xFiTnk3trWXAd94wRTYL5mTjtPCAwooA3D8wGcGgeO5LGYtWNBjKL/rQ6A6sdtZ8Cm cDgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rxTsNQZF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i10si3932844otk.195.2019.12.19.10.56.17; Thu, 19 Dec 2019 10:56:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rxTsNQZF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730518AbfLSSye (ORCPT + 99 others); Thu, 19 Dec 2019 13:54:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:50012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729720AbfLSSyb (ORCPT ); Thu, 19 Dec 2019 13:54:31 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3932920674; Thu, 19 Dec 2019 18:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781670; bh=vtycg2qbFBVyk9aM23uGYOQRX/P88p05zOSrazU58Co=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rxTsNQZFcxMVZUeBw8pXZJi6kSw+fPsUB+4CVA3QnqQvfBqxC4NJJiI6cPQRVKLgG 5wFVsSc+oqOm8ETzR4Nm+dnMwvB58yL5U89pEme/d3ovHcUQagBKg3ShyYBQgZIum4 Eo1JnYB97ARQ0da2yN+C3Mh77XHTOON9u/yZGcgs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Long Li , Steve French Subject: [PATCH 5.4 31/80] cifs: smbd: Return -EINVAL when the number of iovs exceeds SMBDIRECT_MAX_SGE Date: Thu, 19 Dec 2019 19:34:23 +0100 Message-Id: <20191219183104.637344341@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183031.278083125@linuxfoundation.org> References: <20191219183031.278083125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li commit 37941ea17d3f8eb2f5ac2f59346fab9e8439271a upstream. While it's not friendly to fail user processes that issue more iovs than we support, at least we should return the correct error code so the user process gets a chance to retry with smaller number of iovs. Signed-off-by: Long Li Cc: stable@vger.kernel.org Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smbdirect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -1069,7 +1069,7 @@ static int smbd_post_send_data( if (n_vec > SMBDIRECT_MAX_SGE) { cifs_dbg(VFS, "Can't fit data to SGL, n_vec=%d\n", n_vec); - return -ENOMEM; + return -EINVAL; } sg_init_table(sgl, n_vec);