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 05B61C5479D for ; Fri, 6 Jan 2023 15:03:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235286AbjAFPDy (ORCPT ); Fri, 6 Jan 2023 10:03:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234964AbjAFPDu (ORCPT ); Fri, 6 Jan 2023 10:03:50 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6225645646 for ; Fri, 6 Jan 2023 07:03:49 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id m3so1255933wmq.0 for ; Fri, 06 Jan 2023 07:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+OwdKfXK+SNVrPvVK8uWPY9jI3lOu8t40smt1t6yZrc=; b=Z/gQJZss/OE/GRRyOiHB4/SFRKQvqNos1nrrpmF/NfzoZ/5zVb+pTRHQ0wnXi0IMV7 qMLVKBtUWcR4THNiaBTMjFUS1P+UGbTHYyF8d4LFly/TwSdPnotCTdDqZUEUQLPLlDqf 4jxQ4xK0Ssv28TozR02aKtZ97p1nV33r0iJzA= 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=+OwdKfXK+SNVrPvVK8uWPY9jI3lOu8t40smt1t6yZrc=; b=lcRsB5Y4PhveoodJUnT8DoSNniZ7ismr2rs4nYQKBai5QonyUuAEXCoGqFonm3uHyR YrtRltdUENaHp0nZlB45f8bEhg2W1dihyrzmxj+nQdRWKa01JOq/PQjiXs2CwLfH9jE5 AE7NDNv797Y9tBK0T7igdfSXI3/VNM2hYC0BFAq6o6WGlfFQC1DSsvpZnHSMQZ9eFPct qpMAzZsR8B5ePp7+gYVhrPhJso+MdnIMrjv8yYi7iYTcD6oH0QJerYMWMc2j7n3K0s/c Yxz/yPicQR4j4sNzj3PcLzipV5ecRjJIJAiUHEA1rRYL709QXgXojKnIZOP1ED3D878L EqvQ== X-Gm-Message-State: AFqh2koRFnBwEdqUqyzxn3SypX+LL4QK/R7LKcmd0eSBfYA4A2ASrNGc j1Qw3OBUtB77TBGKqNovzMXD6CAPkxFCoBPhEu1D3Q== X-Google-Smtp-Source: AMrXdXvsNwItCisvp7fzc6VLVmnUJvtQuVploPMux0GmwOPd7GZX7XpZtI7ovjzBP3i8v0d4UaGM3MYZAlmvih2v0tU= X-Received: by 2002:a05:600c:26d5:b0:3d2:1e7d:f9ea with SMTP id 21-20020a05600c26d500b003d21e7df9eamr3395201wmv.62.1673017427753; Fri, 06 Jan 2023 07:03:47 -0800 (PST) MIME-Version: 1.0 References: <20230106045327.never.413-kees@kernel.org> In-Reply-To: <20230106045327.never.413-kees@kernel.org> From: Julius Werner Date: Fri, 6 Jan 2023 16:03:35 +0100 Message-ID: Subject: Re: [PATCH] firmware: coreboot: Check size of table entry and split memcpy To: Kees Cook Cc: Jack Rosenthal , Paul Menzel , Guenter Roeck , Julius Werner , Brian Norris , Stephen Boyd , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Have you considered adding the flexible array member directly to the union in struct coreboot_device instead? I think that would make this a bit simpler by not having to copy header and data portion separately.