[{"id":3678601,"web_url":"http://patchwork.ozlabs.org/comment/3678601/","msgid":"<20260417092259.3879-1-linuxtestproject.agent@gmail.com>","list_archive_url":null,"date":"2026-04-17T09:22:58","subject":"Re: [LTP] tpci: Unbind/rebind driver in test_assign_resources()","submitter":{"id":93132,"url":"http://patchwork.ozlabs.org/api/people/93132/","name":null,"email":"linuxtestproject.agent@gmail.com"},"content":"Hi Hongtao,\n\nOn Fri, 17 Apr 2026 10:29:49 +0800, Hongtao Zhang wrote:\n> tpci: Unbind/rebind driver in test_assign_resources()\n\n> +\t\t\tif (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {\n> +\t\t\t\tif (dev->dev.driver)\n> +\t\t\t\t\tdevice_release_driver(&dev->dev);\n> +\t\t\t}\n> +\n>  \t\t\tpci_release_resource(dev, i);\n>  \t\t\tret = pci_assign_resource(dev, i);\n> +\n> +\t\t\tif (ret == 0) {\n> +\t\t\t\tif (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {\n> +\t\t\t\t\tint attach_ret;\n> +\n> +\t\t\t\t\tattach_ret = device_attach(&dev->dev);\n> +\t\t\t\t\tif (attach_ret < 0)\n> +\t\t\t\t\t\tprk_info(\"device_attach failed for endpoint, ret: %d\", attach_ret);\n> +\t\t\t\t}\n> +\t\t\t}\n\nProperly unbinding before BAR reassignment and rebinding afterward\nprevents the dangling resource->name pointer UAF in /proc/iomem.\n\nReviewed-by: LTP AI Reviewer <ltp-ai@noreply.github.com>\n\n---\nNote:\n\nOur agent completed the review of the patch.\n\nThe agent can sometimes produce false positives although often its\nfindings are genuine. If you find issues with the review, please\ncomment this email or ignore the suggestions.\n\nRegards,\nLTP AI Reviewer","headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=q21qbwYn;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=213.254.12.146; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)"],"Received":["from picard.linux.it (picard.linux.it [213.254.12.146])\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 4fxqDX1c9Fz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 19:23:08 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 3ABDD3E2DF0\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 11:23:06 +0200 (CEST)","from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 4BB0A3E196A\n for <ltp@lists.linux.it>; Fri, 17 Apr 2026 11:23:02 +0200 (CEST)","from mail-ot1-x341.google.com (mail-ot1-x341.google.com\n [IPv6:2607:f8b0:4864:20::341])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-2.smtp.seeweb.it (Postfix) with ESMTPS id C467A600A58\n for <ltp@lists.linux.it>; Fri, 17 Apr 2026 11:23:01 +0200 (CEST)","by mail-ot1-x341.google.com with SMTP id\n 46e09a7af769-7dbff06e4a6so501161a34.1\n for <ltp@lists.linux.it>; Fri, 17 Apr 2026 02:23:01 -0700 (PDT)","from\n runnervm35a4x.xplmaoejahduziehhbpepjkxga.gx.internal.cloudapp.net\n ([52.173.181.17]) by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7dc97502488sm754129a34.5.2026.04.17.02.22.59\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 17 Apr 2026 02:23:00 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776417780; x=1777022580; darn=lists.linux.it;\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=SLfeyPvmQ57PlCJvbSSoZnbQT/G5CJ7ThAqa7N+/7DU=;\n b=q21qbwYn5Uup1aiiCxmbB6ETZegRhkuhqXpfJCfQ1BFsGzNnMZgQBOBVl8ki/YrCdT\n GGj9mcxTCXMX3orlbM/WnGr8tOom6ZEmF/2cXSEc8yYjlEPwRy70xjeMunJP1qrXOXks\n 5VMKzXv81e5ttELNR+1enAh0uyAj+YKuI7hMPF0qJ0FYD0Oa8zmy6SpK56RlQ85GfL1v\n UNOQNBdCYnar6ia2Chg5YR4S5sXdaZ1vffO+QAaJZpJqW3drEUgE3qGkjYrSrt1Rgb4h\n Zts83sCzaeaW66jBFii4KNRW7ux5wxCBXlhUQvPEhzBes3iNQv67NPBuVmNAmmNlyukU\n LrcA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776417780; x=1777022580;\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=SLfeyPvmQ57PlCJvbSSoZnbQT/G5CJ7ThAqa7N+/7DU=;\n b=Ht0f5ZaKTzfF0q5ZCrSuiDvrJ3ZciQbLluWvDE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6d89 with SMTP id\n 46e09a7af769-7dc94fc94ecmr1260024a34.4.1776417780334;\n Fri, 17 Apr 2026 02:23:00 -0700 (PDT)","From":"linuxtestproject.agent@gmail.com","To":"Hongtao Zhang <zhanghongtao35@huawei.com>","Date":"Fri, 17 Apr 2026 09:22:58 +0000","Message-ID":"<20260417092259.3879-1-linuxtestproject.agent@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260417022949.2881047-1-zhanghongtao35@huawei.com>","References":"<20260417022949.2881047-1-zhanghongtao35@huawei.com>","MIME-Version":"1.0","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM,SPF_HELO_NONE,\n SPF_PASS shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-2.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-2.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] tpci: Unbind/rebind driver in test_assign_resources()","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","Cc":"ltp@lists.linux.it, LTP AI Reviewer <ltp-ai@noreply.github.com>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"}}]