Received: by 10.192.165.148 with SMTP id m20csp580045imm; Wed, 25 Apr 2018 04:37:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx49kLCzsrM3lZ+fffZI0KPywBOBJ72udPc+WU1NkQg8UPdeWsIfHXbGvgON4bvoK6fB+H8NF X-Received: by 10.99.125.19 with SMTP id y19mr23449789pgc.160.1524656233441; Wed, 25 Apr 2018 04:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524656233; cv=none; d=google.com; s=arc-20160816; b=mY+rHzUotwtvQ43E8r39WehtWeG+g2+ORSxISreGWykn7K0kNILrm5AoZED9gfvSha ttlnSKEf+xWH5uNhIDUWm+DG+VkyNBRluqFTaLJj3Ai2F5XP/aMwnNWnb5kMoD4VhdZB cR+OtVD9XtqPk/WNbJ0ut12yWfEs5kCU2SL4rb3k+jyFWYtQS0I1zr+oUNZz7uz3h718 jKzacTD6Cl7VrpFh25+p8WWLhJrwFwY2J+bu9vnwFuIz9vvEcRoKFvp1PtXu6hAgEzva HCpuykJame884jesd9Mo5Ydu6gOjJBBCWL+ZtMfSMdBZEQG9dNOU69WhHXHdSuHEOhIp GihQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1JXe20jiquOTRU/UN44RHKw2+drU0q1lr5PkXoPoUSE=; b=a4iGz8MKosEm46yddHSsTAYlyvOP8BTY7X9vAf/VMNZGzvGVcDIwYdfZy615cHm3rL H2ISxbzYTJ4VsS7C47NV4vNh+eOvs3irPu/ebAYP0ITR9DXIFbJFmARMqpTQ9AF21WaW 9FtH16E61cStniGr0yZEEmj8VVmWswrT01808sBcWXpnN1sz8Z4tC+uI4mhq4etxe9xi hSS4ufi9vcwEHh1XQ205QUT05ME5pr5jcgd0hrt06MXSRfLn3lYWxr/eSq9NSJm0+BzL l5Cbd17Tjgu9Ba4ax+BayVdPO5ES+x/FqfSPBBq1OWNb0j2QDZbvDa04f3dyN3f3sIe8 l4DA== ARC-Authentication-Results: i=1; mx.google.com; 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 g14si8735732pgu.363.2018.04.25.04.36.59; Wed, 25 Apr 2018 04:37:13 -0700 (PDT) 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; 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 S1752192AbeDYKeC (ORCPT + 99 others); Wed, 25 Apr 2018 06:34:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50722 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbeDYKdv (ORCPT ); Wed, 25 Apr 2018 06:33:51 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 20C6842B; Wed, 25 Apr 2018 10:33:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Long Li , Steve French , Ronnie Sahlberg Subject: [PATCH 4.16 01/26] cifs: smbd: Check for iov length on sending the last iov Date: Wed, 25 Apr 2018 12:33:10 +0200 Message-Id: <20180425103314.903215581@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103314.842517924@linuxfoundation.org> References: <20180425103314.842517924@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Long Li commit ab60ee7bf9a84954f50a66a3d835860e80f99b7f upstream. When sending the last iov that breaks into smaller buffers to fit the transfer size, it's necessary to check if this is the last iov. If this is the latest iov, stop and proceed to send pages. Signed-off-by: Long Li Cc: stable@vger.kernel.org Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smbdirect.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -2194,6 +2194,8 @@ int smbd_send(struct smbd_connection *in goto done; } i++; + if (i == rqst->rq_nvec) + break; } start = i; buflen = 0;