From: "Björn Töpel" <bjorn@kernel.org>
To: Jessica Clarke <jrtc27@jrtc27.com>
Cc: Guo Ren <guoren@kernel.org>, Palmer Dabbelt <palmer@rivosinc.com>,
Conor Dooley <conor.dooley@microchip.com>,
liaochang1@huawei.com, linux-arch <linux-arch@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-riscv <linux-riscv@lists.infradead.org>,
Guo Ren <guoren@linux.alibaba.com>,
Bjorn Topel <bjorn.topel@gmail.com>
Subject: Re: [PATCH] riscv: kprobe: Fixup misaligned load text
Date: Thu, 02 Feb 2023 15:36:29 +0100 [thread overview]
Message-ID: <878rhgrv6a.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <5C373F4A-983E-4ACA-AAB0-54E629D5F501@jrtc27.com>
Jessica Clarke <jrtc27@jrtc27.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...
next prev parent reply other threads:[~2023-02-02 14:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 6:46 [PATCH] riscv: kprobe: Fixup misaligned load text guoren
2023-02-01 9:40 ` Björn Töpel
2023-02-02 6:17 ` Guo Ren
2023-02-02 9:48 ` Björn Töpel
2023-02-02 10:59 ` Jessica Clarke
2023-02-02 14:36 ` Björn Töpel [this message]
2023-02-06 3:10 ` Guo Ren
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=878rhgrv6a.fsf@all.your.base.are.belong.to.us \
--to=bjorn@kernel.org \
--cc=bjorn.topel@gmail.com \
--cc=conor.dooley@microchip.com \
--cc=guoren@kernel.org \
--cc=guoren@linux.alibaba.com \
--cc=jrtc27@jrtc27.com \
--cc=liaochang1@huawei.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@rivosinc.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