Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5570291pxv; Wed, 28 Jul 2021 14:02:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuQOF7aFaP6NDl1uhEWM9tu/9xBhNHb+b4LRcRNA51vYVmrgSzKHMjOUGpqV6yUPsISTal X-Received: by 2002:a05:6402:184b:: with SMTP id v11mr2069132edy.267.1627506122504; Wed, 28 Jul 2021 14:02:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627506122; cv=none; d=google.com; s=arc-20160816; b=qgEaGQgZWbkPavgC4Sgj0i2nV9gb9RJ79etpc7G37/aX7z7Idb/CWttaCsUHmhc8DG RRGu38rnQ0dEUqNqRAnIXjZ9GR6dl4RP52GIMqPPo80c6FzcvFesyqSK93fIrbYUt8zM BaPN+BUB+I+8lgFeXnlC0LIJuEGylXJWhXCVpwNc+CsdE6SrJEvMJMQ2P9LeNm9M/Ybg cnIPME5neV0RtmehZoZ3DLgMNPk14OnXrAhkAIqGUPoTkY+L5lsO94I91VYYjyXKPD7i HfMeN6N39WU15mQfkHPKdFujA47UkD+2NPLXDAUr6WYE8MgDZmlSmeO1lV0xM0sJZjPJ mEXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=v4TsexyUVtPmnWQp8z0vQybdqGDFJ+IKH3X3D8imsE4=; b=bF3Oh3AnEHE8crwrmJ0yEVVulMuCR5YWUExQsSQQz6NfUaeyrXKbSyj4E4jFs9EFy+ r8dep+YgHyfXwHXs1NIeC/uSEj7PwQRnmJ83gbZuZC7TzrTMC/qxGuCbJTQKHWQ62rZ1 HnT92wmmd2P0jRwnaF66xN3TCgFI6Ig3fVsiyDSjp0giq9hXZkIZU/nEBtdnY1CgOKIP oeksTKEOCg4SbTMRuj5hhK5qYIM1I3aorye7MLt0mRJmfauBhqBk0hG2lucDPAE9z9AC v9SJsw5HnHN9GpJmfSzcB26YnnalfVjSdV922sxe/Oz7kGVSmbOrVuMjwDcUW97cCto7 nWEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hg+gKirQ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb22si921275ejc.347.2021.07.28.14.01.39; Wed, 28 Jul 2021 14:02:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hg+gKirQ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231858AbhG1VBb (ORCPT + 99 others); Wed, 28 Jul 2021 17:01:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231734AbhG1VB3 (ORCPT ); Wed, 28 Jul 2021 17:01:29 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF269C061796 for ; Wed, 28 Jul 2021 14:01:26 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id e5so4254735pld.6 for ; Wed, 28 Jul 2021 14:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=v4TsexyUVtPmnWQp8z0vQybdqGDFJ+IKH3X3D8imsE4=; b=hg+gKirQh4CStWcllp3dCMDGaMydMxkrfDz7dI28grfxRHealC37a8xJDfYI0FVrQZ 2tYUG05gAJbnL7ZSiMGxXN0BbgqYaSHUyURFCYtvwZV0Mx+omFId8CJj1UovnV0ee9cA 66wsvWC92AbI6ez9cGn13eYUvZ7XhoUJQlPzE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=v4TsexyUVtPmnWQp8z0vQybdqGDFJ+IKH3X3D8imsE4=; b=DABrxDIZ9ES4nS9gXv8EPUFYEV7lepU3UiGGeZGZtuSd9JMOC4f1rHp+nw914yiWYM eB9wD0J6Ug7AGh9KTCeRk7u/mpauNZVZxRFjxwHhRQssgYg0NA2WO++Jj/0eY+RXj0oV i4xbjABbOGZkPAgmQVDY5cDoygPLtfaa+27UtKYX95H28xTJLDq6DWnQI6RCgAOm+9i5 BCh0ZIp9r4ZprXgT5e5PI8jesnK/eWj2CUhGgGb3X5uXWp/PEozCF7So5fLpYqZ0LbIp iNoPG6Au+n1hEDrjZd4yNF+YwxFzFXz8m1MQPmKWleP4Hvq7/ZjAo7Zz8N53BCW2MZ81 RGFA== X-Gm-Message-State: AOAM531JNm7eymsSjXNlwzThNMrQYLvQbHZeMRA4mu4qq8AWquuB+Nch k3WTQuFU9MZyeVUE2tULkf8+SQ== X-Received: by 2002:a17:902:d717:b029:12c:1653:d611 with SMTP id w23-20020a170902d717b029012c1653d611mr1508273ply.51.1627506086388; Wed, 28 Jul 2021 14:01:26 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t3sm932392pfd.153.2021.07.28.14.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 14:01:25 -0700 (PDT) Date: Wed, 28 Jul 2021 14:01:24 -0700 From: Kees Cook To: Greg Kroah-Hartman Cc: linux-hardening@vger.kernel.org, "Gustavo A. R. Silva" , Keith Packard , Andrew Morton , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-staging@lists.linux.dev, linux-block@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH 19/64] ip: Use struct_group() for memcpy() regions Message-ID: <202107281358.8E12638@keescook> References: <20210727205855.411487-1-keescook@chromium.org> <20210727205855.411487-20-keescook@chromium.org> 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-wireless@vger.kernel.org On Wed, Jul 28, 2021 at 07:55:53AM +0200, Greg Kroah-Hartman wrote: > > struct ethhdr { > > - unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ > > - unsigned char h_source[ETH_ALEN]; /* source ether addr */ > > + union { > > + struct { > > + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ > > + unsigned char h_source[ETH_ALEN]; /* source ether addr */ > > + }; > > + struct { > > + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ > > + unsigned char h_source[ETH_ALEN]; /* source ether addr */ > > + } addrs; > > A union of the same fields in the same structure in the same way? > > Ah, because struct_group() can not be used here? Still feels odd to see > in a userspace-visible header. Yeah, there is some inconsistency here. I will clean this up for v2. Is there a place we can put kernel-specific macros for use in UAPI headers? (I need to figure out where things like __kernel_size_t get defined...) -- Kees Cook