patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev,
	"Paulo Alcantara (Red Hat)" <pc@manguebit.com>,
	Steve French <stfrench@microsoft.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.1 001/110] smb: client: fix rename(2) regression against samba
Date: Tue, 30 Apr 2024 12:39:30 +0200	[thread overview]
Message-ID: <20240430103047.609179828@linuxfoundation.org> (raw)
In-Reply-To: <20240430103047.561802595@linuxfoundation.org>

6.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paulo Alcantara <pc@manguebit.com>

[ Upstream commit 18d86965e31f9be4d477da0744a7cdc9815858de ]

After commit 2c7d399e551c ("smb: client: reuse file lease key in
compound operations") the client started reusing lease keys for
rename, unlink and set path size operations to prevent it from
breaking its own leases and thus causing unnecessary lease breaks to
same connection.

The implementation relies on positive dentries and
cifsInodeInfo::lease_granted to decide whether reusing lease keys for
the compound requests.  cifsInodeInfo::lease_granted was introduced by
commit 0ab95c2510b6 ("Defer close only when lease is enabled.") to
indicate whether lease caching is granted for a specific file, but
that can only happen until file is open, so
cifsInodeInfo::lease_granted was left uninitialised in ->alloc_inode
and then client started sending random lease keys for files that
hadn't any leases.

This fixes the following test case against samba:

mount.cifs //srv/share /mnt/1 -o ...,nosharesock
mount.cifs //srv/share /mnt/2 -o ...,nosharesock
touch /mnt/1/foo; tail -f /mnt/1/foo & pid=$!
mv /mnt/2/foo /mnt/2/bar # fails with -EIO
kill $pid

Fixes: 0ab95c2510b6 ("Defer close only when lease is enabled.")
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/smb/client/cifsfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
index 0a79771c8f33b..f0a3336ffb6c8 100644
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -387,6 +387,7 @@ cifs_alloc_inode(struct super_block *sb)
 	 * server, can not assume caching of file data or metadata.
 	 */
 	cifs_set_oplock_level(cifs_inode, 0);
+	cifs_inode->lease_granted = false;
 	cifs_inode->flags = 0;
 	spin_lock_init(&cifs_inode->writers_lock);
 	cifs_inode->writers = 0;
-- 
2.43.0




  reply	other threads:[~2024-04-30 11:26 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 10:39 [PATCH 6.1 000/110] 6.1.90-rc1 review Greg Kroah-Hartman
2024-04-30 10:39 ` Greg Kroah-Hartman [this message]
2024-04-30 10:39 ` [PATCH 6.1 002/110] cifs: reinstate original behavior again for forceuid/forcegid Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 003/110] HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 004/110] HID: logitech-dj: allow mice to use all types of reports Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 005/110] arm64: dts: rockchip: set PHY address of MT7531 switch to 0x1f Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 006/110] arm64: dts: rockchip: enable internal pull-up on Q7_USB_ID for RK3399 Puma Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 007/110] arm64: dts: rockchip: fix alphabetical ordering RK3399 puma Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 008/110] arm64: dts: rockchip: enable internal pull-up on PCIE_WAKE# for RK3399 Puma Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 009/110] arm64: dts: rockchip: Remove unsupported node from the Pinebook Pro dts Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 010/110] arm64: dts: mediatek: mt8183: Add power-domains properity to mfgcfg Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 011/110] arm64: dts: mediatek: mt8192: Add missing gce-client-reg to mutex Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 012/110] arm64: dts: mediatek: mt8195: Add missing gce-client-reg to vpp/vdosys Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 013/110] arm64: dts: mediatek: mt8195: Add missing gce-client-reg to mutex Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 014/110] arm64: dts: mediatek: mt8192-asurada: Update min voltage constraint for MT6315 Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 015/110] arm64: dts: mediatek: mt8195-cherry: " Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 016/110] arm64: dts: mediatek: mt7622: fix clock controllers Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 017/110] arm64: dts: mediatek: mt7622: fix IR nodename Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 018/110] arm64: dts: mediatek: mt7622: fix ethernet controller "compatible" Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 019/110] arm64: dts: mediatek: mt7622: drop "reset-names" from thermal block Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 020/110] arm64: dts: mediatek: mt2712: fix validation errors Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 021/110] arm64: dts: rockchip: regulator for sd needs to be always on for BPI-R2Pro Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 022/110] ARC: [plat-hsdk]: Remove misplaced interrupt-cells property Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 023/110] wifi: iwlwifi: mvm: remove old PASN station when adding a new one Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 024/110] wifi: iwlwifi: mvm: return uid from iwl_mvm_build_scan_cmd Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 025/110] vxlan: drop packets from invalid src-address Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 026/110] mlxsw: core: Unregister EMAD trap using FORWARD action Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 027/110] ARM: dts: microchip: at91-sama7g5ek: Replace regulator-suspend-voltage with the valid property Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 028/110] icmp: prevent possible NULL dereferences from icmp_build_probe() Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 029/110] bridge/br_netlink.c: no need to return void function Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 6.1 030/110] bnxt_en: refactor reset close code Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 031/110] bnxt_en: Fix the PCI-AER routines Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 032/110] NFC: trf7970a: disable all regulators on removal Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 033/110] ax25: Fix netdev refcount issue Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 034/110] net: make SK_MEMORY_PCPU_RESERV tunable Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 035/110] net: fix sk_memory_allocated_{add|sub} vs softirqs Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 036/110] ipv4: check for NULL idev in ip_route_use_hint() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 037/110] net: usb: ax88179_178a: stop lying about skb->truesize Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 038/110] net: gtp: Fix Use-After-Free in gtp_dellink Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 039/110] Bluetooth: MGMT: Fix failing to MGMT_OP_ADD_UUID/MGMT_OP_REMOVE_UUID Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 040/110] Bluetooth: hci_sync: Using hci_cmd_sync_submit when removing Adv Monitor Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 041/110] Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 042/110] ipvs: Fix checksumming on GSO of SCTP packets Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 043/110] net: openvswitch: Fix Use-After-Free in ovs_ct_exit Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 044/110] mlxsw: spectrum_acl_tcam: Fix race during rehash delayed work Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 045/110] mlxsw: spectrum_acl_tcam: Fix possible use-after-free during activity update Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 046/110] mlxsw: spectrum_acl_tcam: Fix possible use-after-free during rehash Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 047/110] mlxsw: spectrum_acl_tcam: Rate limit error message Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 048/110] mlxsw: spectrum_acl_tcam: Fix memory leak during rehash Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 049/110] mlxsw: spectrum_acl_tcam: Fix warning " Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 050/110] mlxsw: spectrum_acl_tcam: Fix incorrect list API usage Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 051/110] mlxsw: spectrum_acl_tcam: Fix memory leak when canceling rehash work Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 052/110] eth: bnxt: fix counting packets discarded due to OOM and netpoll Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 053/110] netfilter: nf_tables: honor table dormant flag from netdev release event path Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 054/110] i40e: Do not use WQ_MEM_RECLAIM flag for workqueue Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 055/110] i40e: Report MFS in decimal base instead of hex Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 056/110] iavf: Fix TC config comparison with existing adapter TC config Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 057/110] net: ethernet: ti: am65-cpts: Fix PTPv1 message type on TX packets Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 058/110] af_unix: Suppress false-positive lockdep splat for spin_lock() in __unix_gc() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 059/110] cifs: Replace remaining 1-element arrays Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 060/110] Revert "crypto: api - Disallow identical driver names" Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 061/110] virtio_net: Do not send RSS key if it is not supported Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 062/110] fork: defer linking file vma until vma is fully initialized Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 063/110] x86/cpu: Fix check for RDPKRU in __show_regs() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 064/110] rust: dont select CONSTRUCTORS Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 065/110] rust: make mutually exclusive with CFI_CLANG Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 066/110] Bluetooth: Fix type of len in {l2cap,sco}_sock_getsockopt_old() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 067/110] Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x0bda:0x4853 Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 068/110] Bluetooth: qca: fix NULL-deref on non-serdev suspend Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 069/110] mmc: sdhci-msm: pervent access to suspended controller Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 070/110] smb: client: Fix struct_group() usage in __packed structs Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 071/110] smb3: fix lock ordering potential deadlock in cifs_sync_mid_result Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 072/110] HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 073/110] btrfs: fix information leak in btrfs_ioctl_logical_to_ino() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 074/110] cpu: Re-enable CPU mitigations by default for !X86 architectures Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 075/110] LoongArch: Fix callchain parse error with kernel tracepoint events Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 076/110] LoongArch: Fix access error when read fault on a write-only VMA Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 077/110] arm64: dts: rockchip: enable internal pull-up for Q7_THRM# on RK3399 Puma Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 078/110] drm/amdgpu/sdma5.2: use legacy HDP flush for SDMA2/3 Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 079/110] drm/amdgpu: Fix leak when GPU memory allocation fails Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 080/110] irqchip/gic-v3-its: Prevent double free on error Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 081/110] ACPI: CPPC: Use access_width over bit_width for system memory accesses Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 082/110] ACPI: CPPC: Fix bit_offset shift in MASK_VAL() macro Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 083/110] ACPI: CPPC: Fix access width used for PCC registers Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 084/110] ethernet: Add helper for assigning packet type when dest address does not match device address Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 085/110] net: b44: set pause params only when interface is up Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 086/110] stackdepot: respect __GFP_NOLOCKDEP allocation flag Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 087/110] fbdev: fix incorrect address computation in deferred IO Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 088/110] udp: preserve the connected status if only UDP cmsg Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 089/110] mtd: diskonchip: work around ubsan link failure Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 6.1 090/110] rust: remove `params` from `module` macro example Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 091/110] x86/tdx: Preserve shared bit on mprotect() Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 092/110] dmaengine: owl: fix register access functions Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 093/110] dmaengine: tegra186: Fix residual calculation Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 094/110] idma64: Dont try to serve interrupts when device is powered off Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 095/110] phy: marvell: a3700-comphy: Fix out of bounds read Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 096/110] phy: marvell: a3700-comphy: Fix hardcoded array size Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 097/110] phy: freescale: imx8m-pcie: Refine i.MX8MM PCIe PHY driver Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 098/110] phy: freescale: imx8m-pcie: fix pcie link-up instability Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 099/110] phy: rockchip-snps-pcie3: fix bifurcation on rk3588 Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 100/110] phy: rockchip-snps-pcie3: fix clearing PHP_GRF_PCIESEL_CON bits Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 101/110] dma: xilinx_dpdma: Fix locking Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 102/110] dmaengine: idxd: Fix oops during rmmod on single-CPU platforms Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 103/110] riscv: fix VMALLOC_START definition Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 104/110] riscv: Fix TASK_SIZE on 64-bit NOMMU Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 105/110] phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 106/110] i2c: smbus: fix NULL function pointer dereference Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 107/110] bounds: Use the right number of bits for power-of-two CONFIG_NR_CPUS Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 108/110] macsec: Enable devices to advertise whether they update sk_buff md_dst during offloads Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 109/110] macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst Greg Kroah-Hartman
2024-04-30 10:41 ` [PATCH 6.1 110/110] net/mlx5e: Advertise mlx5 ethernet driver updates sk_buff md_dst for MACsec Greg Kroah-Hartman
2024-04-30 16:47 ` [PATCH 6.1 000/110] 6.1.90-rc1 review SeongJae Park
2024-04-30 19:05 ` Florian Fainelli
2024-05-01  8:45 ` Ron Economos
2024-05-01 10:13 ` Naresh Kamboju
2024-05-01 11:33 ` Miguel Ojeda
2024-05-01 13:38 ` Jon Hunter
2024-05-01 19:45 ` Mateusz Jończyk
2024-05-01 19:46 ` Pavel Machek
2024-05-02  3:02 ` Shuah Khan
2024-05-02  6:41 ` Pascal Ernster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240430103047.609179828@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=patches@lists.linux.dev \
    --cc=pc@manguebit.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stfrench@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).