Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp81968rwi; Wed, 2 Nov 2022 09:32:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4FLmptujq8emYq5nTPLkZ2NxPZx4spS8s6v4Z972W6FtxlxNYE+S3GRHla4ZBa9DPJOkoV X-Received: by 2002:a05:6402:5489:b0:43b:b935:db37 with SMTP id fg9-20020a056402548900b0043bb935db37mr26354798edb.347.1667406733180; Wed, 02 Nov 2022 09:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667406733; cv=none; d=google.com; s=arc-20160816; b=UuwE6xvNVk/qI6K8y3KaymY0bAlBAXXArCjW1f26uaeM1N3QjZqMMFkV/vzu6Xp9e6 MABqxKoQfj4ZXAEudHzdej4+IWf8eG/70z2IBO5PMeeGO36lZKpwXTFDyk7OOeYAw+My fVZWJdAZe3WFXby3oQuj0TRdKg01OR6tCexaanViSonS0tjej4YlmYIqgiXVUMW92whL D1nRlyvLSNrbX/mtuSNlqPdNh6wVnJIMFgpzaoXxLRiQWTWBSegzmKCDLb77MNigXPzj rLvfhorls0WvmMxuWCO/BZr0s48cDV6Ank11nWWjZ6Vo1j1BkYy3fzduSrWSZ+EgcrZz /Z0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=XMjYtLPQdk4k4exRzx1++JFQEjlm3E6Ooszo7YLrAmA=; b=NPIMTJ0W9K62fv6S2k5KgLiOR9Q1vJCPCecd9GSWUJD4KOGTw6KQGsVDovCcy60x/D +ZMNKGpbWjN3nPlMzRTGN+uEWq42szmU7tMGDteJjwo3VN/KcHXooBwj0mnDXrGJTn7V 92f7UTiMG4lb3t0shwBm8HkuAVIk0UHRFguI39RdvXlK6z4x5E0Rd1XZx23cj+dTMbxT PB8n95tHqMUNgVo2K06n4MrEo09n+WCdOr+KScAArR8JY5TffqjUyt7sIT9SpIoyiXL9 9hpmPVANEuJGH/+rJrJoWuTvzYI4YY8wE8sr0qAfGnr9df6hiB+zjHuDXvvyeZ4hZ+bl 9TtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YkoMxrzg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt15-20020a0564020a4f00b0045928479b71si13755854edb.405.2022.11.02.09.31.40; Wed, 02 Nov 2022 09:32:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YkoMxrzg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231811AbiKBQMm (ORCPT + 98 others); Wed, 2 Nov 2022 12:12:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231406AbiKBQLa (ORCPT ); Wed, 2 Nov 2022 12:11:30 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C64C2CDEE; Wed, 2 Nov 2022 09:11:22 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id n83so19657946oif.11; Wed, 02 Nov 2022 09:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XMjYtLPQdk4k4exRzx1++JFQEjlm3E6Ooszo7YLrAmA=; b=YkoMxrzgOzObQ1f1AQWermP6aRAMBxCVFdMmyaHzOTeZdtelfAESKiSIoV7kj77E+L FTIkkriNPRtcD6CsHVUvxp1BM4/3GdHunszANw/koj97LixLFuphPtTERaQk3+dbAqCw KipagSfLhrJT86JB/5YZNpquZy6KPER7d+Wc+5ls6kdX7kCKPEtrvMZ/MHv5yvbB75VX aU88ms7Xjeqihyb0ExWs7VnJj0lFqqt96zTgIEE2W619V9smJhuW4oUZA54ExzPWVWKa vUExZ6florDuPnSi9edzg/cQEAXZHnKivN1QvtxYHqottcJuJqIKCnSohrqJGqM/UwCu VXgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XMjYtLPQdk4k4exRzx1++JFQEjlm3E6Ooszo7YLrAmA=; b=VhHAs3etjMQo95zaAb7s5RTFfFrRoJq32YhhXJbMh/LPwNiDVO7GxKL+kzaRg8ibyF Ff6QujAwQRtaIr9ibG75VVbnbhFaz37zH/O602ysMNgRSbd72BnDCP1wB0yp6/Fi96na HEyaHV7YgTr5WinTANc9cxEcF6xnxiVBzm2gUag0d3/rV5dtIskqQ5TeHrZkjuhqTKuO yLr2GBi8y/QNHocb/D9vgN8tO3xSV2Fw20rhlk/FM7/BALIG7jWnK+iwsk0yd0yuYZ7Z JiyNWZ+mXYonD6oIp1yRvErASJ75hO6wjhtArom5fVd6qOplaZtbgsIvhihVaVXQwhAE jPuw== X-Gm-Message-State: ACrzQf0K10AZVaUHjeMgbBR6+YW9Qtr9jpbHbUCowFYJHOpJQf7gRePz AxZEbmNhIx9T6eUbCfySFUELTJxRnF+flri8bbA= X-Received: by 2002:a05:6808:14d2:b0:354:c733:abd3 with SMTP id f18-20020a05680814d200b00354c733abd3mr13779461oiw.96.1667405481362; Wed, 02 Nov 2022 09:11:21 -0700 (PDT) MIME-Version: 1.0 References: <202211011443.7BDB243D8D@keescook> <202211011538.B7548FDDE@keescook> In-Reply-To: <202211011538.B7548FDDE@keescook> From: Alex Deucher Date: Wed, 2 Nov 2022 12:11:09 -0400 Message-ID: Subject: Re: [PATCH v2] [next] drm/radeon: Replace one-element array with flexible-array member To: Kees Cook Cc: Paulo Miguel Almeida , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 1, 2022 at 6:41 PM Kees Cook wrote: > > On Tue, Nov 01, 2022 at 06:09:16PM -0400, Alex Deucher wrote: > > On Tue, Nov 1, 2022 at 5:54 PM Kees Cook wrote: > > > Does the ROM always only have a single byte there? This seems unlikely > > > given the member "ucFakeEDIDLength" (and the code below). > > > > I'm not sure. I'm mostly concerned about this: > > > > record += fake_edid_record->ucFakeEDIDLength ? > > fake_edid_record->ucFakeEDIDLength + 2 : > > sizeof(ATOM_FAKE_EDID_PATCH_RECORD); > > But this is exactly what the code currently does, as noted in the commit > log: "It's worth mentioning that doing a build before/after this patch > results in no binary output differences. > > > Presumably the record should only exist if ucFakeEDIDLength is non 0, > > but I don't know if there are some OEMs out there that just included > > an empty record for some reason. Maybe the code is wrong today and > > there are some OEMs that include it and the array is already size 0. > > In that case, Paulo's original patches are probably more correct. > > Right, but if true, that seems to be a distinctly separate bug fix? You've convinced me. Applied. Thanks, Alex > > -- > Kees Cook