From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BFD726E143; Mon, 13 Oct 2025 15:44:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760370257; cv=none; b=cYZAV3VRwN/jlsLQt6ivVfknvOczsnmSS6BQMYwTfeSFJJjWOwHnlPrYhtLdRDgocmAy0/MvinRZUKNQZ947knLd8eOtN1ruWPZYDFYHVervnm5whTt87ntZALAOrer25XlQFzJU2xCtl7ytLyPR9QDOA3U5eBwy6ZPxy33fv3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760370257; c=relaxed/simple; bh=IsMG7hOXOI0TgOw8E58omrvczZe7jioTgm+DKnT43AM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MBCMR8xQqV/P6I3VGxwSMY+5XqjzIMpmS8Mg4W1dFentL1pN8zvk7CCUVuWWNWd3i0LKvDrUwtNhaJ7CDJnkRji7P5s6u2wzSnJByb2N3xcbka6DT9J0SjwhQmiwhHZKu9az2ZXqPFFWA0SFCx6wnQAnHd1anNjNPb+bybsxdSc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=y1xPSHg2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="y1xPSHg2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8CC9C116C6; Mon, 13 Oct 2025 15:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760370257; bh=IsMG7hOXOI0TgOw8E58omrvczZe7jioTgm+DKnT43AM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y1xPSHg2OIeNhbHdtpSwr+V28xdT10iJj89ncu9JXEBJUfXDajrwxWO9WsdieqA0u UtEFwBHop14LisrgmnhYwNX2djXSRi3BSMbxCuTB0zXeO18guL682OLLLqvv8JZI+V il29cSALwhddHj0UcdUoJQ1qgeaPP9oyp+SnyHM0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Matvey Kovalev , Namjae Jeon , Steve French Subject: [PATCH 6.17 534/563] ksmbd: fix error code overwriting in smb2_get_info_filesystem() Date: Mon, 13 Oct 2025 16:46:35 +0200 Message-ID: <20251013144430.654808770@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251013144411.274874080@linuxfoundation.org> References: <20251013144411.274874080@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matvey Kovalev commit 88daf2f448aad05a2e6df738d66fe8b0cf85cee0 upstream. If client doesn't negotiate with SMB3.1.1 POSIX Extensions, then proper error code won't be returned due to overwriting. Return error immediately. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: e2f34481b24db ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org Signed-off-by: Matvey Kovalev Acked-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/smb/server/smb2pdu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -5628,7 +5628,8 @@ static int smb2_get_info_filesystem(stru if (!work->tcon->posix_extensions) { pr_err("client doesn't negotiate with SMB3.1.1 POSIX Extensions\n"); - rc = -EOPNOTSUPP; + path_put(&path); + return -EOPNOTSUPP; } else { info = (struct filesystem_posix_info *)(rsp->Buffer); info->OptimalTransferSize = cpu_to_le32(stfs.f_bsize);