Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216807/?format=api
{ "id": 2216807, "url": "http://patchwork.ozlabs.org/api/patches/2216807/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260327073046.134085-2-aleksandr.loktionov@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260327073046.134085-2-aleksandr.loktionov@intel.com>", "list_archive_url": null, "date": "2026-03-27T07:30:36", "name": "[iwl-next] ixgbe: add bounds check for debugfs register access", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "abf2b8bb370a598399e28d5fc50771128231dade", "submitter": { "id": 75597, "url": "http://patchwork.ozlabs.org/api/people/75597/?format=api", "name": "Loktionov, Aleksandr", "email": "aleksandr.loktionov@intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260327073046.134085-2-aleksandr.loktionov@intel.com/mbox/", "series": [ { "id": 497716, "url": "http://patchwork.ozlabs.org/api/series/497716/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=497716", "date": "2026-03-27T07:30:36", "name": "[iwl-next] ixgbe: add bounds check for debugfs register access", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497716/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216807/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216807/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=o0PjO1Zp;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\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 4fhskk5c0dz1yFr\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 18:30:54 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 5389D61282;\n\tFri, 27 Mar 2026 07:30:53 +0000 (UTC)", "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id kc3eHcsoYjxe; Fri, 27 Mar 2026 07:30:52 +0000 (UTC)", "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 8082661275;\n\tFri, 27 Mar 2026 07:30:52 +0000 (UTC)", "from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\n by lists1.osuosl.org (Postfix) with ESMTP id 7F5F22D5\n for <intel-wired-lan@lists.osuosl.org>; Fri, 27 Mar 2026 07:30:51 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id 65EEC415BB\n for <intel-wired-lan@lists.osuosl.org>; Fri, 27 Mar 2026 07:30:51 +0000 (UTC)", "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id sDrlunfQoc39 for <intel-wired-lan@lists.osuosl.org>;\n Fri, 27 Mar 2026 07:30:50 +0000 (UTC)", "from mgamail.intel.com (mgamail.intel.com [192.198.163.14])\n by smtp4.osuosl.org (Postfix) with ESMTPS id 7960841598\n for <intel-wired-lan@lists.osuosl.org>; Fri, 27 Mar 2026 07:30:50 +0000 (UTC)", "from orviesa002.jf.intel.com ([10.64.159.142])\n by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 27 Mar 2026 00:30:50 -0700", "from amlin-019-225.igk.intel.com ([10.102.19.225])\n by orviesa002.jf.intel.com with ESMTP; 27 Mar 2026 00:30:48 -0700" ], "X-Virus-Scanned": [ "amavis at osuosl.org", "amavis at osuosl.org" ], "X-Comment": "SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ", "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8082661275", "OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7960841598" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1774596652;\n\tbh=HvymD+6oLXxgrTdUE3YKanaYKDNKNsYtjCx+ktqO82I=;\n\th=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=o0PjO1ZpVGqhE5CdybwZI5eqZxbkd+15/MxYzUQ949PsaxKyEGAcH+NpzXeIMKm/c\n\t zwM9M+z6dHVXhiEERLx1Yxx5zHh5SrJuFvS3HRm2EKYRfhUTEglONaJbQ6wU7MTXLL\n\t s3wAIrfZy1OzDWVx0A0lwE5z7nMTIl1eJ14epNNrKFdg3aiVo8Kcd2UMre1pgFx14Z\n\t 851mnMn5bULU83h2RUIdswvB1XUaS1SMgXVSfiQQtjxnNEkl8zF9ITnO7lrhvgYTsu\n\t ACqIM3/4F8n4xSL4h9OMxkePm/OwMCmo7EPKWx81gIBdmv4w50l6c897KzpG/kyW79\n\t k4TsNdeDYTUsg==", "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.14;\n helo=mgamail.intel.com; envelope-from=aleksandr.loktionov@intel.com;\n receiver=<UNKNOWN>", "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp4.osuosl.org 7960841598", "X-CSE-ConnectionGUID": [ "eKWkunBZQPSEUJCx+dWVTw==", "9wTCI3V8RVSixoc2skvYqw==" ], "X-CSE-MsgGUID": [ "4WiCtqiZSQmjSTX9qapukg==", "2GAwFIL6RryYJZ4EY+HlLA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6800,10657,11741\"; a=\"75734296\"", "E=Sophos;i=\"6.23,143,1770624000\"; d=\"scan'208\";a=\"75734296\"", "E=Sophos;i=\"6.23,143,1770624000\"; d=\"scan'208\";a=\"255740361\"" ], "X-ExtLoop1": "1", "From": "Aleksandr Loktionov <aleksandr.loktionov@intel.com>", "To": "intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com,\n aleksandr.loktionov@intel.com", "Cc": "netdev@vger.kernel.org,\n\tPaul Greenwalt <paul.greenwalt@intel.com>", "Date": "Fri, 27 Mar 2026 08:30:36 +0100", "Message-ID": "<20260327073046.134085-2-aleksandr.loktionov@intel.com>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260327073046.134085-1-aleksandr.loktionov@intel.com>", "References": "<20260327073046.134085-1-aleksandr.loktionov@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Mailman-Original-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1774596650; x=1806132650;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=iXs987oPA7ahQ4eyUK+mZKugGtcil+y5KlE/vj/M2Go=;\n b=ZzrFpWRIQC5fyw7IIzhxmlKSAmxZQt/NTJdD9sYU3wlp+bYXj0AI570r\n zCwdxIsr6Jj63mrnbF737ArKXXESWZ7Lm6KlglnPK2JiwtWEEMEgN28qQ\n qKfG89JzkfXd8/K35mAGauyTtyAm2w3VnUtIEXC6+zEsdt3PKpqqvE8c9\n IcmeecVrOI62qHk61B9jtZaCmmiJDc2syzLP7E1Oxc/mElAsYslyxigTJ\n WuNr62RfbLUZycoJZIVpvcghJsSIEgTgO60lGqU7nFJuSOUhh53h5tDpI\n C4XADNkVksfw4zRdGABLSUpk7Di7bJjTjCcM+oxlNRURCIy/SCbI3gHxi\n A==;", "X-Mailman-Original-Authentication-Results": [ "smtp4.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=intel.com", "smtp4.osuosl.org;\n dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com\n header.a=rsa-sha256 header.s=Intel header.b=ZzrFpWRI" ], "Subject": "[Intel-wired-lan] [PATCH iwl-next] ixgbe: add bounds check for\n debugfs register access", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "From: Paul Greenwalt <paul.greenwalt@intel.com>\n\nPrevent out-of-bounds MMIO accesses triggered through user-controlled\nregister offsets. IXGBE_HFDR (0x15FE8) is the highest valid MMIO\nregister in the ixgbe register map; any offset beyond it would address\nunmapped memory.\n\nAdd a defense-in-depth check at two levels:\n\n1. ixgbe_read_reg() -- the noinline register read accessor. A\n WARN_ON_ONCE() guard here catches any future code path (including\n ioctl extensions) that might inadvertently pass an out-of-range\n offset without relying on higher layers to catch it first.\n ixgbe_write_reg() is a static inline called from the TX/RX hot path;\n adding WARN_ON_ONCE there would inline the check at every call site,\n so only the read path gets this guard.\n\n2. ixgbe_dbg_reg_ops_write() -- the debugfs 'reg_ops' interface is the\n only current path where a raw, user-supplied offset enters the driver.\n Gating it before invoking the register accessors provides a clean,\n user-visible failure (silent ignore with no kernel splat) for\n deliberately malformed debugfs writes.\n\nAdd a reg <= IXGBE_HFDR guard to both the read and write paths in\nixgbe_dbg_reg_ops_write(), and a WARN_ON_ONCE + early-return guard to\nixgbe_read_reg().\n\nSigned-off-by: Paul Greenwalt <paul.greenwalt@intel.com>\nSigned-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 6 ++++--\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 ++\n 2 files changed, 6 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c\nindex 5b1cf49d..a6a19c0 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c\n@@ -86,7 +86,8 @@ static ssize_t ixgbe_dbg_reg_ops_write(struct file *filp,\n \t\tu32 reg, value;\n \t\tint cnt;\n \t\tcnt = sscanf(&ixgbe_dbg_reg_ops_buf[5], \"%x %x\", ®, &value);\n-\t\tif (cnt == 2) {\n+\t\t/* check format and bounds check register access */\n+\t\tif (cnt == 2 && reg <= IXGBE_HFDR) {\n \t\t\tIXGBE_WRITE_REG(&adapter->hw, reg, value);\n \t\t\tvalue = IXGBE_READ_REG(&adapter->hw, reg);\n \t\t\te_dev_info(\"write: 0x%08x = 0x%08x\\n\", reg, value);\n@@ -97,7 +98,8 @@ static ssize_t ixgbe_dbg_reg_ops_write(struct file *filp,\n \t\tu32 reg, value;\n \t\tint cnt;\n \t\tcnt = sscanf(&ixgbe_dbg_reg_ops_buf[4], \"%x\", ®);\n-\t\tif (cnt == 1) {\n+\t\t/* check format and bounds check register access */\n+\t\tif (cnt == 1 && reg <= IXGBE_HFDR) {\n \t\t\tvalue = IXGBE_READ_REG(&adapter->hw, reg);\n \t\t\te_dev_info(\"read 0x%08x = 0x%08x\\n\", reg, value);\n \t\t} else {\n\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 210c7b9..4a1f3c2 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -354,4 +354,6 @@ u32 ixgbe_read_reg(struct ixgbe_hw *hw, u32 reg)\n \tif (ixgbe_removed(reg_addr))\n \t\treturn IXGBE_FAILED_READ_REG;\n+\tif (WARN_ON_ONCE(reg > IXGBE_HFDR))\n+\t\treturn IXGBE_FAILED_READ_REG;\n \tif (unlikely(hw->phy.nw_mng_if_sel &\n \t\t IXGBE_NW_MNG_IF_SEL_SGMII_ENABLE)) {\n", "prefixes": [ "iwl-next" ] }