Show a patch.

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

{
    "id": 14907,
    "url": "https://patchwork.libcamera.org/api/patches/14907/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14907/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20211130155600.2203123-11-hiroh@chromium.org>",
    "date": "2021-11-30T15:55:58",
    "name": "[libcamera-devel,v3,10/12] android: camera_device: Fix variables access without protection",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "068d7cc6e0c4faa54509883335ce58b1ccb2e33e",
    "submitter": {
        "id": 63,
        "url": "https://patchwork.libcamera.org/api/people/63/?format=api",
        "name": "Hirokazu Honda",
        "email": "hiroh@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14907/mbox/",
    "series": [
        {
            "id": 2785,
            "url": "https://patchwork.libcamera.org/api/series/2785/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2785",
            "date": "2021-11-30T15:55:48",
            "name": "Introduce clang thread safety annotations",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2785/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14907/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14907/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 2A4B9C324F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Nov 2021 15:56:31 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CFFFA60723;\n\tTue, 30 Nov 2021 16:56:30 +0100 (CET)",
            "from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com\n\t[IPv6:2607:f8b0:4864:20::102f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3CE5960726\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 16:56:27 +0100 (CET)",
            "by mail-pj1-x102f.google.com with SMTP id\n\tp18-20020a17090ad31200b001a78bb52876so18619792pju.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 07:56:27 -0800 (PST)",
            "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:c90a:5a53:b139:1336])\n\tby smtp.gmail.com with ESMTPSA id\n\tpc10sm3510283pjb.9.2021.11.30.07.56.23\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 30 Nov 2021 07:56:24 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"NMV5WYyG\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=Tsh0ApXzuilv6KhoR6vFwK3R224VNxnPJpnFf/qtahg=;\n\tb=NMV5WYyGHr0N5C+ZjPPGUqX1iBMRa8k0MHaM3s5JCoKQA/zEiDpeBMlykT99YuHGA7\n\thUyswhm+jnZoPBzTERHGblAkp5FXuMiZ/UYxWIMG24sIOvKvbq6AHU5YKMqHJQi0lr56\n\t7uo7zcepi9j5h6FH+zpNQTc+VifpByhpCnK3A=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=Tsh0ApXzuilv6KhoR6vFwK3R224VNxnPJpnFf/qtahg=;\n\tb=4OTh6xbsf2GBjtsZbvGfXG6Hp+Jg1vU/NDypFSf+KOFX/0kyI23uyQyddvxReEOjAm\n\ti+qOYRAlreh1PSrIS20OUEZt+dEYVvITNb9Qywnk4EsmwaVCgHE7sHUISqOjCqW0TmzF\n\tPVBX7RlJshoEDJ3sEv4EVxj2HQbJ0Bxipr2rU+2NQZp5rNvcT7uyWBoqlt9LqjO5fDM2\n\t73qEHmnIU6qd2ArafI8PyEfGi1VIDOWPVK3nyGMbID0vnknk/oHpUnhvSQEYovPDBVpF\n\ttFJw43SkZYbLWTGwuUBSQ3ucAUsOYfYA+NoRLR4fG4Z/oRmfEjcxMhwBlrW0r6nyPFGN\n\tUdpQ==",
        "X-Gm-Message-State": "AOAM530UuvRu/5SQ4IF80XFmZoNnNH+0/pOJnH49hFamFSQaQGKcw3rG\n\tWaRjSIqwfg2Sgae2YfwXR2aT9iDIb2LjPQ==",
        "X-Google-Smtp-Source": "ABdhPJyFAypmTM1vI7ia5kplJF66NJiHs5OFzuy6PlPR9GAmL2XWWPipeC/et3C7G8TMJHJvb/IxDg==",
        "X-Received": "by 2002:a17:90b:4c8c:: with SMTP id\n\tmy12mr262389pjb.157.1638287785518; \n\tTue, 30 Nov 2021 07:56:25 -0800 (PST)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  1 Dec 2021 00:55:58 +0900",
        "Message-Id": "<20211130155600.2203123-11-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.34.0.rc2.393.gf8c9666880-goog",
        "In-Reply-To": "<20211130155600.2203123-1-hiroh@chromium.org>",
        "References": "<20211130155600.2203123-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 10/12] android: camera_device: Fix\n\tvariables access without protection",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "This fixes the code accessing descriptors and\nCamera3RequestDescriptor::pendingStreamsToProcess_ without holding\ndescriptorsMutex_ and Camera3RequestDescriptor::streamProcessMutex_\nin CameraDevice.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/android/camera_device.cpp | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex d74307a2..e513cd84 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -421,7 +421,11 @@ void CameraDevice::stop()\n \tworker_.stop();\n \tcamera_->stop();\n \n-\tdescriptors_ = {};\n+\t{\n+\t\tMutexLocker descriptorsLock(descriptorsMutex_);\n+\t\tdescriptors_ = {};\n+\t}\n+\n \tstreams_.clear();\n \n \tstate_ = State::Stopped;\n@@ -918,6 +922,8 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques\n \t\t */\n \t\tFrameBuffer *frameBuffer = nullptr;\n \t\tint acquireFence = -1;\n+\n+\t\tMutexLocker lock(descriptor->streamsProcessMutex_);\n \t\tswitch (cameraStream->type()) {\n \t\tcase CameraStream::Type::Mapped:\n \t\t\t/*\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "10/12"
    ]
}