mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Geert Uytterhoeven" <geert@linux-m68k.org>
Cc: "Florian Fuchs" <fuchsfl@gmail.com>,
	linux-sh@vger.kernel.org,
	"Yoshinori Sato" <yoshinori.sato@nifty.com>,
	"Rich Felker" <dalias@libc.org>,
	"John Paul Adrian Glaubitz" <glaubitz@physik.fu-berlin.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sh: traps: Fix kernel unaligned access fixup in branch delay slots
Date: Fri, 23 Oct 2026 09:25:29 +0200	[thread overview]
Message-ID: <4eccd2fe-9749-4220-832b-b34308ccc0a8@app.fastmail.com> (raw)
In-Reply-To: <CAMuHMdVOA2bo2NTz7L=+W_h_eTmXJY7JeuFdKbh-uB3n-23SDQ@mail.gmail.com>

On Fri, Oct 23, 2026, at 09:15, Geert Uytterhoeven wrote:
> On Fri, 23 Oct 2026 at 09:09, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Fri, Oct 23, 2026, at 01:34, Florian Fuchs wrote:
>> > @@ -287,8 +287,10 @@ static inline int handle_delayslot(struct pt_regs *regs,
>> >       insn_size_t instruction;
>> >       void __user *addr = (void __user *)(regs->pc +
>> >               instruction_size(old_instruction));
>> > +     struct mem_access *insn_ma = user_mode(regs) ?
>> > +             &user_mem_access : &kernel_mem_access;
>> >
>> > -     if (copy_from_user(&instruction, addr, sizeof(instruction))) {
>> > +     if (insn_ma->from(&instruction, addr, sizeof(instruction))) {
>> >               /* the instruction-fetch faulted */
>> >               if (user_mode(regs))
>> >                       return -EFAULT;
>>
>> The "insn_ma" pointer is always the same as the 'ma' argument
>> you already pass, as both are set based on 'user_mode(regs)'.
>> Why not just use the pointer you already have?
>
> That would also handle handle_trapped_io(), which passes
> &trapped_io_access, right?

Indeed, that would be bad. The patch looks fine then.

Acked-by: Arnd Bergmann <arnd@arndb.de>

      reply	other threads:[~2026-10-23  7:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 23:34 Florian Fuchs
2026-10-23  7:07 ` Arnd Bergmann
2026-10-23  7:15   ` Geert Uytterhoeven
2026-10-23  7:25     ` Arnd Bergmann [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=4eccd2fe-9749-4220-832b-b34308ccc0a8@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=dalias@libc.org \
    --cc=fuchsfl@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=yoshinori.sato@nifty.com \
    /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

all inboxes | Powered by JetHome®