From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D826C38142 for ; Mon, 23 Jan 2023 14:38:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232137AbjAWOiu (ORCPT ); Mon, 23 Jan 2023 09:38:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231663AbjAWOit (ORCPT ); Mon, 23 Jan 2023 09:38:49 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEDC51027A for ; Mon, 23 Jan 2023 06:38:48 -0800 (PST) X-IronPort-AV: E=McAfee;i="6500,9779,10598"; a="327311747" X-IronPort-AV: E=Sophos;i="5.97,239,1669104000"; d="scan'208";a="327311747" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2023 06:38:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10598"; a="654962103" X-IronPort-AV: E=Sophos;i="5.97,239,1669104000"; d="scan'208";a="654962103" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga007.jf.intel.com with ESMTP; 23 Jan 2023 06:38:45 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pJxy7-00DmaB-1m; Mon, 23 Jan 2023 16:38:43 +0200 Date: Mon, 23 Jan 2023 16:38:43 +0200 From: Andy Shevchenko To: Hans de Goede Cc: Mauro Carvalho Chehab , Sakari Ailus , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH 14/57] media: atomisp: Check buffer index is in range inside atomisp_qbuf_wrapper() Message-ID: References: <20230123125205.622152-1-hdegoede@redhat.com> <20230123125205.622152-15-hdegoede@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230123125205.622152-15-hdegoede@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Mon, Jan 23, 2023 at 01:51:22PM +0100, Hans de Goede wrote: > Check buffer index is in range inside atomisp_qbuf_wrapper() before > using it do index pipe->frame_request_config_id[]. ... > /* FIXME this abuse of buf->reserved2 comes from the original atomisp buffer handling */ Does the comment belong to this check? > + if (buf->index >= vdev->queue->num_buffers) > + return -EINVAL; > + > if (!atomisp_is_vf_pipe(pipe) && > (buf->reserved2 & ATOMISP_BUFFER_HAS_PER_FRAME_SETTING)) { > /* this buffer will have a per-frame parameter */ -- With Best Regards, Andy Shevchenko