All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Michael Roth <michael.roth@amd.com>, x86@kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Joerg Roedel <jroedel@suse.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/sev: Fix overflow when computing address for PVALIDATE
Date: Sat, 11 Nov 2023 22:49:56 -0800	[thread overview]
Message-ID: <dfaa2d21-6ec2-4c19-b8ed-73328ceab1fb@intel.com> (raw)
In-Reply-To: <20231111020019.553664-1-michael.roth@amd.com>

On 11/10/23 18:00, Michael Roth wrote:
> -		vaddr = (unsigned long)pfn_to_kaddr(e->gfn);
> +		vaddr = (unsigned long)pfn_to_kaddr((unsigned long)e->gfn);
>  		size = e->pagesize ? RMP_PG_SIZE_2M : RMP_PG_SIZE_4K;
>  		validate = e->operation == SNP_PAGE_STATE_PRIVATE;
>  

... and people wonder why some of us avoid bitfields.

Shouldn't we just fix this permanently in pfn_to_kaddr()?  Surely more
of these are lurking around.  Anything doing a large shift up on a
little type is asking for trouble.

      reply	other threads:[~2023-11-12  6:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-11  2:00 [PATCH] x86/sev: Fix overflow when computing address for PVALIDATE Michael Roth
2023-11-12  6:49 ` Dave Hansen [this message]

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=dfaa2d21-6ec2-4c19-b8ed-73328ceab1fb@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --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.