From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.154 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796015642; b=lWh3knqrZBg5Ejk8pCH3DFdNw7miU8YcZ/EF1tHerLffXYStoVjNbdY6g9w2IgjBvUFu ZxRzL9SRmqvCVRKdZQ2uUs1OIJDv0E3oqeT30YGCoBGECH71P8Qfo86SBE2YM/it8mUdj 2mRjS/YHA7PJ+VA/5Et2JxJQuk6ndhyHGtPadGmN1ChlbngIeKt1RL677N+cVHbwmo5fH gGK7favbXOQsKKrxyDBSBanq1Y8Dz4CUHw8ELnOq7LwS/TvopXhuOvDofR+XYelXcSPqP LG1Fr3W41KVfjFcswxMP+3AnqDbqi5PZ8JY9r7pBXyQ/ubzfUM5lrlc0ZxME85Lq0FA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796015642; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=ZLDRHPtP+htIv0tqxbH+1BjnpD2r+y4OS7gT6//8BJ8=; b=MtyEdPgBeUKJL37sxPjaqCBi23QE2v+oVPfoj54Tr+Lig32ksxa9yG04TMoq/22wCFW8 afjc4ls4c4IeKK9h7+9dWJ5cvTzeS+E3faZB/0kDu2iioX77bZ1M+kVpHlkYyssBj/mr/ /MzFszXwy9FNhbwNmF0RYLZwV3lCAr+i2d+bhrehtXNqpb6WpZ1V+e5qC+TshF8ZHZS/U 2Kw6QXW/bzjK2IApCW6sgLAOzOO9khJQTQ5c0CtXbvzA9j9AJurZnr/NB9hpvaZUwr9s9 HFxzKCY1pxvbtsoTJfRAqB7fiap7+vY68RmlZ1qkj2QJ+mnnZ7tI3h3alr4h13bGPhA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=fastmail.org; spf=pass smtp.mailfrom=fastmail.org; dkim=pass header.d=fastmail.org header.i=@fastmail.org header.a=rsa-sha256 header.s=fm3 header.b=ino6esfM; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=kmJ8ytJc; arc=none smtp.remote-ip=103.168.172.154 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD7FF606A327 for ; Mon, 30 Nov 2026 05:14:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AD7FF606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=fastmail.org header.i=@fastmail.org header.a=rsa-sha256 header.s=fm3 header.b=ino6esfM; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=kmJ8ytJc Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id C022614001D0 for ; Mon, 30 Nov 2026 00:14:00 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Mon, 30 Nov 2026 00:14:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to; s=fm3; t=1796015640; x=1796102040; bh=ZLDRHPtP+htIv0tqxbH+1 BjnpD2r+y4OS7gT6//8BJ8=; b=ino6esfMxXMloGOI3jhVlT9xNZ04RklGbltn8 n2V7BHILOXPJFvIkSwLMkyIKWx4AczSjT5JxvO4ghNdWGDZComu4r+ZL12xitU7i l9ePZUtMP7qTzPrJKUAiyHj3zLVfyd8HO14mjnZSYTyIFziSNJ4+5IKlMlXow/jr msRtMQPLwVjoUdoK7eIr1udBEYxwkWBWDVRLR14L7GcuzUnFVV3x/D9IHLm2eMXv lR7D0sCJpRXtyWIkjmlEhjo71QSjOf4WQ144YLaGLF1SMdikFn/H5tMzd+thifli wB2gVG+rKKMMUyds0SWvOzB/dqDLfvA3upH5z1+bnpcXpIX8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1796015640; x=1796102040; bh=ZLDRHPtP+htIv0tqxbH+1BjnpD2r+y4OS7g T6//8BJ8=; b=kmJ8ytJc/0DUi39kq1HrbAhg/fSe/HPRrABiXOLKG/MuLSnPF6m xIMoKwc+oB9v0JXIEpzYJzG435T2NxwQi4ezuV09V3rgltmydqvcM0U5042m7cjM mhM7W+wQl+bqF5ia59tMf/NAeilepKMBhxSVpQbZBCXYW2SrHL4Neyt0pqJOxf6J WGXk3QM1EfHnPWoDBkyhEPnr93VORbGzxRwx31SbL7mqGqWwnVlTHPu6fXOF6zmo ftaC3oBY4Xa8HTYDRv6lsz8/lo4l37UG+gpE4lDbPRYN8wmvSSIbzMzTiU8JTbCF qS2UsvhhgSp16xBDZZB7bZ2a5wQXnf878hQ== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=fastmail.org a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796015640; d=fastmail.org; mf=PGljYkBmYXN0bWFpbC5vcmc+; rt=PGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:eMzqKOTBpf6GRBvH5pDxagVslI+7AO+2Knj+rL7TMU2J++c Sjofkky2QX95LCjS5hM5uFgE+C8L/nvq4S9rfhJT8/MYsWg66rADl1n2WXA91/+D dBvFnzrFCocUwa3fmjhES8/Ip9xST+7nFzP1hjI0Ud9wtqJMOVEAC4yP6R9G3xe/ A5GGKBZ6POZljIv7FwtuUTDTHfWb7PcE43ki2LQI0uonY9n5F+ki5SbhCaOIb1pI N+qU6RrI/q6uxfvSPae1jrYU/HZgT+31BzaMlifwPak/e32u21bTVlJjM4XvBUVn /PzPJBREqaoNMroFFT+5MND1geso4DQNzaQIePA==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=9; hn=cc,content-transfer-encoding,date,feedback-id,from, message-id,mime-version,subject,to; Message-Instance: m=1; h=sha256:3FecTSpZ0qdCK2kFqquj/O0y1rmimc5DbReQ6P0348I=:KvoJYCLWnUDQzEUAiD0b3BDs8sZmafNorq2YUmjnPLI=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFvPaEwqkW69owC18MuPxerUqREXLKWKwgmg8EjU9dzNXyn8k30RDZWngX+mgemir hBU8oip9kKqPNSOVmeKQFgMXX4qqEKdVLKqBtfihACTjT/Wr/ENBBOKYt3mkLcAJXIIw5w DDw6ns113Z1CtdMP9ZPScqmhgohy7/voUjW7Yj5/UglDyzZ3TSi9mHfKoAOE96vNfbJSmw BPLN/2EWfQz+iPeyzfCvGj2V+Ef/3efddZzQ3g4U1TYRVmFLk7wofExVuRdOYYzJwHe0Ga qng5QooY7sIDY3aaxIMHD+xNBI57Vncs7dVBqUoVd7NgVX2C/5cNvbcvrGYL24waN1yufp HBZFTPs9tLiBY1QFLdcU6++fQvHtz/mMwzhEOeFhyKn4yJnR+A/TLULY3FRWvqJgQKspPU FI41eNXUKudkQhU0SKL3+5/bK25+tMZIKzfY7p97CXRSmcj6HzRHdfC3RUUrCHtltf1YVF rmTi7PvEAnTTR5/OHw6GTx5leLVerKpKxRdtPT1nVF0kLgi0VB2Pifoh4i/tEMj6KnvfNw 9KbGT8SudZHKS6QQIQ2HDFK/fnT9xeJEDWI5hbZ872PZduarzt0M0r/Kr3YVyn6lt4tmY0 5d+hZV5aEAjcGT6uC0HrvqdXTTLrgRlvgMa7xwXtjHkw/szUsMIdlvYAB+FQ X-ME-Proxy: Feedback-ID: ib53e4b78:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Nov 2026 00:13:59 -0500 (EST) From: Ian Bridges To: linkinjeon@kernel.org Cc: senozhatsky@chromium.org, tom@talpey.com, chenxiaosong@chenxiaosong.com, linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, Ian Bridges Subject: [PATCH 0/4] ksmbd: fix the checks on an open of an existing file Date: Sun, 29 Nov 2026 23:13:45 -0600 Message-ID: X-Mailer: git-send-email 2.47.3 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit These patches fix four bugs in an open of an existing file. Patch 1 stops a delete-on-close open from deleting a read-only file on a share that does not store DOS attributes. Patch 2 fails an overwrite or supersede of a directory, which ksmbd lets succeed. Patch 3 fails an overwrite of a hidden or system file that leaves the attribute out, which ksmbd lets empty the file. Patch 4 refuses write access to a read-only file. Patch 1 adds the attribute read used by patches 3 and 4. Patch 2 adds the disposition check used by patch 3. The patches apply in the order shown. Tests ===== I tested the series on ksmbd-for-next b572ec503ef0, on x86_64 with KASAN. - Each patch builds with W=1 and sparse. The series adds no smatch warning. - A script sent one request for each changed rule to the base and to the tree at each patch. Each request got the status that its patch describes. The requests that are not meant to change, POSIX opens among them, gave the same results as on the base. - smbtorture gives the same results at each patch as on the base. KASAN reported nothing. This series was developed with LLM assistance. Ian Bridges (4): ksmbd: check the cached read-only attribute for delete-on-close ksmbd: fail an overwrite or supersede of a directory ksmbd: fail an overwrite that would clear the hidden or system attribute ksmbd: refuse write access to a read-only file at open fs/smb/server/smb2pdu.c | 131 +++++++++++++++++++++++++++++++------- fs/smb/server/vfs_cache.c | 23 +++++++ fs/smb/server/vfs_cache.h | 1 + 3 files changed, 133 insertions(+), 22 deletions(-) base-commit: b572ec503ef0c9dc74507b4a624df7f218da6a64 -- 2.47.3