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 D80ADC4332F for ; Tue, 1 Nov 2022 22:42:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbiKAWmC (ORCPT ); Tue, 1 Nov 2022 18:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230515AbiKAWl6 (ORCPT ); Tue, 1 Nov 2022 18:41:58 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B11C31DA5A for ; Tue, 1 Nov 2022 15:41:56 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id z5-20020a17090a8b8500b00210a3a2364fso2360519pjn.0 for ; Tue, 01 Nov 2022 15:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=549rWF/Cs3zs/38lC9NGwtRSOQOXjmIrrlVQub1z2o8=; b=X8yNsPnmPfT3SN6GNaL+qXXP6PlWP+tNfOepu9Waku/e8TbMh5Teg/RoEAaxBvZAyp 86MoLHZvivJ51VxIIlJcdpz/F5d7/wyZli/YZPlxZeL30msR5HHRyHoxNWtQDgse6TbY lBpkMDv9gA8YENbSvr5jeWlK6hF7bphcC4SUQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=549rWF/Cs3zs/38lC9NGwtRSOQOXjmIrrlVQub1z2o8=; b=JxavuFGhIMQZAQ86teSpDqW9nig9Wj2axY9us8gUmT39SslAFRmkqtz4NB2ANE14dX QxhCVnVc9cqSdKHZyQE3sW5d8U+xvHgJx7YqDDL05v+T+2NA3JMiGwKJQK06ixj0oS9P X25epJF/sP7LtTMwF5ZatTx/26RzttFWDwhUSt7XRGx57meCeKd4Y7AZytnx/su+0h4R 66mO6mFKfKiaP7FA/M7XmMTQr8kEpGLz/l1ye0BNN2LTyu7wk4Q4gnCJd6VEePdlvG+s o+86ng9pIb0t9Jdn+z1IpLIyLS2yKHaLaSVEaHxInL56WC26GfiFaJd2h/uXG4VGxJyd uWTA== X-Gm-Message-State: ACrzQf2SyBHWM9+tT4d5Z/PKMeHFspJ8TwacKt+K98OpKE36woIn3cVi 9kdol2+abqW2bxfLuF0Kr5YBDw== X-Google-Smtp-Source: AMsMyM5ebbfmmxQLSRv1+X29/5hLVS8lb8HR1kl72PW5ICE/mOVinx4Zw3IXtyUk1+PYEjtzhsFvlg== X-Received: by 2002:a17:90b:4d0e:b0:1f7:ae99:4d7f with SMTP id mw14-20020a17090b4d0e00b001f7ae994d7fmr38881630pjb.200.1667342516227; Tue, 01 Nov 2022 15:41:56 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b138-20020a621b90000000b0056bc742d21esm7194023pfb.176.2022.11.01.15.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 15:41:55 -0700 (PDT) Date: Tue, 1 Nov 2022 15:41:54 -0700 From: Kees Cook To: Alex Deucher Cc: Paulo Miguel Almeida , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , "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 Subject: Re: [PATCH v2] [next] drm/radeon: Replace one-element array with flexible-array member Message-ID: <202211011538.B7548FDDE@keescook> References: <202211011443.7BDB243D8D@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? -- Kees Cook