Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6638203iob; Wed, 11 May 2022 01:57:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvRvbA4WTpQb+uwO+YF5AZ66h9Eez5wqPSQnxXv57XQvzuinjWetvroJJ5WBc/4/sHABre X-Received: by 2002:a17:906:6a26:b0:6f4:6bf8:1efe with SMTP id qw38-20020a1709066a2600b006f46bf81efemr22942625ejc.208.1652259468533; Wed, 11 May 2022 01:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652259468; cv=none; d=google.com; s=arc-20160816; b=f6+1MKZD3ZBEEjBdmxHik6omDsc+BFbiq6ZEJLayqjHZ7O6xt1Yc/N1l1CnPGavtpC bSIVY9/H7dN1o1FLfYZX8jTi7PTALZsvU8WDAWzRBlnt6J0phRmEX2NtQ52S7L1q4UcS k4DfT17anS6L4jCbwdukg8HnCntHx8qfBlf0xEk5WCErq/DFxKk+tpKq2hRJ1cs5MTRP zJLqMYNeJfrR5rk37YfZyc50WCKRclveX3aDAHycWATPqG4TVB+Gfi2u0sWJX2+pkmiF cs0c09cdpDoi7DEFfLdOam9KIUpbfKE6RvOXtb86xgSrpAvU3x1ix1a9d+rxg2EZy+89 cnbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zmwvbfSvqDsGXUYgLhWD8/wDkuM1DY3RQ9mlmoV5r/g=; b=k2rKn5VodfQXHOCMOlpo/ke7kIBhM7nDDQOCxTYSTTgTsI0XpOZPl2bvUBinyEO0NX OFk9agm05N4j2HPLunw4AugjccWioPni5kMyA2HbMatPojngLwX1xMHwGj2v+VqqflER 4ryTVtgjQiAUxPP8ch+RnVOejXLJY7rQT8jzWSq6GgG+WhDNaPe1lOJ0PKtbS4mhtvAQ Lzl3UDtI/5JSUDCqaHvovPQSG3QIzXQJwNg7q5pI0UXFIe87/JDcNgVlKzuxm8/BRQaC jNBqx6KagC3zdsAc8EAMKMZeUbkftikBBFagQOVwrhbJTDxIt4gHIZI/r2b54ejuZenp D0zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.jp header.s=amazon201209 header.b=Wj6AIuwH; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.jp Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz14-20020a1709077d8e00b006f458a898ddsi2053614ejc.42.2022.05.11.01.57.22; Wed, 11 May 2022 01:57:48 -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=@amazon.co.jp header.s=amazon201209 header.b=Wj6AIuwH; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.jp Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239752AbiEKCWe (ORCPT + 99 others); Tue, 10 May 2022 22:22:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiEKCWa (ORCPT ); Tue, 10 May 2022 22:22:30 -0400 Received: from smtp-fw-80007.amazon.com (smtp-fw-80007.amazon.com [99.78.197.218]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94FCA14C749; Tue, 10 May 2022 19:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.co.jp; i=@amazon.co.jp; q=dns/txt; s=amazon201209; t=1652235748; x=1683771748; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zmwvbfSvqDsGXUYgLhWD8/wDkuM1DY3RQ9mlmoV5r/g=; b=Wj6AIuwHdE9QHgT1dFhlK4+4pkKda06F/3PlqjufySnSGzhWBnx8yip7 uMCQEbGEANDqE1esysTjPke1ADraA13hHeljstZ6dTLlbJSLx5vOPJ0td vCXBS4+3CugIfJxp2cf5gsZ2z3UET0nCyeXNeaDLvYTnXrX+6x+BjYqpq A=; X-IronPort-AV: E=Sophos;i="5.91,215,1647302400"; d="scan'208";a="87272036" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-pdx-2b-1f9d5b26.us-west-2.amazon.com) ([10.25.36.210]) by smtp-border-fw-80007.pdx80.corp.amazon.com with ESMTP; 11 May 2022 02:22:27 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-pdx-2b-1f9d5b26.us-west-2.amazon.com (Postfix) with ESMTPS id 8319541C5A; Wed, 11 May 2022 02:22:27 +0000 (UTC) Received: from EX13D04ANC001.ant.amazon.com (10.43.157.89) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 11 May 2022 02:22:26 +0000 Received: from 88665a182662.ant.amazon.com (10.43.160.22) by EX13D04ANC001.ant.amazon.com (10.43.157.89) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 11 May 2022 02:22:23 +0000 From: Kuniyuki Iwashima To: CC: , , , , , , , , , , Subject: Re: [PATCH] af_unix: Silence randstruct GCC plugin warning Date: Wed, 11 May 2022 11:22:17 +0900 Message-ID: <20220511022217.58586-1-kuniyu@amazon.co.jp> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220511000109.3628404-1-keescook@chromium.org> References: <20220511000109.3628404-1-keescook@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.43.160.22] X-ClientProxiedBy: EX13D15UWB004.ant.amazon.com (10.43.161.61) To EX13D04ANC001.ant.amazon.com (10.43.157.89) X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 From: Kees Cook Date: Tue, 10 May 2022 17:01:09 -0700 > While preparing for Clang randstruct support (which duplicated many of > the warnings the randstruct GCC plugin warned about), one strange one > remained only for the randstruct GCC plugin. Eliminating this rids > the plugin of the last exception. > > It seems the plugin is happy to dereference individual members of > a cross-struct cast, but it is upset about casting to a whole object > pointer. This only manifests in one place in the kernel, so just replace > the variable with individual member accesses. There is no change in > executable instruction output. > > Drop the last exception from the randstruct GCC plugin. > > Cc: "David S. Miller" > Cc: Jakub Kicinski > Cc: Christoph Hellwig > Cc: Paolo Abeni > Cc: Kuniyuki Iwashima > Cc: Alexei Starovoitov > Cc: Cong Wang > Cc: Al Viro > Cc: netdev@vger.kernel.org > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Kees Cook LGTM, thank you. Acked-by: Kuniyuki Iwashima