Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2228702/?format=api
{ "id": 2228702, "url": "http://patchwork.ozlabs.org/api/patches/2228702/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/patch/20260427081713.3401874-2-hossu.alexandru@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": "<20260427081713.3401874-2-hossu.alexandru@gmail.com>", "list_archive_url": null, "date": "2026-04-27T08:17:12", "name": "[v4,1/2] staging: nvec: fix use-after-free in nvec_rx_completed()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "fe00dd2fcc1696ff4f43d233bb5bf69cae32a32b", "submitter": { "id": 92777, "url": "http://patchwork.ozlabs.org/api/people/92777/?format=api", "name": "Alexandru Hossu", "email": "hossu.alexandru@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-tegra/patch/20260427081713.3401874-2-hossu.alexandru@gmail.com/mbox/", "series": [ { "id": 501604, "url": "http://patchwork.ozlabs.org/api/series/501604/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/list/?series=501604", "date": "2026-04-27T08:17:11", "name": "staging: nvec: fix use-after-free and pm_power_off teardown", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/501604/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2228702/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2228702/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-tegra+bounces-13998-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=dAkO4Nvb;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13998-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=\"dAkO4Nvb\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.221.54", "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 sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::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 4g3xQZ5w91z1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 18:23:02 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id E36C630158AD\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 08:19:11 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C5E6737BE7D;\n\tMon, 27 Apr 2026 08:19:11 +0000 (UTC)", "from mail-wr1-f54.google.com (mail-wr1-f54.google.com\n [209.85.221.54])\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 483BD39891E\n\tfor <linux-tegra@vger.kernel.org>; Mon, 27 Apr 2026 08:19:10 +0000 (UTC)", "by mail-wr1-f54.google.com with SMTP id\n ffacd0b85a97d-43cfd832155so7370415f8f.1\n for <linux-tegra@vger.kernel.org>;\n Mon, 27 Apr 2026 01:19:10 -0700 (PDT)", "from ahossu.localdomain ([82.78.232.184])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43fe4cc375dsm69920019f8f.14.2026.04.27.01.19.03\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 27 Apr 2026 01:19:08 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777277951; cv=none;\n b=Tco2Vf963dpomP7KAP8a13hPoLQ9wkN+mnGq9JVRk0Nvr3XEZ1a2qAgrw0HG7xtClPxxPeARefA0r0DUbI/WQZa8Lj6nMF2JuFdABQb5sdtcaU4XaRT45mSPA2+QsfjlX0vzDvN0K/+C40/MAEyWXTqfP6HwgjwO6TQb945Q7o0=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777277951; c=relaxed/simple;\n\tbh=UbK58Vzg9w7sWB5SY0szpeu7+MJi5WYw4Hn1wlYoJG4=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=F4pyj5goJCCmLMJeOpqwpp3KPiLKVbEb1Hkyhe5YZLJFD0E7DVPqelVkKjThvuFjaTD+MEUTmRYl4mqpZ5jOrvLZbXDaUZvSvyQq1GmpzUPuoPscr2I4Vvy2bSHpxcBowm5+Jit2q2EovC97uALMr8reXGscoC33agpd7sD85S0=", "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=dAkO4Nvb; arc=none smtp.client-ip=209.85.221.54", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777277949; x=1777882749;\n darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=gcNAF/r3YODfVeip91vVmIe5J4y4IySQb1pjlKeU7P0=;\n b=dAkO4NvbgDEZwv9QfwjUujcPkKm6zJd9g883uXar4SC17YtpLWYJ8OTL6oHObDji7j\n RFJeOIZ0W+nMKlHZcm6qcQZCCwmExMeO8I5ySEqQBgLqM//Kre0ZgjoB/EBRk9HKoMfB\n TqXGi/yia2XkkNWNNdmAXT8dT1q00FZh2YwtgFBpOiIRW7Wka0kD0+47UaQDS8EGHyJR\n uw3Itm/6Yuz4n40+byPTU9mZr4Swi0pGIItm7DSMRnJPL+IoFLAVoRMUm6zLBxjF8eUs\n NwogvFAs0gwv4IZGVw+txyfagkOfJob7iVzxnVs5HT2tgllB6g3R/dLb1eQzOYnsBIZI\n /IlQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777277949; x=1777882749;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=gcNAF/r3YODfVeip91vVmIe5J4y4IySQb1pjlKeU7P0=;\n b=fv6hvrOh90TdQck6TjU0VLunqXhZYkm+T2UJFfDMmLdJeTqNkS1Z8fcmKC827I6Fzm\n l61b+IcP937+dWyTW2XHbeb7rNhlgJL+SRm7yDU9DqPJbme4kMBRUoAzI6nt18afkxuL\n a6QGBf/l5vpTaCsNsYIuWS6FMPfiicoZ29/dYNMYHcFmlnylWZP5F3U+WhOg3O8xvZGJ\n A9R1Tzz9ln5SGqMlmXGDskdYbznmvLCYjUK6NafxwKywmV4cagL5nTuAD6YxcNQb7myD\n A85j8NDUHKQH40Ysfh7xzNPPbziv95E0VqznTmYMH+tuedE3osZOZE+Bn0TeHZB/X4yj\n belg==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ+Nr3G3flKoNVw69q0OfGYzw51A3QRCCWQvbfMaOug+WdPvIGMFM9wWPnztco/waeKizN6w3j9YibWFPg==@vger.kernel.org", "X-Gm-Message-State": "AOJu0YyM//vvKwMC7iHhCcFDO76n7PmMoqnd3TqUB5+RKh44ODgthbfQ\n\tIsvkdDv7Oln1/nBOn06pGXR3Rk1tJtA/j4ku8S8/HC2whp3CnZ1cJ065", "X-Gm-Gg": "AeBDiev2GWg9wrylGLWrE971isoBjw54NAfWlXZ2yc6WZi7PgAtlwZmPPZVf+JrVugS\n\t3O1MVAf4NLvKTnUwxDZDIYao+gTb84GT3OsTFI0p0/qGHdHmm8+FvEFJwwH2yZqbbWarAoStr92\n\tU1qOVOWPYSFwtgR1Ia75+d0gqeerpHuXJvvV8PT9Vt1TvszEQCkXJ0a/4KZmgCjBgQM99in8j/3\n\tkclouZ9ZtW66ePKGH2JISjpZ/UraQirbss6oZcIGFv+LCbAU4e8q2gzs7/NfwILbtB3ZqTNx3U6\n\tXBxKswRsKk41KyA0BWpIlCtZOgiMmeu0Dlcc5DAATitDOzr/jtSfugLwH/vStb19rBNTKn+LVh6\n\tiIp1J4TLkpgt2KS8pxjpaMPhp3DJ9EMBvEqnBFX/XSGK6zDKMDAq0Nb3bHt7bByykNn5cSDWA+7\n\taOMZcB2OSxnKdQ+SBbRCRQCNRbhJ+o2QeFpUxXC4r54qGTMoWcRNMcKb8GE1btMUC60O3o5qSa9\n\tCG6Jmxh6J5K5YxfdsRGIqOPOuxhu5pErny7fHRz4/Dz1TP0F8VKBH2XYIyyPzxPm606ghY=", "X-Received": "by 2002:a05:6000:2dc2:b0:441:2473:c30a with SMTP id\n ffacd0b85a97d-4412473c325mr35101080f8f.31.1777277948556;\n Mon, 27 Apr 2026 01:19:08 -0700 (PDT)", "From": "Alexandru Hossu <hossu.alexandru@gmail.com>", "To": "gregkh@linuxfoundation.org,\n\tlinux-staging@lists.linux.dev,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-tegra@vger.kernel.org", "Cc": "marvin24@gmx.de,\n\terror27@gmail.com,\n\tAlexandru Hossu <hossu.alexandru@gmail.com>", "Subject": "[PATCH v4 1/2] staging: nvec: fix use-after-free in\n nvec_rx_completed()", "Date": "Mon, 27 Apr 2026 10:17:12 +0200", "Message-ID": "<20260427081713.3401874-2-hossu.alexandru@gmail.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260427081713.3401874-1-hossu.alexandru@gmail.com>", "References": "<20260427081713.3401874-1-hossu.alexandru@gmail.com>", "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\nFixes: d6bdcf2e1019 (\"staging: nvec: Add battery quirk to ignore incomplete responses\")\nReviewed-by: Dan Carpenter <error27@gmail.com>\nSigned-off-by: Alexandru Hossu <hossu.alexandru@gmail.com>\n---\n drivers/staging/nvec/nvec.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c\nindex 952c5a849a56..2a3499dd4d63 100644\n--- a/drivers/staging/nvec/nvec.c\n+++ b/drivers/staging/nvec/nvec.c\n@@ -494,6 +494,8 @@ static void nvec_tx_completed(struct nvec_chip *nvec)\n static void nvec_rx_completed(struct nvec_chip *nvec)\n {\n \tif (nvec->rx->pos != nvec_msg_size(nvec->rx)) {\n+\t\tunsigned char msg_type = nvec->rx->data[0];\n+\n \t\tdev_err(nvec->dev, \"RX incomplete: Expected %u bytes, got %u\\n\",\n \t\t\t(uint)nvec_msg_size(nvec->rx),\n \t\t\t(uint)nvec->rx->pos);\n@@ -502,7 +504,7 @@ static void nvec_rx_completed(struct nvec_chip *nvec)\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": [ "v4", "1/2" ] }