From patchwork Sun Apr 6 19:42:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 14039470 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D71C191F68 for ; Sun, 6 Apr 2025 19:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743968576; cv=none; b=TuhntZq0emeGVbLZLUWv/Vr3wxl7kAgyTGrIbZ/VNpm2ngQlPzebXzUfkpvAvmC2mAWO76lkL0ybWYpETCaUJI8wudJ5nMOFHAeBjx9w5fhIYfr2M9MkyhLqqdMt75jNilW0hFchJycLPLJiaa0NcZoSDVcp1ioahwc0JvYVWHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743968576; c=relaxed/simple; bh=RD3Ljt82KJuAcNiSSGTajVcTflVUNMKhzR5tj82r1Iw=; h=MIME-Version:From:Date:Message-ID:Subject:To:Cc:Content-Type; b=CSjDPSqtgwwprpRL7eEkiLZJM8vcfQYKij/1Ewk5Ynf1O2kIHd2X9DjT0a3SqKybdFOPKQ5/iZl3lzS/EhHUzLhD3VSAp9//ZKM3plAzD7bSTzT/hxzuAHTvYg64hcnxPCnpwntZoFwpJsm/HjZAwG4RG5YwWwWYt/u++ICticY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YvTyABeJ; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YvTyABeJ" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5498d2a8b89so4225936e87.1 for ; Sun, 06 Apr 2025 12:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743968572; x=1744573372; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=e3JJQm1qSjqMwiJoDddskYf4wu3viUAhC4IlUYhjc9M=; b=YvTyABeJU3/xS1Be7FWAHIwXD71NWpJOijzsk4spin44t6RmimVDfY9GB7aL6LcfaG FeCMhIMtiSRMx1L6ddcDGxfBn0HmRwaAdWwsFcBgIfsUrM5PwyajkIbKPjfiydl1FWPF sWONPm1xJ0rD8JC43XBrz1cvX1lHQXr3kjQm5pBPRDTo55mXYGv6pr0naerzCQri7UvW DwrfyQBiUseupoXE/TosKxe5o+Mal/UqOa2up/1645M8q+/9Wp1gbRtV4qQjEuQUdJhv YBSVp3ImzrBnbSrR6Co4uR72qi8FNJme2fwRQTsjP/4JdQQ9FrX/X5UEG5fUQV2oONcP a0zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743968572; x=1744573372; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=e3JJQm1qSjqMwiJoDddskYf4wu3viUAhC4IlUYhjc9M=; b=RFK8kCJDTIs3HBWJSrKzuQRNnaZJ8crZfpS6dxDjC/pXanXYo/npgHOaH02rQcCHST t8M+Pm5xCkEQ5hua4nqmaYdootdwArU2Y/izs9LmNmQksERvEwYGK0RVUZ0IO/5v7x6x YJLERrBtuVqTM/+LBtS3e/b4TvYOktElcbDa/bzFeF8QDN9YRGyoVwTXELb3+j3T2GKg KDnCbb7E6kGOA1k1egYPjUTgv+fdMBZGX5JZDk3HvSrt+JM8zWXwHTdin9pWnG8fCi5u ToRIA0NgU/mPl427MMAD0x25BBqn2VlNaJOIjjzm5CqEy+T5hyyOS/jZ6wWyPCk/Mk/j 1mQQ== X-Gm-Message-State: AOJu0YxfCReoNp+2zje4Y88mjdceZOJ96TDOLKLm4k9WMCu/FVUiZ3gw z0AVLhB1tkqAL7kYczE7aJ3unIf1B5mrpmvAofebDeVV6eVWJo06JEiMmd5/Gg0KEyz1KZ34hsJ +GJR6O00Ex3zGjxwvPNsafFydNfYY8Enc X-Gm-Gg: ASbGncsmnKONWHLTTRyWLNN939SGu0/8fQPzwkqcwljXAGEq2h+bWkN4iy0F7gp7uGD QT8iXXvyE8Op9YOyzXM1ee+R97QFMYtCAkv7YYOZuEZPZ3FFtVOsI7P1lVsUhQPSyhN2lJGKfBy uWawoAnbZMj07meQHHl/4r8dqTzn/uf1Lrnp1wH+zl03e+WOyrqxQjilVmWpb7 X-Google-Smtp-Source: AGHT+IHWWr+G0ug9xKZyoZJuvyly2ZVJ59MwzJgAOV7qKnn3lEIQ1VdJytZJaOS9VU9QnzeBQnM3n5Vxw1SMuXXevXk= X-Received: by 2002:ac2:5683:0:b0:549:5b54:2c6c with SMTP id 2adb3069b0e04-54c22777b0fmr2764388e87.23.1743968572010; Sun, 06 Apr 2025 12:42:52 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Steve French Date: Sun, 6 Apr 2025 14:42:40 -0500 X-Gm-Features: ATxdqUFMYDnAg8R0wPb559vnE-jhH0ijzywm72TsyA-1gmOWcqD_GRmFkVVf0gc Message-ID: Subject: [PATCH][SMB311 client] fix missing tcon check when mounting with linux extensions To: CIFS Cc: samba-technical When mounting the same share twice, once with the "linux" mount parameter (or equivalently "posix") and then once without (or e.g. with "nolinux"), we were incorrectly reusing the same tree connection for both mounts. This meant that the first mount of the share on the client, would cause subsequent mounts of that same share on the same client to ignore that mount parm ("linux" vs. "nolinux") and incorrectly reuse the same tcon. See attached From 015fe986c3e05f2d18e2b7d0c356306b98b69656 Mon Sep 17 00:00:00 2001 From: Steve French Date: Sun, 6 Apr 2025 14:09:19 -0500 Subject: [PATCH] smb311 client: fix missing tcon check when mounting with linux/posix extensions When mounting the same share twice, once with the "linux" mount parameter (or equivalently "posix") and then once without (or e.g. with "nolinux"), we were incorrectly reusing the same tree connection for both mounts. This meant that the first mount of the share on the client, would cause subsequent mounts of that same share on the same client to ignore that mount parm ("linux" vs. "nolinux") and incorrectly reuse the same tcon. Cc: stable@vger.kernel.org Signed-off-by: Steve French --- fs/smb/client/connect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index f298e86a3c1f..4c15ed0583b4 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -2556,6 +2556,8 @@ static int match_tcon(struct cifs_tcon *tcon, struct smb3_fs_context *ctx) return 0; if (tcon->nodelete != ctx->nodelete) return 0; + if (tcon->posix_extensions != ctx->linux_ext) + return 0; return 1; } -- 2.43.0