Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp804199imu; Tue, 11 Dec 2018 07:51:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/UoiX6LZoJtZagdWIXe8NVjcHsi9fKEdjh1sgJGkMNzEIX3BC6htdQpsyytg0qiVfHf6BKV X-Received: by 2002:a17:902:33c2:: with SMTP id b60mr16445344plc.211.1544543482596; Tue, 11 Dec 2018 07:51:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544543482; cv=none; d=google.com; s=arc-20160816; b=BlmDxRGX4Hx37P9iaW/Dq/yTxJQ/ig5TkCZugZG+gdVzikD+VKWHronbcXPljUZL5o yvZxkZY5dLUCpW3bB8/Km7K5aCaU/AUA2PosOLZXo3uyAxGbFdT3mMoBLaTJUmO2LGqo WxTQ4p3HGSMCGyJfCJ4D5/4rH7JcOmU6X57hnwMC/53CbxYmxYrh8Jo7xrMOSmMtq74R ZJCacGYRV9In1q5F6QOCRNGFmIY/V2peGibyW/aj/KIzNEEG0+XeWUAIH92u/KjM+FE7 l9+JuzGkKmF2WQt6nEQrc0hTGyKuVUsmGNFnm8c9KRZB+IXGKYwKcrIJx9dd+g1ETK8p e4kQ== 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=gysNIGUiBkbdANPhdOPl8fGGyYDq1zazOUp3MvI6/Dw=; b=uh6ty22VUeExQzQbDIoGd59Odtx4Vha8a2vZqFhrCzLxYysrFrbSoykv80LOo0wubl tNtL3ie1JSeTIn4HWwSP9LrnLssW6Qsrm1gQlY9gcd0dDPKgeFySK7Im6yCRf4vzyBYe JD42rTSqSGVuRLB9Dv7GEIbc2FtJh0tNcdM0Zs/ZImUiYU7rtppRcTWFKmMNqe0HPeGh 3d9XgKC2Jg3wF37PabEdrUuAt9Rez+8ScO6NbaBAqGBbAmlgfdDdkZFeCNi6zLlkYPwH Ls0wjxXv3o0dL5vY8aRFGccYwjrjr6i/C00u1wKEPExBY2NvECdQaiK6hIGCYR0Kp4KG EP9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DxsddjIQ; 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 v10si11945652pgg.510.2018.12.11.07.51.07; Tue, 11 Dec 2018 07:51:22 -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=DxsddjIQ; 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 S1728756AbeLKPsM (ORCPT + 99 others); Tue, 11 Dec 2018 10:48:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:36516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727411AbeLKPsL (ORCPT ); Tue, 11 Dec 2018 10:48:11 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 21C8720870; Tue, 11 Dec 2018 15:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543290; bh=N6mEPIUBkE7ThVOPypNk904B1cNfsPfe/QlbfUqVzYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DxsddjIQEQ40GynZeWVctJtT1NVocJ48tdKhi3rcEdhqrKFo+hY6ZeAvAySDRyi5l Apzuh0IHxzFxeysnYYENo9P0ucBScmOBgo1VI9/Ep/p6QdVe5FjZg5eQIh6c4reEA/ L8NVswPxRrg1LFzhqKD/ZRapldTHlntfx9j7KTec= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paulo Alcantara , Aurelien Aptel , Steve French Subject: [PATCH 4.4 84/91] cifs: Fix separator when building path from dentry Date: Tue, 11 Dec 2018 16:41:43 +0100 Message-Id: <20181211151613.633521209@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paulo Alcantara commit c988de29ca161823db6a7125e803d597ef75b49c upstream. Make sure to use the CIFS_DIR_SEP(cifs_sb) as path separator for prefixpath too. Fixes a bug with smb1 UNIX extensions. Fixes: a6b5058fafdf ("fs/cifs: make share unaccessible at root level mountable") Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French CC: Stable Signed-off-by: Greg Kroah-Hartman --- fs/cifs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -163,7 +163,7 @@ cifs_bp_rename_retry: cifs_dbg(FYI, "using cifs_sb prepath <%s>\n", cifs_sb->prepath); memcpy(full_path+dfsplen+1, cifs_sb->prepath, pplen-1); - full_path[dfsplen] = '\\'; + full_path[dfsplen] = dirsep; for (i = 0; i < pplen-1; i++) if (full_path[dfsplen+1+i] == '/') full_path[dfsplen+1+i] = CIFS_DIR_SEP(cifs_sb);