Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2222642/?format=api
{ "id": 2222642, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2222642/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260413085957.77355-1-phx0fer@gmail.com/", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/1.2/projects/12/?format=api", "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": "<20260413085957.77355-1-phx0fer@gmail.com>", "list_archive_url": null, "date": "2026-04-13T08:59:57", "name": "smb: client: Fix integer underflow in receive_encrypted_read()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "fe18e557a46327cef04b9c33352f986dff7418c4", "submitter": { "id": 93127, "url": "http://patchwork.ozlabs.org/api/1.2/people/93127/?format=api", "name": "Dudu Lu", "email": "phx0fer@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260413085957.77355-1-phx0fer@gmail.com/mbox/", "series": [ { "id": 499669, "url": "http://patchwork.ozlabs.org/api/1.2/series/499669/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=499669", "date": "2026-04-13T08:59:57", "name": "smb: client: Fix integer underflow in receive_encrypted_read()", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499669/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2222642/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2222642/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-10767-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=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=ZIdAzjIr;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10767-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"ZIdAzjIr\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.214.176", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com" ], "Received": [ "from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvLvs1bRpz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 19:00:09 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id BFC2A300233A\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 09:00:05 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 1BDB93A874A;\n\tMon, 13 Apr 2026 09:00:04 +0000 (UTC)", "from mail-pl1-f176.google.com (mail-pl1-f176.google.com\n [209.85.214.176])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id DCEB53AC0DC\n\tfor <linux-cifs@vger.kernel.org>; Mon, 13 Apr 2026 09:00:02 +0000 (UTC)", "by mail-pl1-f176.google.com with SMTP id\n d9443c01a7336-2b2494440f3so13843645ad.2\n for <linux-cifs@vger.kernel.org>;\n Mon, 13 Apr 2026 02:00:02 -0700 (PDT)", "from gmail.com (69-172-89-235.static.imsbiz.com. [69.172.89.235])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b2d4ddb742sm111717455ad.27.2026.04.13.02.00.00\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Mon, 13 Apr 2026 02:00:01 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776070804; cv=none;\n b=if4cIgg+Xle0q7mUHITCVxJdth0b6CXq9+3n/wjlp/mBp10IgqyK0aqk2jAUV5/3ePLHGF51AgQf9q7QxOr6xa3bLVSGNuEhQttuVTQGzNZN3affsc4EQRuC1+X/bkcKOv6osRVCI6QmlbUDokCMsvdnU9jX83PTj+aVjSP4rD8=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776070804; c=relaxed/simple;\n\tbh=4mzML9+7ImtcwlYZY6CyYI203HbmZJ7jqaHEyl+MrIQ=;\n\th=From:To:Cc:Subject:Date:Message-Id:MIME-Version;\n b=A8j/qEevjqPTTMs6av3ag3GIaErJFGplKDXhAEXSxXFFZY2ocMcfvUA32kkz0iaxVhqVuFYRVDHyaOl9KTmcbU5G5OTOKvGasxSLeynDhvDJPkfoOhx+9FKV3s1TE//ZyWc5p4vi8tFy39CDtpav/zumkEc+2aGFJ/gh1n9EEhc=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=ZIdAzjIr; arc=none smtp.client-ip=209.85.214.176", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776070802; x=1776675602;\n darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=4QuZI8wnRGhW1JqAONcbEsHyBYLDeETAby1pSr6OKFM=;\n b=ZIdAzjIro00fIoiRfaJkkHZ59ftU128ap+lDAJQMgMLLpDIH0cFqae0DGj33ij7727\n KpiexLxpE+9SbKl0RXtlsYulrwIbihZKg7+Wx07mR/RvjsQzJVhEPNZuah87UWDoV/uj\n zyYFBonQm6z9KiKq5AZUDhSIsx6mdfBy1MI125ITDpwyC/gd5Sr56ebAtoC2PDiYtx14\n wKbON6WrNNUxQkjVnl3dV4sh5YxSoePH7vnchl5atg3MKngHg08DDlGey/aNHTovCOio\n rcB39td3ALHNzg6gBvjdXTGI1OenfYQ8lnJ4oBq8X62Y17LmV8N4DRDlUYkD5ASec08F\n Bjdw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776070802; x=1776675602;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=4QuZI8wnRGhW1JqAONcbEsHyBYLDeETAby1pSr6OKFM=;\n b=Yqo74p/wSlsqT0wzylVWjY1tKzvLGqmTk8aId3A1NOwS1UYaeqtu05DKiZNc0UguPB\n bHwYO0HMcqXdLeS3PEyzYVeJnYEZBGFWdEg/3VlFIeZTkFjfRDeaVB2/L/s5S+TKubOf\n uu4Q2BI9dG8cWacbCifthujWqU+TGFBTnVcqZMT1botoChefsu4pXcRLBcEq4cqr+kg3\n GJFNQdgRrCNq0SxFaxlS07U9VXZ8pRWcDt4PfUrtnb6moOhoOk9f/n1vE0FhHMbjrdO5\n 4hsFU9yFMIXGT9d2K2tieOsjqlyMV1LWyjPpfIozzGSb32DrnvInLxBI5rdT5GxlccRp\n CjxA==", "X-Gm-Message-State": "AOJu0YxIDczuc7q7P8qq3qRu1hBJ1OaF/zRuODflWAOOMQGxwLwPqZV0\n\tuYqSEghxgrG4rinEHw2vUBf7eFeLa5zS69g/qEp8Ad8Zj6XEvhUJ1+nKkxdZFg==", "X-Gm-Gg": "AeBDies8r8VjmJZaGclZWsXq4TJp2BlA4WlrnrjiHZ0aZn8FNm0vHQm6KEkqt1HiZCG\n\t03Th3y64MN6atm1Yq2S+n8AvyYaTzL1mME/DCytRrbLsPTkDgOmo78El0Mn27/NE3UfQQy4PYSI\n\tezxh3F3+o5eu78EA5SgodBBWWc1kxMr82athqI2712X9e6K6/P/xDvg3D0qWiUnHoGxvRbGXXlN\n\tRuXaSAIZzVJd7s0oYReBJCvWmezj96fgtY6JDqtwrMrqxrbh/NEv6MJphhXZDzNk9hLTFxsGaZe\n\tiKxP2CxC01VbUOJ7p71FKx8l3YtICquRGDQhrUm4x08olPgvExU0mx7z5D8iyCIWAzSX6XGp8ue\n\thxzRqCgk10oP8yhYIhqlHWgFHZ1oSvhT3hjwxiddtAvdHFEh5XP0w7kESXc2GUO3UkxJWQvlh8p\n\tsPAly48Q58iOj0dLcuyRRjDKhGT5AD4+lLuB5IG8b251Ou46XS8ienS/1TZIj9GZpT", "X-Received": "by 2002:a17:903:1c1:b0:2b2:42da:25cc with SMTP id\n d9443c01a7336-2b2d5938b87mr123612545ad.1.1776070802050;\n Mon, 13 Apr 2026 02:00:02 -0700 (PDT)", "From": "Dudu Lu <phx0fer@gmail.com>", "To": "linux-cifs@vger.kernel.org", "Cc": "sfrench@samba.org,\n\tDudu Lu <phx0fer@gmail.com>", "Subject": "[PATCH] smb: client: Fix integer underflow in\n receive_encrypted_read()", "Date": "Mon, 13 Apr 2026 16:59:57 +0800", "Message-Id": "<20260413085957.77355-1-phx0fer@gmail.com>", "X-Mailer": "git-send-email 2.39.3 (Apple Git-145)", "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" }, "content": "In receive_encrypted_read(), the length of data to read from the socket\nis computed as:\n\n len = le32_to_cpu(tr_hdr->OriginalMessageSize) -\n server->vals->read_rsp_size;\n\nOriginalMessageSize comes from the server's transform header and is\nuntrusted. If a malicious server sends a value smaller than\nread_rsp_size (sizeof(struct smb2_read_rsp), ~80 bytes), the unsigned\nsubtraction wraps to a very large value (~4GB). This value is then\npassed to netfs_alloc_folioq_buffer() and cifs_read_iter_from_socket(),\ncausing either:\n - A massive allocation attempt that fails with -ENOMEM (DoS)\n - Under extreme memory pressure, potential heap corruption\n\nThe existing validation in smb3_receive_transform() only checks\nthat pdu_length >= orig_len + sizeof(transform_hdr), which does\nnot prevent orig_len from being smaller than read_rsp_size.\n\nFix this by adding a check that OriginalMessageSize is at least\nread_rsp_size before the subtraction.\n\nSigned-off-by: Dudu Lu <phx0fer@gmail.com>\n---\n fs/smb/client/smb2ops.c | 8 ++++++++\n 1 file changed, 8 insertions(+)", "diff": "diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c\nindex 509fcea28a42..ca90f96052d4 100644\n--- a/fs/smb/client/smb2ops.c\n+++ b/fs/smb/client/smb2ops.c\n@@ -4943,6 +4943,14 @@ receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid,\n \t\tgoto free_dw;\n \tserver->total_read += rc;\n \n+\tif (le32_to_cpu(tr_hdr->OriginalMessageSize) <\n+\t server->vals->read_rsp_size) {\n+\t\tcifs_server_dbg(VFS, \"OriginalMessageSize %u too small for read response (%u)\\n\",\n+\t\t\tle32_to_cpu(tr_hdr->OriginalMessageSize),\n+\t\t\tserver->vals->read_rsp_size);\n+\t\trc = -EINVAL;\n+\t\tgoto free_dw;\n+\t}\n \tlen = le32_to_cpu(tr_hdr->OriginalMessageSize) -\n \t\tserver->vals->read_rsp_size;\n \tdw->len = len;\n", "prefixes": [] }