{"id":2232190,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2232190/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260503141713.3266571-1-zisenye@stu.xidian.edu.cn/","project":{"id":12,"url":"http://patchwork.ozlabs.org/api/1.2/projects/12/?format=json","name":"Linux CIFS Client","link_name":"linux-cifs-client","list_id":"linux-cifs.vger.kernel.org","list_email":"linux-cifs@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260503141713.3266571-1-zisenye@stu.xidian.edu.cn>","list_archive_url":null,"date":"2026-05-03T14:17:13","name":"[v3,1/1] smb/client: fix out-of-bounds read in smb2_compound_op()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"362a4334b27d9996277d8c2fb85d9e4fc3cab15a","submitter":{"id":93303,"url":"http://patchwork.ozlabs.org/api/1.2/people/93303/?format=json","name":"Zisen Ye","email":"zisenye@stu.xidian.edu.cn"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260503141713.3266571-1-zisenye@stu.xidian.edu.cn/mbox/","series":[{"id":502577,"url":"http://patchwork.ozlabs.org/api/1.2/series/502577/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=502577","date":"2026-05-03T13:43:32","name":"smb/client: fix out-of-bounds read","version":3,"mbox":"http://patchwork.ozlabs.org/series/502577/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2232190/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2232190/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-cifs+bounces-11376-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-cifs@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" header.d=stu.xidian.edu.cn\n header.i=@stu.xidian.edu.cn header.a=rsa-sha256 header.s=dkim\n header.b=ceOFliCP;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-cifs+bounces-11376-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key)\n header.d=stu.xidian.edu.cn header.i=@stu.xidian.edu.cn header.b=\"ceOFliCP\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=162.243.164.118","smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=stu.xidian.edu.cn","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=stu.xidian.edu.cn"],"Received":["from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g7n1f2Gssz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 04 May 2026 00:18:14 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 1A449300251C\n\tfor <incoming@patchwork.ozlabs.org>; Sun,  3 May 2026 14:18:01 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id F13A53CCA16;\n\tSun,  3 May 2026 14:17:57 +0000 (UTC)","from zg8tmtyylji0my4xnjqumte4.icoremail.net\n (zg8tmtyylji0my4xnjqumte4.icoremail.net [162.243.164.118])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 2E7E03CCA19;\n\tSun,  3 May 2026 14:17:51 +0000 (UTC)","from Jason.localdomain (unknown [113.200.174.116])\n\tby hzbj-edu-front-4.icoremail.net (Coremail) with SMTP id\n BrQMCkBW_rnqWPdp1wnmAQ--.36047S2;\n\tSun, 03 May 2026 22:17:18 +0800 (CST)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777817877; cv=none;\n b=m1im6iHTzyAAUbsiJHeKwv7ri1jC+acehyFaQvDMH4n+7zystW8AyukcQL6WRBZpORgvB59NqnvzbknsSqRZUfCB9mfs02lP8j0InffnA3Kki6o3LeHD2CGvJzRSWkqHDhn6ksGZY+FBtu9484Tb/BAwciwJZ+i8s6scVHj840Y=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777817877; c=relaxed/simple;\n\tbh=G8WhrViqZVp0/f8PtsUG9cP4gPGLdc1zjS0z6BmiEh0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=tA0NjBGLdHC2hfwMGKMDiDkeZQoydmALOLMXiAEmLrIfd2BNpCN7Niq8koQq/vuJ/1ki+thVAj/df3dMMpOofrfpp3yaHJZfoErS1fQoeblnEoZoE1YdYYndeGbijjXMYOpfiZfFku8y5uq9PaxBkcBtTss1Y3BRGo/Rks+j0Yk=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=stu.xidian.edu.cn;\n spf=pass smtp.mailfrom=stu.xidian.edu.cn;\n dkim=fail (0-bit key) header.d=stu.xidian.edu.cn header.i=@stu.xidian.edu.cn\n header.b=ceOFliCP reason=\"key not found in DNS\";\n arc=none smtp.client-ip=162.243.164.118","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=stu.xidian.edu.cn; s=dkim; h=Received:From:To:Cc:Subject:Date:\n\tMessage-ID:In-Reply-To:References:MIME-Version:\n\tContent-Transfer-Encoding; bh=uFdS4EjUMcBjmFcrFxUqHiVLklajdDY94y\n\tiVL9A6lig=; b=ceOFliCPZ0TvmFpO4mHmXWJKvsDrCuYTKoUAYP3nPMChJg2R/M\n\tvMQZG6eI5oNlxff1uCbjvEiGTC+azKXVksXRuEU4DzqHp8hpra9TUpa5A3jVWREc\n\tN6HVCev1v7FROTschr/uSOj3UVXiB6Wc6jvo5i3eLDhANPsxwRd71xr68=","From":"zisenye@stu.xidian.edu.cn","To":"smfrench@gmail.com,\n\tlinkinjeon@kernel.org,\n\tpc@manguebit.org,\n\tronniesahlberg@gmail.com,\n\tsprasad@microsoft.com,\n\ttom@talpey.com,\n\tbharathsm@microsoft.com,\n\tsenozhatsky@chromium.org,\n\tdhowells@redhat.com,\n\tgregkh@linuxfoundation.org,\n\tchenxiaosong@chenxiaosong.com,\n\tstable@vger.kernel.org","Cc":"linux-cifs@vger.kernel.org","Subject":"[PATCH v3 1/1] smb/client: fix out-of-bounds read in\n smb2_compound_op()","Date":"Sun,  3 May 2026 22:17:13 +0800","Message-ID":"<20260503141713.3266571-1-zisenye@stu.xidian.edu.cn>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20260503134333.3260640-1-zisenye@stu.xidian.edu.cn>","References":"<20260503134333.3260640-1-zisenye@stu.xidian.edu.cn>","Precedence":"bulk","X-Mailing-List":"linux-cifs@vger.kernel.org","List-Id":"<linux-cifs.vger.kernel.org>","List-Subscribe":"<mailto:linux-cifs+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-cifs+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-CM-TRANSID":"BrQMCkBW_rnqWPdp1wnmAQ--.36047S2","X-Coremail-Antispam":"1UD129KBjvJXoW7KFy3Xr43KrWkGFW3tF1kKrg_yoW8Gw4Dpr\n\t4qga15Cr13twnrCw4kGw1Du3yFka4UArsxCFWjv3yfCanxAr97Ka4qyr92gr1Fkws5uFyS\n\t9F4q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gAAsI"},"content":"From: Zisen Ye <zisenye@stu.xidian.edu.cn>\n\nIf a server sends a truncated response but a large OutputBufferLength, and\nterminates the EA list early, check_wsl_eas() returns success without\nvalidating that the entire OutputBufferLength fits within iov_len.\n\nThen smb2_compound_op() does:\n    memcpy(idata->wsl.eas, data[0], size[0]);\n\nWhere size[0] is OutputBufferLength. If iov_len is smaller than size[0],\nmemcpy can read beyond the end of the rsp_iov allocation and leak adjacent\nkernel heap memory.\n\nLink: https://lore.kernel.org/linux-cifs/d998240c-aca9-420d-9dbd-f5ba24af19e0@chenxiaosong.com/\nFixes: ea41367b2a60 (\"smb: client: introduce SMB2_OP_QUERY_WSL_EA\")\nCc: stable@vger.kernel.org\nSigned-off-by: Zisen Ye <zisenye@stu.xidian.edu.cn>\nReviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>\n---\n fs/smb/client/smb2inode.c | 3 +++\n 1 file changed, 3 insertions(+)","diff":"diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c\nindex 286912616c73..28e01d02be03 100644\n--- a/fs/smb/client/smb2inode.c\n+++ b/fs/smb/client/smb2inode.c\n@@ -121,6 +121,9 @@ static int check_wsl_eas(struct kvec *rsp_iov)\n \tea = (void *)((u8 *)rsp_iov->iov_base +\n \t\t      le16_to_cpu(rsp->OutputBufferOffset));\n \tend = (u8 *)rsp_iov->iov_base + rsp_iov->iov_len;\n+\tif ((u8 *)ea + outlen > end)\n+\t\treturn -EINVAL;\n+\n \tfor (;;) {\n \t\tif ((u8 *)ea > end - sizeof(*ea))\n \t\t\treturn -EINVAL;\n","prefixes":["v3","1/1"]}