Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp202616pxb; Tue, 7 Sep 2021 22:15:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVrZP3s6oHmyRLaCAaKVVgnG5ru9mL24mQFSEgb0Iupl1Jhz8PPswvnPKdUGzbeAOl9cJW X-Received: by 2002:a6b:fc17:: with SMTP id r23mr1691320ioh.89.1631078144409; Tue, 07 Sep 2021 22:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631078144; cv=none; d=google.com; s=arc-20160816; b=0ZXhZUiKvYRfxIf3qBIxCRTru6jBUbKrrzXV0Fsnq5lcdRmztcX6HtebvsOA3AeY7U UjbpJljnrpNziFRQDOhiQmFcUkkFbREnL9ju500fO4zQvUnIggzKMQ2afGEXcCLajMvk VAUzc9Zl5NUBHYYLjxQZkkNBC5p5vOVs/s/KNRoDBAKuQ9QPPXMf9cr7lwnRmShXWzei NsRTC9C3+0JOdfEbFbk0+bBpt7mtrim01XCZ8FgGirroKhix0UXZvGWmY3v+sfAPOn3d 3ZBARukFhSxrDyTHJtpXk+fr5eW99Pb78xKCtbCtOKPG0qWocoBhknuIfgS+YoTlZdY1 ohMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:sender:dkim-signature; bh=pyGzdXX+PpJNqBikj4EAmTcOGVssrcYKCfwJglYLCj0=; b=WGbfunymddAGvhHFU37eSIknhh9TWZNygHuUJ+baOMrnIp4MNRd4A56EZk7178I4Wu U4DvyAafhn/ZJC8e+isRJQ/5biL0PV9neMGksgxCUAfYFQ9aRtIsYrLjQ3VIxGl+H79W nP1W7goEdVi44MfTWRAHkANhBJ0fPaW4cxawFpoP+TDA8AiT2uj0Dek9hQJzZsyYJTjN 3mZNjjl4Cx5x7KrzTfqcNmnMvk0EiOfN3ddXcSxT1HOIusFiXrqWB2fI7Ji6tG0teiu8 paB/D2Xuz3xgmwwTCIMPJzitMD6WRQNrtG9DKHf7+OMtZaFp+8fiMcyE9ar+pf8Yhmyh IwoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SEFgrGHC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si1014351jaa.58.2021.09.07.22.15.32; Tue, 07 Sep 2021 22:15:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@gmail.com header.s=20210112 header.b=SEFgrGHC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233421AbhIHFPx (ORCPT + 99 others); Wed, 8 Sep 2021 01:15:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232097AbhIHFPw (ORCPT ); Wed, 8 Sep 2021 01:15:52 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71310C061575; Tue, 7 Sep 2021 22:14:45 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id l7-20020a0568302b0700b0051c0181deebso1380041otv.12; Tue, 07 Sep 2021 22:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=pyGzdXX+PpJNqBikj4EAmTcOGVssrcYKCfwJglYLCj0=; b=SEFgrGHC9E2SXS1BNTVsZcc/MwXjrCKJaIxMWTzPguzBTM76KVl95fr89wj5dDe8am uwoChaS/Vb+4ZshnhmDZHotWk5Hyk00mCqTKT4lcdZ/vFMmVfgzc6SDdiivfHkwOQL// LZnaByQM3sZRMdP28APGWamlH0IbjBKVAeiCy0VO7CavQq5J+AX3hvnmYK00CwQ70lHO QQaMQHX44JIZmv3wC2RtxknxD2MEatk5sCKYAEVJdIE45NTxEFB2Ez1tlIGV6ukJskkS h18KBQQuecqRbltdDbwQdlTVxRf94QlX8TUwxeKisQ/BubHevy6gPusbe4PFuYWVX54g z11g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:cc:references:from:subject:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pyGzdXX+PpJNqBikj4EAmTcOGVssrcYKCfwJglYLCj0=; b=Q+zSgd22gm0+VN8FIsfv6WfrI3IA8kGFAPK91RcugYzQM5eP3MU1nyZYw06tPmluEm CbQuEq/kYrf12YKiKGqy0dcCG9dLdrSh7/i2TJ96nFtZChOW+o9IsLcvALtpS8VgWDdj M6FnvMCZZKbtrmvbIM1C82hZzFfjvFfllwtVXDMzfFGPMqpR+9hsvbd7tl2nOtOo0jbK UzIAEv1qBqtDT2/XWlC62idwr2VFR0VemNJf53rpQ6QwKBJpaI4iOnHUzX+DXVKXYk3g x5gpbSUwZFoV32VB8ZSt41KWVchbpgM9xkqPe0K01jR+tu3R+y+PZagce6226mGau0Wz MBCQ== X-Gm-Message-State: AOAM533q5b+dMcJwRjD48YClVpdHHgojFGoAcTS2XwG92Xj6Zs4wm00R IWFoDEGC9TeG9rKHLlFjdRDtEryR9/0= X-Received: by 2002:a9d:458b:: with SMTP id x11mr1562574ote.313.1631078084569; Tue, 07 Sep 2021 22:14:44 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id p65sm264176oif.57.2021.09.07.22.14.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Sep 2021 22:14:43 -0700 (PDT) Sender: Guenter Roeck To: Al Viro Cc: Linus Torvalds , "David S. Miller" , Dmitry Torokhov , Christian Koenig , Huang Rui , Linux Kernel Mailing List , linux-sparc References: <20210906142615.GA1917503@roeck-us.net> <20210906234921.GA1394069@roeck-us.net> <20210908042838.GA2585993@roeck-us.net> From: Guenter Roeck Subject: Re: [PATCH] Enable '-Werror' by default for all kernel builds Message-ID: Date: Tue, 7 Sep 2021 22:14:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/7/21 9:48 PM, Al Viro wrote: > On Tue, Sep 07, 2021 at 09:28:38PM -0700, Guenter Roeck wrote: > >> memcpy(eth_addr, sanitize_address((void *) 0xfffc1f2c), ETH_ALEN); >> >> but that just seems weird. Is there a better solution ? > > (char (*)[ETH_ALEN])? Said that, shouldn't that be doing something like > ioremap(), rather than casting explicit constants? > Typecasts or even assigning the address to a variable does not help. The sanitizer function can not be static either. I don't know the hardware, so I can not answer the ioremap() question. This is just one example, though; there are several sprinkled throughout the code. Another is: arch/parisc/kernel/setup.c: running_on_qemu = (memcmp(&PAGE0->pad0, "SeaBIOS", 8) == 0); where #define PAGE0 ((struct zeropage *)__PAGE_OFFSET) and __PAGE_OFFSET depends on the configuration. That code runs early in setup; I don't think ioremap() would even be available at that time. A workaround for that problem would be a global variable pointing to PAGE0 (or of course an address sanitizer function), but again that seems odd just to make the compiler happy. Guenter