From: Thomas Gleixner <tglx@linutronix.de>
To: Juergen Gross <jgross@suse.com>
Cc: peng.hao2@zte.com.cn, bp@alien8.de, dave.hansen@linux.intel.com,
peterz@infradead.org, luto@kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mm/mem_encrypt_identity : fix error useage to sizeof
Date: Tue, 15 Jan 2019 11:25:10 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.21.1901151124160.1865@nanos.tec.linutronix.de> (raw)
In-Reply-To: <cc31816f-a4b1-b694-dcac-ac13f4442508@suse.com>
On Tue, 15 Jan 2019, Juergen Gross wrote:
> On 15/01/2019 11:13, Thomas Gleixner wrote:
> > On Mon, 7 Jan 2019, peng.hao2@zte.com.cn wrote:
> >
> >>>> Fix error usage to sizeof. It should not use sizeof to pointer.
> >>>
> >>> .... because?
> >>>
> >>> The commit message needs to explain what the potential issue could be
> >>> and why it doesn't matter in this case.
> >> I see the definition of pte_t may be more than sizeof(unsigned long).
> >> So I think sizeof(pte_t) is safer.
> >
> > What exactly is the difference between:
> >
> > pte_t *p;
> >
> > sizeof(*p)
> >
> > and
> >
> > sizeof(pte_t)
> >
> > and what is safer about the latter?
>
> Please note that the current code is using sizeof(p) instead of sizeof(*p).
Ooops. That's wrong indeed, but we should not change it to sizeof(pte_t)
and change it to sizeof(*p) instead.
Thanks,
tglx
next prev parent reply other threads:[~2019-01-15 10:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201901071946365174691@zte.com.cn>
2019-01-15 10:13 ` Re:[PATCH] x86/mm/mem_encrypt_identity : fix error useage to sizeof Thomas Gleixner
2019-01-15 10:21 ` [PATCH] " Juergen Gross
2019-01-15 10:25 ` Thomas Gleixner [this message]
2019-01-15 10:35 ` Juergen Gross
2019-01-15 10:35 ` Thomas Gleixner
2018-12-29 6:34 Peng Hao
2018-12-29 8:00 ` Borislav Petkov
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=alpine.DEB.2.21.1901151124160.1865@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=peng.hao2@zte.com.cn \
--cc=peterz@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).