From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796386052; b=GOBWYKEhk1gSqtApuEuTRnRSsXoD45+SHD9pjCEdC12wDR7642IAzQDk430zY/oUN5mG stbZvhjhQXfrITEG6qazb33Yaw5Fd9l0aJteCDGrkU/7IQCe2jEWu/JrtlUGrs6E7dCUf t8lo9DHlxjYBQDDkxh/DQOymjVQQ8ros79SCpDnAa9PVLjf0XKBORMnsr8MwCnTmWtltR DdFwaZXwcecjsjxPxmcvgSY9oYEXlcYBSZQk991CgDkWGNoy3jd0YqaJmFUBHIbb/BzRB K4uDcdxzSn1g6f9Z3CnjQtN9NyGuk4xKWNf5nppwtlVk0WtyDdgPBby3UcApN6CWyMg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386052; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=8kXlyG5GqvhOmx2PS73n/jwrpRmN3/MzmalsE1lD6q8=; b=1dQ8rh/eIZLxcSJkKZcDiYvtOS4fN2j9cVdwJnwsuf9I6dbhoc58kRsnH2uR0sA6xuOT oFmB58VvdVYYb5fojhfnnGQWJFcdvPeAX/5sLBqPD4XhHM4m7nHrbimxk0Y/PwpP8LtIZ XalAeIthun4UJyVwJra1VCNFZ1ICohwEAdCEBVoy5jFMH+sKmDg1EMjsp9rlIx/jXJzs5 4hR7jlHiNT5ZOAlyopc4ovcNkF2d2EBbS3yapU0xt2TYz70tzS80tnKJF4WimhixZJx2h aHLZDgisGrIKzCEfPt00mCdG3sCLqWeTT0X4+rOFZiPcErKbr0BFrrZy61Dyw4nVIyg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=AremfbaU; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DFF9606A322; Fri, 4 Dec 2026 12:07:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=AremfbaU Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB5FC1F000CE; Fri, 4 Dec 2026 12:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386052; bh=8kXlyG5GqvhOmx2PS73n/jwrpRmN3/MzmalsE1lD6q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AremfbaUG+pXOU3Xq+9LShC4mDM2e51QCK3JJ3/brOrDqp3jxO5Qc5ievmPApAu1u Ee0dDnkXlMoRFpN1roC81vPD+qjmAPu1uhWuzU7nRn8Vdw28MCmd38QP/UoxA83QwO bbeGPpjOZbRSo20uK9wimUS84MspKpCOe8k6XM4s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dan Carpenter , Bharath SM , Steve French , Sasha Levin Subject: [PATCH 6.6 0804/1167] smb/client: Prevent error pointer dereference Date: Fri, 4 Dec 2026 19:03:51 +0900 Message-ID: <20261204100723.067386866@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter [ Upstream commit 7a2158b73c36903e8822dae5442c27d6d0e1014b ] The cifs_sb_tlink() function can return error pointers, but this code dereferences it before checking for error pointers. Re-order the code to fix that. Fixes: 0f9b6b045bb2 ("fs/smb/client: implement chmod() for SMB3 POSIX Extensions") Signed-off-by: Dan Carpenter Reviewed-by: Bharath SM Signed-off-by: Steve French Stable-dep-of: ffb59029c0d5 ("smb: client: validate descriptor headers before query result allocation") Signed-off-by: Sasha Levin --- fs/smb/client/cifsacl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c index bcbc963fe47a2..f88f76ea09f67 100644 --- a/fs/smb/client/cifsacl.c +++ b/fs/smb/client/cifsacl.c @@ -1730,14 +1730,16 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode, struct smb_ntsd *pntsd = NULL; /* acl obtained from server */ struct smb_ntsd *pnntsd = NULL; /* modified acl to be sent to server */ struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); - struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); + struct tcon_link *tlink; struct smb_version_operations *ops; bool mode_from_sid, id_from_sid; - bool posix = tlink_tcon(tlink)->posix_extensions; const u32 info = 0; + bool posix; + tlink = cifs_sb_tlink(cifs_sb); if (IS_ERR(tlink)) return PTR_ERR(tlink); + posix = tlink_tcon(tlink)->posix_extensions; ops = tlink_tcon(tlink)->ses->server->ops; -- 2.53.0