linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@linux.ibm.com>
To: Marco Elver <elver@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] kfence: only handle kernel mode faults
Date: Fri, 14 May 2021 12:55:01 +0200	[thread overview]
Message-ID: <yt9dk0o1inzu.fsf@linux.ibm.com> (raw)
In-Reply-To: <CANpmjNOLSuqeTr8YOnvz-V=eudBwraNvm+9V+YxEBUCm=EFwxw@mail.gmail.com> (Marco Elver's message of "Fri, 14 May 2021 12:52:38 +0200")

Marco Elver <elver@google.com> writes:

> On Fri, 14 May 2021 at 11:22, Sven Schnelle <svens@linux.ibm.com> wrote:
>>
>> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
>> ---
>>  mm/kfence/core.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/mm/kfence/core.c b/mm/kfence/core.c
>> index bc15e3cb71d5..161df492750c 100644
>> --- a/mm/kfence/core.c
>> +++ b/mm/kfence/core.c
>> @@ -813,6 +813,9 @@ bool kfence_handle_page_fault(unsigned long addr, bool is_write, struct pt_regs
>>         enum kfence_error_type error_type;
>>         unsigned long flags;
>>
>> +       if (user_mode(regs))
>> +               return false;
>> +
>
> I don't think it's required on all architectures, correct? If so, I
> think this should be part of the arch-specific code, i.e. just do "if
> (user_mode(regs) && kfence_handle_page_fault(...))" or similar.
> Because otherwise we'll wonder in future why we ever needed this, and
> e.g. determine it's useless and remove it again. ;-) Either that, or a
> comment. But I'd prefer to just keep it in the arch-specific code if
> required, because it seems to be the exception rather than the norm.

Ok, that's fine, i add it to our code then.

Thanks
Sven

  reply	other threads:[~2021-05-14 10:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14  9:21 [RFC] minor kfence patches Sven Schnelle
2021-05-14  9:21 ` [PATCH 1/2] kfence: add function to mask address bits Sven Schnelle
2021-05-14 10:54   ` Marco Elver
2021-05-14 11:03     ` Sven Schnelle
2021-05-14 11:23       ` Marco Elver
2021-05-14  9:21 ` [PATCH 2/2] kfence: only handle kernel mode faults Sven Schnelle
2021-05-14 10:52   ` Marco Elver
2021-05-14 10:55     ` Sven Schnelle [this message]
2021-05-14 10:59       ` Marco Elver
2021-05-14 10:56 ` [RFC] minor kfence patches Marco Elver

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=yt9dk0o1inzu.fsf@linux.ibm.com \
    --to=svens@linux.ibm.com \
    --cc=elver@google.com \
    --cc=linux-kernel@vger.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).