{"id":11967,"url":"https://patchwork.libcamera.org/api/1.1/patches/11967/?format=json","web_url":"https://patchwork.libcamera.org/patch/11967/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210416134347.2881373-2-hiroh@chromium.org>","date":"2021-04-16T13:43:47","name":"[libcamera-devel,v4,2/2] android: CameraDevice: Validate buffer_handle by CameraBuffer::isValidBuffer()","commit_ref":null,"pull_url":null,"state":"rejected","archived":false,"hash":"75ee0031da9414b2da3f235e94afc7879d713b00","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/1.1/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11967/mbox/","series":[{"id":1940,"url":"https://patchwork.libcamera.org/api/1.1/series/1940/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1940","date":"2021-04-16T13:43:46","name":"[libcamera-devel,v4,1/2] android: CameraBuffer: Add a static function to check a buffer validness","version":4,"mbox":"https://patchwork.libcamera.org/series/1940/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11967/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11967/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 906E4BD236\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Apr 2021 13:43:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 532B86880A;\n\tFri, 16 Apr 2021 15:43:58 +0200 (CEST)","from mail-pg1-x535.google.com (mail-pg1-x535.google.com\n\t[IPv6:2607:f8b0:4864:20::535])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7CFB16880A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Apr 2021 15:43:56 +0200 (CEST)","by mail-pg1-x535.google.com with SMTP id 31so3775603pgn.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Apr 2021 06:43:56 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:8518:74e8:412c:f22f])\n\tby smtp.gmail.com with ESMTPSA id\n\tms9sm6175606pjb.32.2021.04.16.06.43.53\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 16 Apr 2021 06:43:54 -0700 (PDT)"],"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=\"m9lXHJM3\"; 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=CZGaMpLSGBqWIYeKYD9P07cZ3KUZ0WaCTtrOPrRZLlA=;\n\tb=m9lXHJM3ujuubLPiJ/lnfqOQOeCNo/iv+qNnEte1kyldRtDxsV4wSvwaWn4pYne7Px\n\tL2spl1apYtFQh4EmhVol7w7FTvfqA//ovKdUIlFiiaBDz74lrqvfoxkolqweeGy7yP3D\n\tzoYytVM9b4mgMGB3dUR+4uBV72lFnhFQpXxPo=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\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=CZGaMpLSGBqWIYeKYD9P07cZ3KUZ0WaCTtrOPrRZLlA=;\n\tb=UgSTBpC4d9qASvtCeGUD2ob7jMsQD+RyK9xAm94kkH90bIA3/6lKxBV4iONvrlk8Bu\n\tLdAsh/9HKPbzpxRb/mPP3duCKNI/ScHnOLiO8GIhqvSEjEi2maXQ4Hs3Eu5Gu6N2Xnsl\n\tbzprjcXyDVffsqxw1GmrSkbO89b937iANWQHcEV1T3bSdlcDihcOSzhrY7WUzSAak2DB\n\tI8MSaJjOSksHtbRw0aSv12sBijAMfZXzAgQTd5ytSgUfQQ06N3Smk8vM9gVc9x/6UI9s\n\tSfuv5vhQGqn4bJSvXGp7TY34PmNxKo4oN3vSbn1iqlgH58sdezBcocbfxS0HRLXO5Uq6\n\t8D7g==","X-Gm-Message-State":"AOAM533uDk73eKnld5jEzO3EAkSj5Ul5rL4o4fSofhRXewoFu9UciYFu\n\t+ovW8/n2v2nwKLTHXtHO1Em6UPx3pOaTIQ==","X-Google-Smtp-Source":"ABdhPJwihx17Os00JuRn/I9XBWDMMLSnwqtYYW4WB3XE0Dzs3LDyJnswXfSJFtepOnd2bvgDpB83dA==","X-Received":"by 2002:a63:36ce:: with SMTP id\n\td197mr7989925pga.237.1618580634656; \n\tFri, 16 Apr 2021 06:43:54 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 16 Apr 2021 22:43:47 +0900","Message-Id":"<20210416134347.2881373-2-hiroh@chromium.org>","X-Mailer":"git-send-email 2.31.1.368.gbe11c130af-goog","In-Reply-To":"<20210416134347.2881373-1-hiroh@chromium.org>","References":"<20210416134347.2881373-1-hiroh@chromium.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v4 2/2] android: CameraDevice: Validate\n\tbuffer_handle by CameraBuffer::isValidBuffer()","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This adds a validation to buffer_handle provided in\nCameraDevice::processCaptureRequest() by using\nCameraBuffer::isValidBuffer().\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 5 +++++\n 1 file changed, 5 insertions(+)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 89044efa..7247c12c 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -293,6 +293,11 @@ bool isValidRequest(camera3_capture_request_t *camera3Request)\n \t\t\t\t<< \") in buffer \" << i;\n \t\t\treturn false;\n \t\t}\n+\n+\t\tif (!CameraBuffer::isValidBuffer(handle)) {\n+\t\t\tLOG(HAL, Error) << \"Buffer \" << i << \" is invalid\";\n+\t\t\treturn false;\n+\t\t}\n \t}\n \n \treturn true;\n","prefixes":["libcamera-devel","v4","2/2"]}