From patchwork Tue Mar 5 06:14:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 10839061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6263914DE for ; Tue, 5 Mar 2019 06:14:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AD3B2AF6E for ; Tue, 5 Mar 2019 06:14:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A14D2AF9F; Tue, 5 Mar 2019 06:14:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7E332AF6E for ; Tue, 5 Mar 2019 06:14:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726301AbfCEGOr (ORCPT ); Tue, 5 Mar 2019 01:14:47 -0500 Received: from mail-pg1-f176.google.com ([209.85.215.176]:46200 "EHLO mail-pg1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbfCEGOr (ORCPT ); Tue, 5 Mar 2019 01:14:47 -0500 Received: by mail-pg1-f176.google.com with SMTP id 196so4880302pgf.13 for ; Mon, 04 Mar 2019 22:14:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=IPVZabYIsEdw0yGIPjDuXb27q54PK5zqb5weCbYA5CU=; b=GvZ4oaCNICS1nGpO75V4Zg98+ioEkffwkLE+7VfQTLyUPFGztNcZnEQKmtsd7zzmfs ri1ghQKZgq2rXgW8hcd/XxH+Duhitd/1SxzYtwccbKwAzgtZkHaDz2jQgC/izchx0ahW GddGCRSIq0qV9mJUUtWmyxqgchEfD/MDdNVTUksoWdj24zciDOX5frwO+pt5LTUs1jL6 H/ETMllGUH58farqHqQHvfZj5CjB6URrxdTiPVrYpIvOTwovDwEnZXwLFpiG37dDYzQj UlSvyLFgk7c4QpcKmQljlX282bVHnvGBlbUZC1wsBkzK8MwNb18SKKZOveVi0QIZd09b zJHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=IPVZabYIsEdw0yGIPjDuXb27q54PK5zqb5weCbYA5CU=; b=rN88XqORAm+UEVZwGzy+cApkjc6b+5RQgOZeSKKpbcbbCNi/ZkaDPHH2GzF8yJ2lB8 AYPK7H4hFXLTGjYvpetUt2s9aT3l4YwtD4o9zlhPnpNGfZLcBvQ4de8KVTnnMURVYuQl csADsZB0edaQYUubVx74Q/h4eIj7Y1hnPYDS+j8fgguWGzf1lmwN/03Q4o1Z7dTnNAkY NZpqb4O1UlvhyScNTyGU4djA3+bPfbKixkC0xWmhEqANahfzxM0zilJXORaTsJGSnSmh cZKNf1zTMaXWDJ5awsvgDuDVUkKW3tFPvAEIIaPDPZfnexHY10h1L6IrBDvLQs/OUsWA KErQ== X-Gm-Message-State: APjAAAV1SIbS5uHMooywrMv3TD8jzTKHHodO2zO10AMGCL9Qx7C2yYLh mKj2Qxo6/4aEVqhzi+80N0/IKSt3cn2Twnrj95kIbg== X-Google-Smtp-Source: APXvYqzTFY27/wxa7JMieD+9o1Ve3NaqLz0JKCC0AemFfv+K+FkXmsRNf3ojzzUc9w8pBLEKJspnaOrZMhlDNXn0+4M= X-Received: by 2002:a63:1053:: with SMTP id 19mr22391296pgq.55.1551766486617; Mon, 04 Mar 2019 22:14:46 -0800 (PST) MIME-Version: 1.0 From: Steve French Date: Tue, 5 Mar 2019 00:14:34 -0600 Message-ID: Subject: [PATCH] CIFS: fix FSCTL_SET_REPARSE_POINT SMB2_ioctl() call To: CIFS Cc: =?utf-8?q?Aur=C3=A9lien_Aptel?= Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP merged Aurelien's small patch (attached) into cifs-2.6.git for-next Reviewed-by: Ronnie Sahlberg From 778d81b65e4d596251943002522d94a7c6fbcf69 Mon Sep 17 00:00:00 2001 From: Aurelien Aptel Date: Mon, 4 Mar 2019 18:50:18 +0100 Subject: [PATCH] CIFS: fix FSCTL_SET_REPARSE_POINT SMB2_ioctl() call Without this change the ioctl() fails with INVALID_PARAMETER. Since SET_REPARSE_POINT has no output, set the max output response size to zero. [MS-SMB2] reads 3.3.5.15 Receiving an SMB2 IOCTL Request If either InputCount, MaxInputResponse, or MaxOutputResponse is greater than Connection.MaxTransactSize, the server SHOULD<306> fail the request with STATUS_INVALID_PARAMETER. The server MUST fail the request with STATUS_INVALID_PARAMETER in the following cases: * If InputOffset is greater than zero but less than (size of SMB2 header + size of the SMB2 IOCTL request not including Buffer) or if InputOffset is greater than (size of SMB2 header + size of the SMB2 IOCTL request). * If OutputOffset is greater than zero but less than (size of SMB2 header + size of the SMB2 IOCTL request not including Buffer) or if OutputOffset is greater than (size of SMB2 header + size of the SMB2 IOCTL request). * If (InputOffset + InputCount) is greater than (size of SMB2 header + size of the SMB2 IOCTL request). * If (OutputOffset + OutputCount) is greater than (size of SMB2 header + size of the SMB2 IOCTL request). * If OutputCount is greater than zero and OutputOffset is less than (InputOffset + InputCount). Signed-off-by: Aurelien Aptel Signed-off-by: Steve French --- fs/cifs/smb2pdu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 733021566356..cacdf9bf9ef3 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2539,7 +2539,10 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, * in responses (except for read responses which can be bigger. * We may want to bump this limit up */ - req->MaxOutputResponse = cpu_to_le32(CIFSMaxBufSize); + if (opcode == FSCTL_SET_REPARSE_POINT) + req->MaxOutputResponse = cpu_to_le32(0); + else + req->MaxOutputResponse = cpu_to_le32(CIFSMaxBufSize); if (is_fsctl) req->Flags = cpu_to_le32(SMB2_0_IOCTL_IS_FSCTL); -- 2.17.1