All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: <hpa@zytor.com>, <john.hubbard@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	<x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] x86/boot: clear some fields explicitly
Date: Wed, 24 Jul 2019 23:49:22 -0700	[thread overview]
Message-ID: <f83947fe-8a80-8693-56bd-76cb6f37317e@nvidia.com> (raw)
In-Reply-To: <B7DC31CA-E378-445A-A937-1B99490C77B4@zytor.com>

On 7/24/19 7:12 PM, hpa@zytor.com wrote:
> On July 24, 2019 4:15:28 PM PDT, john.hubbard@gmail.com wrote:
>> From: John Hubbard <jhubbard@nvidia.com>
...
>> +		boot_params->ext_ramdisk_image = 0;
>> +		boot_params->ext_ramdisk_size = 0;
>> +		boot_params->ext_cmd_line_ptr = 0;
>> +
>> +		memset(&boot_params->_pad4, 0, sizeof(boot_params->_pad4));
>> 		memset(&boot_params->_pad7[0], 0,
>> 		       (char *)&boot_params->edd_mbr_sig_buffer[0] -
>> 			(char *)&boot_params->_pad7[0]);
> 
> The problem with this is that it will break silently when changes are made to this structure.
> 
> So, that is a NAK from me.
> 

Understood. It occurs to me, though, that it would be trivial to
just add build time assertions to check a few struct member offset
values, and fail out if they changed. That would give us everything:
warnings-free builds, and no silent failures.

Thoughts?

thanks,
-- 
John Hubbard
NVIDIA

  reply	other threads:[~2019-07-25  6:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 23:15 [PATCH 0/1] x86/boot: clear some fields explicitly john.hubbard
2019-07-24 23:15 ` [PATCH 1/1] " john.hubbard
2019-07-25  2:12   ` hpa
2019-07-25  6:49     ` John Hubbard [this message]
2019-07-25  7:22     ` Thomas Gleixner
2019-07-25 20:33       ` John Hubbard
2019-07-25 21:48         ` Thomas Gleixner
2019-07-25 21:57           ` hpa
2019-07-25 22:03             ` Thomas Gleixner
2019-07-25 22:28               ` H. Peter Anvin
2019-07-25 22:37                 ` Thomas Gleixner
2019-07-26  0:36                   ` John Hubbard
2019-07-25 22:42                 ` John Hubbard
2019-07-26  7:43                   ` Thomas Gleixner
2019-07-25 20:38       ` H. Peter Anvin
2019-07-25 20:44         ` John Hubbard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f83947fe-8a80-8693-56bd-76cb6f37317e@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=john.hubbard@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.