Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2093198ybl; Thu, 30 Jan 2020 11:14:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxhiqv99vv4ESu4kS2krDndSLM9ZzZ9CUbWXG5CX/lNgHKzgImZ8XN4p8VqJMvz1VyMDcs3 X-Received: by 2002:a05:6808:45:: with SMTP id v5mr3767735oic.90.1580411649058; Thu, 30 Jan 2020 11:14:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580411649; cv=none; d=google.com; s=arc-20160816; b=I5QcRbSfCqxJJ2SNmwpSn7o9eI8fElDEzPGNmI10sDnkhGPsnJAhlv4UyxBSKNkFCL XcoINXqrVYaXXu1reaqC/sQDPulv7bwFTON+c812FLZioNMRsa2UvpyCpVd4y7aLhdqn g/Fs4zixLdDAGJE+lA5VdiWsNsJ0W5aW3sVFNHaQ7vPFhGUOWO79E6Kid23hSuV9drea XmwRQTs/3L2hjBAWQ3+2qA51k4Gv2cwdH1b6EOLYi8JqgklSLoBii3xgDyCnSr4Km1xi rzpydQWgQljxjZf6Ti3aVKXGbUn0A2Xa3xSbT7fX6yuc19r4rujlPqyOiNWkP+7VGX8x eMYA== 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=XnjC90pyPx41ezX0KPPTzuQB4QXOb7lbKuGj3G4djNA=; b=TkdQf7OWJb1sbO4HixYKFLDhiDwCmj6uMbQh7nOvDzccHu1sle6PWoRBv5cmCFiZVJ Y1D1tUHwZqLpt+znUWHBvB2aszb61XuKbK7/K6IUSPtsmnx5F5nPLQrmhe+hQy4nwNMv JGfDMh7qLA8Sg5NWjLxGM6O5kv1UIF1UZvsZWZjdadwcXLvUyH3g1H8EJiOoNw2jboK1 HChZzi9K6vka3p2miIwvpa8CZBpi3vpRiwsx6A0yLrQ6f9fEjaqZOQ/B8QfGLqnFJHB6 zia1fjKsmzirUwTefJIR2vn603r4sKuVt5hIyUhUDtZA+u4Z3NblsDGpyUoEyE1HhW1W mabw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bnqJIbtD; 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 u1si3669619otg.113.2020.01.30.11.13.56; Thu, 30 Jan 2020 11:14:09 -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=bnqJIbtD; 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 S1730023AbgA3Skp (ORCPT + 99 others); Thu, 30 Jan 2020 13:40:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:48348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730008AbgA3Skl (ORCPT ); Thu, 30 Jan 2020 13:40:41 -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 9FA73214AF; Thu, 30 Jan 2020 18:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580409641; bh=JkVwYf0IXv2ijGwm1KGIIPEiPDUR4873p/dAQ6BicAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnqJIbtDfbQFISeEDiqG0nvFThrXIXUE+x+QV0cLi4vlKrUPzvOT1FXDplxlmpQAg HnNqd3k7z7y5ysgp1h3DZsngWEwAcFN8eBD1/KSQFyv731eMS+hF6KrObgxJBR5Q2j psOQOSgx0NmdX5HXGlQMFJqg9fX5VZFGC7aERFqE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ronnie Sahlberg , Steve French , Pavel Shilovsky Subject: [PATCH 5.5 30/56] cifs: set correct max-buffer-size for smb2_ioctl_init() Date: Thu, 30 Jan 2020 19:38:47 +0100 Message-Id: <20200130183614.551929041@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200130183608.849023566@linuxfoundation.org> References: <20200130183608.849023566@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: Ronnie Sahlberg commit 731b82bb1750a906c1e7f070aedf5505995ebea7 upstream. Fix two places where we need to adjust down the max response size for ioctl when it is used together with compounding. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky CC: Stable Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2ops.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -1523,7 +1523,9 @@ smb2_ioctl_query_info(const unsigned int COMPOUND_FID, COMPOUND_FID, qi.info_type, true, buffer, qi.output_buffer_length, - CIFSMaxBufSize); + CIFSMaxBufSize - + MAX_SMB2_CREATE_RESPONSE_SIZE - + MAX_SMB2_CLOSE_RESPONSE_SIZE); } } else if (qi.flags == PASSTHRU_SET_INFO) { /* Can eventually relax perm check since server enforces too */ @@ -2697,7 +2699,10 @@ smb2_query_symlink(const unsigned int xi rc = SMB2_ioctl_init(tcon, &rqst[1], fid.persistent_fid, fid.volatile_fid, FSCTL_GET_REPARSE_POINT, - true /* is_fctl */, NULL, 0, CIFSMaxBufSize); + true /* is_fctl */, NULL, 0, + CIFSMaxBufSize - + MAX_SMB2_CREATE_RESPONSE_SIZE - + MAX_SMB2_CLOSE_RESPONSE_SIZE); if (rc) goto querty_exit;