Show a patch.

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

{
    "id": 18052,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/18052/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18052/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20221222113122.28662-1-laurent.pinchart@ideasonboard.com>",
    "date": "2022-12-22T11:31:22",
    "name": "[libcamera-devel,RFC/PATCH] libcamera: ipa_module: Relax ipaModuleInfo symbol size check",
    "commit_ref": "d81505b834105ee1c879a962a2911d08b14ad5fd",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e7e26e8c20b1a847e140ab2d1b2126ae2dd85acd",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18052/mbox/",
    "series": [
        {
            "id": 3687,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3687/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3687",
            "date": "2022-12-22T11:31:22",
            "name": "[libcamera-devel,RFC/PATCH] libcamera: ipa_module: Relax ipaModuleInfo symbol size check",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3687/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18052/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18052/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 91547C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Dec 2022 11:31:31 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DED43633B1;\n\tThu, 22 Dec 2022 12:31:30 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C2F661507\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Dec 2022 12:31:29 +0100 (CET)",
            "from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AC79F471\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Dec 2022 12:31:27 +0100 (CET)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1671708690;\n\tbh=uJztUaaHZGFJgF1/R9T1QQUfoox9uLB2M+DRqzt75Uc=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=fSZ9GqZ5AhxTPjrue7Fam0jlpqQLaJyRHCGj2bEgmZZAYKeoYtS92SFcsokEJ1EzV\n\tFpikT0Nt/1eyARfVMlJ+psThn+S4Ag7MGtB2PWCmevTJXKo4Te19UQmPAwwr0DCu2f\n\tvYRGpjPiPQsa0nDivmb6LYxFMna/nbZkR3X41cyyGNBp2dxIqSlzt4UAHVL4u/o/Hu\n\tWp1XizpQaI1maB1qNUCZbqSufx70WNsi9qrD+OmVes+R6ndu4Dq9yXXJDmcVUJ9bYZ\n\tPyaC4c6a2+t+IT2piWtfG16U+yA2pXzyd47NOCyLDKbgZUVj/nZSY9mhKjlnhjAyZz\n\tgcDqCr24VkHDQ==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1671708687;\n\tbh=uJztUaaHZGFJgF1/R9T1QQUfoox9uLB2M+DRqzt75Uc=;\n\th=From:To:Subject:Date:From;\n\tb=A2Aygl3FHVReucfZ//LnIpkPgLsg0vuHzNrkeeuvKQIDDNIuxlPQfqCvn9zZTiwDP\n\thlp3n/EQJfGojtljINlt3zGbPVb1mGQXV1vs0KW+VJIFPK0PhD6o8+2AvRBaXZ2jsV\n\tNTh5jHzKhwqTpeUYMab2eMsd5ve2F8T3VedorpYE="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"A2Aygl3F\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 22 Dec 2022 13:31:22 +0200",
        "Message-Id": "<20221222113122.28662-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.38.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC/PATCH] libcamera: ipa_module: Relax\n\tipaModuleInfo symbol size check",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "When an IPA module is loaded, the loadIPAModuleInfo() function validates\nthe ipaModuleInfo structure. As part of that process, it checks that the\nipaModuleInfo symbol size matches the expected structure size. This\ncheck breaks with clang and ASan, as the LLVM's address sanitizer\nimplementation includes the redzone after the structure in the symbol\nsize, currently growing it by 156 bytes (on x86-64). This causes all IPA\nmodules to fail to load.\n\nFix the problem by relaxing the size check to only ensure that the\nsymbol is large enough to contain the structure.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\nRelaxing checks increases the chance of false negatives, but I think\nit's totally safe in this case. If we want to validate the structure\nsize, we should add a size field within the data. Other candidates for\nnew fields would be a magic number.\n---\n src/libcamera/ipa_module.cpp | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\n\nbase-commit: f66a5c447b65bce774a1bc2d01034f437bf764b5",
    "diff": "diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex c9ff7de30e21..c152153c180f 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -288,12 +288,12 @@ int IPAModule::loadIPAModuleInfo()\n \t}\n \n \tSpan<const uint8_t> info = elfLoadSymbol(data, \"ipaModuleInfo\");\n-\tif (info.size() != sizeof(info_)) {\n+\tif (info.size() < sizeof(info_)) {\n \t\tLOG(IPAModule, Error) << \"IPA module has no valid info\";\n \t\treturn -EINVAL;\n \t}\n \n-\tmemcpy(&info_, info.data(), info.size());\n+\tmemcpy(&info_, info.data(), sizeof(info_));\n \n \tif (info_.moduleAPIVersion != IPA_MODULE_API_VERSION) {\n \t\tLOG(IPAModule, Error) << \"IPA module API version mismatch\";\n",
    "prefixes": [
        "libcamera-devel",
        "RFC/PATCH"
    ]
}