Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2222566/?format=api
{ "id": 2222566, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2222566/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/patch/20260412205117.387125-1-hossu.alexandru@gmail.com/", "project": { "id": 21, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260412205117.387125-1-hossu.alexandru@gmail.com>", "list_archive_url": null, "date": "2026-04-12T20:51:16", "name": "[3/5] staging: nvec: fix use-after-free in nvec_rx_completed()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "c73fa6905b08615c01e42f808f7d04427f91e4bc", "submitter": { "id": 92777, "url": "http://patchwork.ozlabs.org/api/1.2/people/92777/?format=api", "name": "Alexandru Hossu", "email": "hossu.alexandru@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-tegra/patch/20260412205117.387125-1-hossu.alexandru@gmail.com/mbox/", "series": [ { "id": 499631, "url": "http://patchwork.ozlabs.org/api/1.2/series/499631/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/list/?series=499631", "date": "2026-04-12T20:51:16", "name": "[1/5] staging: media: tegra-video: add NULL checks for of_device_get_match_data()", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499631/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2222566/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2222566/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-tegra+bounces-13722-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=sTQhSVU/;\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-tegra+bounces-13722-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=\"sTQhSVU/\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.208.49", "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 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 4fv2mj24hDz1yGg\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 06:52:53 +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 CB1593001F8F\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 12 Apr 2026 20:52:49 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 1BE2B37F8D0;\n\tSun, 12 Apr 2026 20:52:49 +0000 (UTC)", "from mail-ed1-f49.google.com (mail-ed1-f49.google.com\n [209.85.208.49])\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 6D75E37F8A2\n\tfor <linux-tegra@vger.kernel.org>; Sun, 12 Apr 2026 20:52:47 +0000 (UTC)", "by mail-ed1-f49.google.com with SMTP id\n 4fb4d7f45d1cf-66bd4e0560fso4997203a12.0\n for <linux-tegra@vger.kernel.org>;\n Sun, 12 Apr 2026 13:52:47 -0700 (PDT)", "from ahossu.residents.sin.openfiber.nl ([88.202.160.248])\n by smtp.gmail.com with ESMTPSA id\n a640c23a62f3a-b9d6dfd78f6sm263126266b.26.2026.04.12.13.52.43\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 12 Apr 2026 13:52:44 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776027168; cv=none;\n b=N0b7PKK/MC9g+G6XflqnvUT3gHXvsHcEnrWn4Y2J4cFhGDyxpwZln42/KeeKTyQ6f5g6ZzwiyUiNjpamzAtp2gXlF36WrIzIE+vmYSyP7RUQYap0PlWHfl0Y5yqwDZsmzQ1VnF5/6PJ+jAEo3mfzzDbg0De5RU5HATMfgnEUKd8=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776027168; c=relaxed/simple;\n\tbh=PT3xs71fHd+54WioIwbDh1RrwxMQVhrEdhvCl0wP16c=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=nG+Gze9TvqlsHBcTfJcRBHXDLh+qDEpDEDphZIq8dXFvrPVmbUiyIb42IcH4VP6Xj8PwH4U/eNdnLNvk7Bic90hRB8df4hP3ZQOI6DnifJwqQZOsn9C3JaLGZNLVagM8Az9ecZQyyWvjtrpXmmOiUADQQZQJF0tPkBRoHA8m50c=", "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=sTQhSVU/; arc=none smtp.client-ip=209.85.208.49", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776027166; x=1776631966;\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=NmfBAQ0D3Sa5sjeFp529b93qLEW05p6njf5APTbVpD8=;\n b=sTQhSVU/IH83hnoGF0DodvRW+6ZsHGHWekDo0X1WpRCJYtf3Kht5EUpJL/2DLA3n6U\n u50zP2rwJAPsnkz5kpguCeyHHj4BF4XIp6U5qN1VdXK0IjJLIViOAZb6o2SHVZuztwvM\n A8IJ7QY/cy8U4uFV+sx3GJKum/oBmASwBaZqglNiF/WfluOS2ChjhDShVNVWLVgrux85\n 3kE6sQjHQ19ocgX49fCf0ra0bUJKz+sgn0nm+SMP8BwW8V5tfQTx70QwHs1+f760zrug\n Y/Mv3Gr2My4K7X9B7seD72QCr03tNJPEeTPzwJqfenGiwD0iIz/0GWgMKpbL7HSy9/1Z\n EcqA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776027166; x=1776631966;\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=NmfBAQ0D3Sa5sjeFp529b93qLEW05p6njf5APTbVpD8=;\n b=KfsIvhkTcn5x9veavy2Kx+J+BInqXEb7FrjRggj0EjfZ4J9DIKZqAXbtobYuOQtq5B\n gfwfcKy6yXT4T/jmtXr9MbPP4b/s/Ukl1H7WoMgjCugeUmCyGQxqv59S0j/vFcJW6ai+\n pvHrn6QhBJrj4zucFSklER9Wp00Wgln0wSxihTv9Oeym9Z5rWUp5DOfzgJLmOy3nWhxf\n 7Na8bfqnwFFtZJtTw/qoefR9V08G3fOzjf42A1MObBID0b0Ai9rgM0ftHg1+2oOgqkp9\n xKur0Ugj32B8es8jOMAaOhOQbItdkeFEP0MW3mJ3Hno6xR7JlAmA97nqPWaA3zgZ58Q+\n zIAA==", "X-Gm-Message-State": "AOJu0YxTw9qICrAZcHuKunOCTFSRfswFFvgXzD3PbFL+uyPGcfkCibxC\n\txpjlvGvkEa3e6YiuS3QnBlLPnxuAB2voHIq2RThs+dFFZ3xYUrGmqJ4gnZkG2Q+Bk7o=", "X-Gm-Gg": "AeBDieuH1RujeC+LlmxwZCvAfGkv1z5rOwpEEzd3d0Vhyn3eTLLmrbKWaFQ5qz/C6S9\n\tNUlNfC93RANI8VTvcG3orADH3IyVL9tB3Jo1lzLfpbixcZV0gVJRGYaj9jAQVtZgWKJ3Sy2ZqdF\n\ta4n+jSwAWlPr3Wc+ByTY2E55U4mljtaUwsSFU0jW8J2hT6vD6VVpvR/COKwAd5+dKGC2CgODNWp\n\ta8O22rSusIfDC5ykBix3jCor73awf2blqhM7TMLI63cvDPUXVnuEMk4M0g4DejOU9Kg1kTrGFlJ\n\tRTrhIYHZnVG7EgSz7QARqZ7aiQpQ51LSwnP+xFrhxtz1BO+5fxoqD55KXG4EOPIjAAkgvzToS+7\n\t7MHhOHE/38dcVeXJNV2D61chx2qOXpCvzaTXC2kYuvA7XsYjrzuzyOIcOes+kMdHYj62bQDvSQ0\n\t2tlZZhHv6mU2R5dBMJvbdtqTwL3UtH/eke5bSRRmI8sjrRsGfCKao7cGdAGdDKDT+ld36FWgpmu\n\tXx3md80wL5RE3uktvbtCm2o37r0cRJzI5jmsUFtCtyJ6Ls9oiGjUc2/03Pr0GLzgU91XlAgaPEH\n\tz/QL2WhLJfC39Pxf", "X-Received": "by 2002:a17:907:1b22:b0:b97:fec5:eced with SMTP id\n a640c23a62f3a-b9d45b64482mr763764166b.0.1776027165602;\n Sun, 12 Apr 2026 13:52:45 -0700 (PDT)", "From": "Alexandru Hossu <hossu.alexandru@gmail.com>", "To": "linux-tegra@vger.kernel.org", "Cc": "marvin24@gmx.de,\n\tgregkh@linuxfoundation.org,\n\tlinux-staging@lists.linux.dev,\n\tlinux-kernel@vger.kernel.org,\n\tAlexandru Hossu <hossu.alexandru@gmail.com>", "Subject": "[PATCH 3/5] staging: nvec: fix use-after-free in nvec_rx_completed()", "Date": "Sun, 12 Apr 2026 22:51:16 +0200", "Message-ID": "<20260412205117.387125-1-hossu.alexandru@gmail.com>", "X-Mailer": "git-send-email 2.53.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-Transfer-Encoding": "8bit" }, "content": "In nvec_rx_completed(), when an incomplete RX transfer is detected,\nnvec_msg_free() is called to return the message back to the pool by\nclearing its 'used' atomic flag. Immediately after this, the code\naccesses nvec->rx->data[0] to check the message type.\n\nSince nvec_msg_free() marks the pool slot as available via atomic_set(),\nany concurrent or subsequent call to nvec_msg_alloc() could claim that\nsame slot and overwrite its data[] array. Reading nvec->rx->data[0] after\nfreeing the message is therefore a use-after-free.\n\nFix this by saving the message type byte before calling nvec_msg_free(),\nthen using the saved value for the battery quirk check.\n\nSigned-off-by: Alexandru Hossu <hossu.alexandru@gmail.com>\n---\n drivers/staging/nvec/nvec.c | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c\nindex 952c5a849a56..75877038847f 100644\n--- a/drivers/staging/nvec/nvec.c\n+++ b/drivers/staging/nvec/nvec.c\n@@ -498,11 +498,14 @@ static void nvec_rx_completed(struct nvec_chip *nvec)\n \t\t\t(uint)nvec_msg_size(nvec->rx),\n \t\t\t(uint)nvec->rx->pos);\n \n+\t\t/* Save before freeing to avoid use-after-free */\n+\t\tunsigned char msg_type = nvec->rx->data[0];\n+\n \t\tnvec_msg_free(nvec, nvec->rx);\n \t\tnvec->state = 0;\n \n \t\t/* Battery quirk - Often incomplete, and likes to crash */\n-\t\tif (nvec->rx->data[0] == NVEC_BAT)\n+\t\tif (msg_type == NVEC_BAT)\n \t\t\tcomplete(&nvec->ec_transfer);\n \n \t\treturn;\n", "prefixes": [ "3/5" ] }