[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJF2gTTuva2HmoJymP1atfKxudS67XY8pygukgEH98D=o3dwUw@mail.gmail.com>
Date: Mon, 6 Feb 2023 11:10:12 +0800
From: Guo Ren <guoren@...nel.org>
To: Björn Töpel <bjorn@...nel.org>
Cc: Jessica Clarke <jrtc27@...c27.com>,
Palmer Dabbelt <palmer@...osinc.com>,
Conor Dooley <conor.dooley@...rochip.com>,
liaochang1@...wei.com, linux-arch <linux-arch@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-riscv <linux-riscv@...ts.infradead.org>,
Guo Ren <guoren@...ux.alibaba.com>,
Bjorn Topel <bjorn.topel@...il.com>
Subject: Re: [PATCH] riscv: kprobe: Fixup misaligned load text
On Thu, Feb 2, 2023 at 10:36 PM Björn Töpel <bjorn@...nel.org> wrote:
>
> Jessica Clarke <jrtc27@...c27.com> writes:
>
> >> + p->opcode = *insn++;
> >> + if (GET_INSN_LENGTH(p->opcode) == 4)
> >> + p->opcode |= *insn << 16;
> >
> > *insn gets promoted to int not unsigned so this is UB if bit 15 is set.
>
> Ugh. Good catch! I guess we can't get rid of *that* explicit cast to
> kprobe_opcode_t here...
Hi Bjorn & Jessica,
Thx for reviewing.
The new version came out:
https://lore.kernel.org/linux-riscv/20230204063531.740220-1-guoren@kernel.org/
--
Best Regards
Guo Ren
Powered by blists - more mailing lists