get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2217538/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2217538,
    "url": "http://patchwork.ozlabs.org/api/patches/2217538/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/patch/20260330060926.751031-1-sebasjosue84@gmail.com/",
    "project": {
        "id": 21,
        "url": "http://patchwork.ozlabs.org/api/projects/21/?format=api",
        "name": "Linux Tegra Development",
        "link_name": "linux-tegra",
        "list_id": "linux-tegra.vger.kernel.org",
        "list_email": "linux-tegra@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260330060926.751031-1-sebasjosue84@gmail.com>",
    "list_archive_url": null,
    "date": "2026-03-30T06:09:26",
    "name": "[v2] staging: nvec: validate battery response length before memcpy",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "bc8eb96236011f6530ff802cefa5325437e9c29c",
    "submitter": {
        "id": 92955,
        "url": "http://patchwork.ozlabs.org/api/people/92955/?format=api",
        "name": "Sebastián Alba Vives",
        "email": "sebasjosue84@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-tegra/patch/20260330060926.751031-1-sebasjosue84@gmail.com/mbox/",
    "series": [
        {
            "id": 497957,
            "url": "http://patchwork.ozlabs.org/api/series/497957/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/list/?series=497957",
            "date": "2026-03-30T06:09:26",
            "name": "[v2] staging: nvec: validate battery response length before memcpy",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/497957/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217538/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217538/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-tegra+bounces-13402-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-tegra@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=bs4qHoHG;\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-tegra+bounces-13402-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=\"bs4qHoHG\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.217.44",
            "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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fkgpL61jqz1xrn\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 17:10:18 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id ED1F73003617\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 06:10:14 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 73FCC385512;\n\tMon, 30 Mar 2026 06:10:13 +0000 (UTC)",
            "from mail-vs1-f44.google.com (mail-vs1-f44.google.com\n [209.85.217.44])\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 E185D278779\n\tfor <linux-tegra@vger.kernel.org>; Mon, 30 Mar 2026 06:10:11 +0000 (UTC)",
            "by mail-vs1-f44.google.com with SMTP id\n ada2fe7eead31-6052f9376bfso159220137.2\n        for <linux-tegra@vger.kernel.org>;\n Sun, 29 Mar 2026 23:10:11 -0700 (PDT)",
            "from localhost.localdomain ([2a09:bac6:d6d9:aa::11:1d6])\n        by smtp.gmail.com with ESMTPSA id\n ada2fe7eead31-60512d3a037sm7133561137.9.2026.03.29.23.10.08\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Sun, 29 Mar 2026 23:10:10 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774851013; cv=none;\n b=hBxhsS4WXOdfc8jc12a0QoEw/8JySh99K5VRkc7+TLlAKhbqtvZcNuWWmPXth9/2M2DV3XqI0UIGD3Sd29BeC8NpFlKdWo/04gJlM03mLST74NhcsW5k/9ZYPa/SCz3q1Shh5P7xZ+NQpsMhN3J6mFChcawFXQhoGk79UZNH9Co=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774851013; c=relaxed/simple;\n\tbh=57DrXeQnUGc6iR/CXOWyyyVZBnQ5MkHIKUWHPpAsMcI=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type;\n b=DlmigKqIHa4wPSQpm5BB3Xb0DKNy04CEjOeTJJRg+9wYIJwAM9MbCmItrh2vEes1pji7W/WaDAaQJi6936IM0nRBLA2yZu2SiIIqsnZoMp3nHbqQuXSmgWQytZx6Q3GCoTCa81hyICfvZRReiitpdF6n3jIiCMounfw6hhzMIiY=",
        "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=bs4qHoHG; arc=none smtp.client-ip=209.85.217.44",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1774851011; x=1775455811;\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=SVkfdJP2KulZKEM0URtofZekmehI6WAdAhgF+udGJlg=;\n        b=bs4qHoHGkb7YdhSUMkLyR+fYZeSFTOyp4dW7olvEW9+8evk+HFAWsU6JLCVPjeHJoA\n         Q5xxHR6Nz9RorRUQMREo0aDKfEZEShpTdNU6CUuoykOV1qfNAbVaJzhyNsMFJe+Dilb/\n         1x9I4XwVTRhciWZtTCWv6ovp4wrwjlQYDyKOL8fXOAiC7rFjHI4Dj2+YP+Pq4QBFv+nl\n         D8vYMgZX4imi+/6XhRZJXow5hBRVb4QQVn7anFYyRnGH2SeSdlIkleFONdXOGkHxkuw9\n         feA16jCUxVLnmhRC5bgWpjz0Jq1fnHjbqlhAUeRVrPjGJkVckorUgpxK7bkpB9jgimsU\n         JVtw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1774851011; x=1775455811;\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=SVkfdJP2KulZKEM0URtofZekmehI6WAdAhgF+udGJlg=;\n        b=UmkzSfIcsZQKfqfqDDIji9shgEIFhqNLjyHIQsy9mwas2CBifBlFowVIWDvoTUXQOt\n         Sj8W/YSGOkDgRUrDJ05OApNK+QCJrAiAX8Mcr+6565RNx2ZCroLh4IdfaHwyGNMYS5u+\n         0EhVXGBdDS9lIs0ZJ9Hlu9qCV2CXt9MIA0zXgDgKFLb6JN4+z2vf5pxZ8c2YvSy9z/cC\n         iLTw5YI28ALHIPzrd5bDznN4O0UFtve2tZfWbZqKSNlFfTKapY/1GDLM10dBQS4YEDR3\n         9E4e+1S3kltADGx8OvueHrsqryvU4Cabzg3LyP5pp68boChoVCir3ABc7WimIrIuVHzH\n         rHCA==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCU7oieq3KIQ6aXeLujgteDUVcrywCAgjnVCDrRw9besnrtPBJuEZZKiETmB3w48bdJe5kUiTmzbvjW6lw==@vger.kernel.org",
        "X-Gm-Message-State": "AOJu0YxvQzOn5swRlYXkll7EMUd+oL8KerxU8MOsVjj1HsNQqZ9+NsxY\n\tqDz1cPXuA4aKxXBTxsXFnnyfaXxtnogJHCn3/fQM9hSiL5GIVwbOj+yW8ox4VWp+ZKE=",
        "X-Gm-Gg": "ATEYQzw+pf5bFYMuXsZqMyBk4MWIHYpE4gMvRTsR385NQuMFf7Zcjg8IuQOXHRLc0XM\n\tV9e8/Y6TmqylTbDVm30694BHxAevqBM68p0PmhxcDJPGNer4JRVq39sPOZd2UeST7APvBQVJrPz\n\tIMKspUGZ2cSU31DW4A+7LZLz9fD16X4daKAb0p/utp2X0C9uTxrj578c9T7BvZKy2K44NLwudf0\n\tuPHeyEPSui2Tu+gkaFxuwfxJMv5AwWXrdtqlCAqjrYU78g8H2LjN6+Ff7u0kXG/FtwDwkSNHxoH\n\tTPS2sOGsd9VrPxIkqBWtQmczrYeOIKMathSGeuH6oTjNVafYz2mjxYB8GMebpPbz4T54ES+YaLZ\n\tmm+1QDk+H+iyroDDdtuqj3ENQst+hLVeaNWJD2uRhD8v+Dx89HxYdFCvBcBA1tLgI8dnks9I+Qc\n\twuHPX7wJQbGj8FbMR0AuCm4e9f",
        "X-Received": "by 2002:a05:6102:cd0:b0:603:2173:d75e with SMTP id\n ada2fe7eead31-604f8d8b751mr3805351137.0.1774851010812;\n        Sun, 29 Mar 2026 23:10:10 -0700 (PDT)",
        "From": "Sebastian Josue Alba Vives <sebasjosue84@gmail.com>",
        "To": "gregkh@linuxfoundation.org",
        "Cc": "marvin24@gmx.de, linux-staging@lists.linux.dev, ac100@lists.launchpad.net,\n linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,\n stable@vger.kernel.org,\n =?utf-8?q?Sebasti=C3=A1n_Alba_Vives?= <sebasjosue84@gmail.com>",
        "Subject": "[PATCH v2] staging: nvec: validate battery response length before\n memcpy",
        "Date": "Mon, 30 Mar 2026 00:09:26 -0600",
        "Message-ID": "<20260330060926.751031-1-sebasjosue84@gmail.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-tegra@vger.kernel.org",
        "List-Id": "<linux-tegra.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-tegra+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-tegra+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "From: Sebastián Alba Vives <sebasjosue84@gmail.com>\n\nIn nvec_power_notifier(), the response length from the embedded\ncontroller is used directly as the size argument to memcpy() when\ncopying battery manufacturer, model, and type strings. The\ndestination buffers (bat_manu, bat_model, bat_type) are fixed at\n30 bytes, but res->length is a u8 that can be up to 255, allowing\na heap buffer overflow.\n\nAdditionally, if res->length is less than 2, the subtraction\nres->length - 2 wraps around as an unsigned value, resulting in a\nlarge copy that corrupts kernel heap memory.\n\nIntroduce NVEC_BAT_STRING_SIZE to replace the hardcoded buffer\nsize, store res->length - 2 in a local copy_len variable for\nclarity, and add bounds checks before each memcpy to ensure the\ncopy length does not exceed the destination buffer and that\nres->length is at least 2 to prevent unsigned integer underflow.\n\nTested-by: Marc Dietrich <marvin24@gmx.de>\nCc: stable@vger.kernel.org\nSigned-off-by: Sebastián Alba Vives <sebasjosue84@gmail.com>\n---\nv2:\n  - Introduce NVEC_BAT_STRING_SIZE constant to replace hardcoded\n    buffer size (Marc Dietrich)\n  - Store res->length - 2 in local copy_len variable for clarity\n    (Marc Dietrich)\n  - Use NVEC_BAT_STRING_SIZE in strncmp call for consistency\n drivers/staging/nvec/nvec_power.c | 41 +++++++++++++++++++++----------\n 1 file changed, 28 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/staging/nvec/nvec_power.c b/drivers/staging/nvec/nvec_power.c\nindex 2faab9fde..7b7980127 100644\n--- a/drivers/staging/nvec/nvec_power.c\n+++ b/drivers/staging/nvec/nvec_power.c\n@@ -19,6 +19,7 @@\n #include \"nvec.h\"\n \n #define GET_SYSTEM_STATUS 0x00\n+#define NVEC_BAT_STRING_SIZE 30\n \n struct nvec_power {\n \tstruct notifier_block notifier;\n@@ -38,9 +39,9 @@ struct nvec_power {\n \tint bat_temperature;\n \tint bat_cap;\n \tint bat_type_enum;\n-\tchar bat_manu[30];\n-\tchar bat_model[30];\n-\tchar bat_type[30];\n+\tchar bat_manu[NVEC_BAT_STRING_SIZE];\n+\tchar bat_model[NVEC_BAT_STRING_SIZE];\n+\tchar bat_type[NVEC_BAT_STRING_SIZE];\n };\n \n enum {\n@@ -192,22 +193,36 @@ static int nvec_power_bat_notifier(struct notifier_block *nb,\n \tcase TEMPERATURE:\n \t\tpower->bat_temperature = res->plu - 2732;\n \t\tbreak;\n-\tcase MANUFACTURER:\n-\t\tmemcpy(power->bat_manu, &res->plc, res->length - 2);\n-\t\tpower->bat_manu[res->length - 2] = '\\0';\n+\tcase MANUFACTURER: {\n+\t\tsize_t copy_len = res->length - 2;\n+\n+\t\tif (res->length < 2 || copy_len > NVEC_BAT_STRING_SIZE - 1)\n+\t\t\tbreak;\n+\t\tmemcpy(power->bat_manu, &res->plc, copy_len);\n+\t\tpower->bat_manu[copy_len] = '\\0';\n \t\tbreak;\n-\tcase MODEL:\n-\t\tmemcpy(power->bat_model, &res->plc, res->length - 2);\n-\t\tpower->bat_model[res->length - 2] = '\\0';\n+\t}\n+\tcase MODEL: {\n+\t\tsize_t copy_len = res->length - 2;\n+\n+\t\tif (res->length < 2 || copy_len > NVEC_BAT_STRING_SIZE - 1)\n+\t\t\tbreak;\n+\t\tmemcpy(power->bat_model, &res->plc, copy_len);\n+\t\tpower->bat_model[copy_len] = '\\0';\n \t\tbreak;\n-\tcase TYPE:\n-\t\tmemcpy(power->bat_type, &res->plc, res->length - 2);\n-\t\tpower->bat_type[res->length - 2] = '\\0';\n+\t}\n+\tcase TYPE: {\n+\t\tsize_t copy_len = res->length - 2;\n+\n+\t\tif (res->length < 2 || copy_len > NVEC_BAT_STRING_SIZE - 1)\n+\t\t\tbreak;\n+\t\tmemcpy(power->bat_type, &res->plc, copy_len);\n+\t\tpower->bat_type[copy_len] = '\\0';\n \t\t/*\n \t\t * This differs a little from the spec fill in more if you find\n \t\t * some.\n \t\t */\n-\t\tif (!strncmp(power->bat_type, \"Li\", 30))\n+\t\tif (!strncmp(power->bat_type, \"Li\", NVEC_BAT_STRING_SIZE))\n \t\t\tpower->bat_type_enum = POWER_SUPPLY_TECHNOLOGY_LION;\n \t\telse\n \t\t\tpower->bat_type_enum = POWER_SUPPLY_TECHNOLOGY_UNKNOWN;\n",
    "prefixes": [
        "v2"
    ]
}