linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Thomas Gleixner <tglx@linutronix.de>
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:35:29 +0100	[thread overview]
Message-ID: <d82bd8e7-0215-5691-ebe2-3cc9bf6dd9d4@suse.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1901151124160.1865@nanos.tec.linutronix.de>

On 15/01/2019 11:25, Thomas Gleixner wrote:
> 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.

And that's what the patch does.


Juergen


  reply	other threads:[~2019-01-15 10:35 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
2019-01-15 10:35       ` Juergen Gross [this message]
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=d82bd8e7-0215-5691-ebe2-3cc9bf6dd9d4@suse.com \
    --to=jgross@suse.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peng.hao2@zte.com.cn \
    --cc=peterz@infradead.org \
    --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 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).