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 X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55509C33C9E for ; Tue, 28 Jan 2020 11:44:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 358DE24684 for ; Tue, 28 Jan 2020 11:44:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 358DE24684 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BAB006EDE8; Tue, 28 Jan 2020 11:44:35 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2B45F6EDE6; Tue, 28 Jan 2020 11:44:33 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2020 03:44:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,373,1574150400"; d="scan'208";a="261403587" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga002.fm.intel.com with SMTP; 28 Jan 2020 03:44:05 -0800 Received: by stinkbox (sSMTP sendmail emulation); Tue, 28 Jan 2020 13:44:04 +0200 Date: Tue, 28 Jan 2020 13:44:04 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Alex Deucher Subject: Re: [PATCH 5/8] drm/edid: Document why we don't bounds check the DispID CEA block start/end Message-ID: <20200128114404.GG13686@intel.com> References: <20200124200231.10517-1-ville.syrjala@linux.intel.com> <20200124200231.10517-5-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Patchwork-Hint: comment User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel Graphics Development , Andres Rodriguez , Maling list - DRI developers Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Jan 27, 2020 at 05:30:42PM -0500, Alex Deucher wrote: > On Fri, Jan 24, 2020 at 3:03 PM Ville Syrjala > wrote: > > > > From: Ville Syrj=E4l=E4 > > > > After much head scratching I managed to convince myself that > > for_each_displayid_db() has already done the bounds checks for > > the DispID CEA data block. Which is why we don't need to repeat > > them in cea_db_offsets(). To avoid having to go through that > > pain again in the future add a comment which explains this fact. > > > > Cc: Andres Rodriguez > > Signed-off-by: Ville Syrj=E4l=E4 > > --- > > drivers/gpu/drm/drm_edid.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > > index 3df5744026b0..0369a54e3d32 100644 > > --- a/drivers/gpu/drm/drm_edid.c > > +++ b/drivers/gpu/drm/drm_edid.c > > @@ -4001,6 +4001,10 @@ cea_db_offsets(const u8 *cea, int *start, int *e= nd) > > * no non-DTD data. > > */ > > if (cea[0] =3D=3D DATA_BLOCK_CTA) { > > + /* > > + * for_each_displayid_db() has already verified > > + * that these stay within expected bounds. > > + */ > = > I think the preferred format is to have the start of the comment be on > the first line after the /* with that fixed: Nope. > Acked-by: Alex Deucher > = > > *start =3D 3; > > *end =3D *start + cea[2]; > > } else if (cea[0] =3D=3D CEA_EXT) { > > -- > > 2.24.1 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- = Ville Syrj=E4l=E4 Intel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel 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 X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73356C33C9E for ; Tue, 28 Jan 2020 11:44:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B66F24684 for ; Tue, 28 Jan 2020 11:44:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B66F24684 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A6BF16EDE6; Tue, 28 Jan 2020 11:44:35 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2B45F6EDE6; Tue, 28 Jan 2020 11:44:33 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2020 03:44:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,373,1574150400"; d="scan'208";a="261403587" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga002.fm.intel.com with SMTP; 28 Jan 2020 03:44:05 -0800 Received: by stinkbox (sSMTP sendmail emulation); Tue, 28 Jan 2020 13:44:04 +0200 Date: Tue, 28 Jan 2020 13:44:04 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Alex Deucher Message-ID: <20200128114404.GG13686@intel.com> References: <20200124200231.10517-1-ville.syrjala@linux.intel.com> <20200124200231.10517-5-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Patchwork-Hint: comment User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Intel-gfx] [PATCH 5/8] drm/edid: Document why we don't bounds check the DispID CEA block start/end X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel Graphics Development , Andres Rodriguez , Maling list - DRI developers Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, Jan 27, 2020 at 05:30:42PM -0500, Alex Deucher wrote: > On Fri, Jan 24, 2020 at 3:03 PM Ville Syrjala > wrote: > > > > From: Ville Syrj=E4l=E4 > > > > After much head scratching I managed to convince myself that > > for_each_displayid_db() has already done the bounds checks for > > the DispID CEA data block. Which is why we don't need to repeat > > them in cea_db_offsets(). To avoid having to go through that > > pain again in the future add a comment which explains this fact. > > > > Cc: Andres Rodriguez > > Signed-off-by: Ville Syrj=E4l=E4 > > --- > > drivers/gpu/drm/drm_edid.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > > index 3df5744026b0..0369a54e3d32 100644 > > --- a/drivers/gpu/drm/drm_edid.c > > +++ b/drivers/gpu/drm/drm_edid.c > > @@ -4001,6 +4001,10 @@ cea_db_offsets(const u8 *cea, int *start, int *e= nd) > > * no non-DTD data. > > */ > > if (cea[0] =3D=3D DATA_BLOCK_CTA) { > > + /* > > + * for_each_displayid_db() has already verified > > + * that these stay within expected bounds. > > + */ > = > I think the preferred format is to have the start of the comment be on > the first line after the /* with that fixed: Nope. > Acked-by: Alex Deucher > = > > *start =3D 3; > > *end =3D *start + cea[2]; > > } else if (cea[0] =3D=3D CEA_EXT) { > > -- > > 2.24.1 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- = Ville Syrj=E4l=E4 Intel _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx