Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11298299ybi; Thu, 25 Jul 2019 13:41:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIuZPKybfJPC04+du2KqFMyhcP2tUAjE9eNbe1j6M2l2w0ncFjsYkPsyf3AdJIlxV399Y+ X-Received: by 2002:a17:90a:2190:: with SMTP id q16mr91498025pjc.23.1564087278457; Thu, 25 Jul 2019 13:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564087278; cv=none; d=google.com; s=arc-20160816; b=AwDwWF/KI9XulKJQ8selBm3CsBt3sz4w7uRPHvZ0ss86o0BOx4nxYo0t6FnbJS7Lu3 VuJ0FphLFOLDkN2THjKHaKmyY9m2aAwffn/vpG5TTZyQU/e5rdL7W44Gj/ZnPjstlx+l FmcHekJOuRS6LdJqJ5VHO9xwXu31LY2YT2a97FOimU679gec1GnHTkL/WS+wnKOvr+v+ AXfTQblFSWVHWgA1rqc6TUxco8sWS09EsPxhMhYxR7UrF0aHzjuoPYPhGKIyxYmAmr9V xbMxSGsLzS6Jim7kaeomK7N1vpiS1fWZgismKI+wSFfl9S90qnt61Ss1xQpsjUTJGraG zGrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=9+UfSFFvVBfC/Y+BWP+Ce+brhw7Kq1b1vMVNHyn+PyQ=; b=XfNmqNEy8t2mqr5ymvBquTSGzIu2+l2+KOiiuanGVZwu11ZwViKH4OTkC4AIyDEBS6 wOAjfDJbhFeEw4QgBUqvZt2GDfRVOoKFy2maINQYaeKfT5jSroM06Q+GgkBDH/5St2rp JcMPE/B7imJL0Ua1nAcu3jszA/jzvkaoAQwDYjxi5LCylzK8oJPpnK3AeSt3FnU9qZo3 Jk+UThMdPK4skgY0kJzOwdbIcYOo6QisrcfpEBeHEzZlgAftfEUCBWhMvnvyFrwYQy9s uLKkpzC5+93vokrghBtJ+6Oyno/N4I3c6EaFF8KcsUmTaQRwsh6kYLTMNYK2hgzvZsmt V1Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b=W5WgwoW8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si9364164pgk.46.2019.07.25.13.41.03; Thu, 25 Jul 2019 13:41:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b=W5WgwoW8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbfGYUjJ (ORCPT + 99 others); Thu, 25 Jul 2019 16:39:09 -0400 Received: from terminus.zytor.com ([198.137.202.136]:51353 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726195AbfGYUjJ (ORCPT ); Thu, 25 Jul 2019 16:39:09 -0400 Received: from carbon-x1.hos.anvin.org ([IPv6:2601:646:8600:3281:e7ea:4585:74bd:2ff0]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id x6PKcpZg1158853 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 25 Jul 2019 13:38:52 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com x6PKcpZg1158853 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1564087132; bh=9+UfSFFvVBfC/Y+BWP+Ce+brhw7Kq1b1vMVNHyn+PyQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=W5WgwoW8LHGW5eRt4XIJhQBYTCC/r0o4d9h7R00QJAx/nMXMkSuTK7PqPXT1qyOig qiqczL7sMJFQGCBjok7AKaoEgEmwo2cUoQjIKgbW7vaF91kFAjUudC6zI8RHrDWUKF 3JTn6P33/VkuhB9CgerMAq62nz7FWHEcyvfI/n1lRGxgQK+gUimYlUVJDz8XDzvxkb zikasoWIEf4QXDCsh6WO7l+6bt0QSadpV5enZgAX5g2FPJ7kFJZjVd/iwCW4I5/zPK Umgd7nk0vr9wAjYRRGjmiw1ueltbQUa1z84zySVJ1TdAHcBgPsF0LvNortXVyXp04k JUsQbHcrC4dzQ== Subject: Re: [PATCH 1/1] x86/boot: clear some fields explicitly To: Thomas Gleixner Cc: john.hubbard@gmail.com, Ingo Molnar , Borislav Petkov , x86@kernel.org, LKML , John Hubbard References: <20190724231528.32381-1-jhubbard@nvidia.com> <20190724231528.32381-2-jhubbard@nvidia.com> From: "H. Peter Anvin" Message-ID: <3831bbff-631a-2e62-9e82-e2b6181421c8@zytor.com> Date: Thu, 25 Jul 2019 13:38:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/25/19 12:22 AM, Thomas Gleixner wrote: >> >> The problem with this is that it will break silently when changes are >> made to this structure. > > That's not really the worst problem. Changes to that struct which touch any > of the to be cleared ranges will break anyway if not handled correctly in > the sanitizer function. > Not really... that's kind of the point (the cleared ranges are cleared explicitly because the boot loader failed to do so, so zeroing them is what the boot loader should have done.) The most correct way to address this would be to have an explicit list of members to be *preserved* even if the sentinel triggers. The easy way would be to put in a suitable cast to clear the warning -- I would not be surprised if an explicit cast to something like (void *) would quiet the warning, or else (yuck) put in an explicit (well-commented) #pragma to shut it up. -hpa