leaves the function without a terminator.
Zero the on-stack buffer to avoid this possible UB.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: kernel test robot
Closes:
https://lore.kernel.org/oe-kbuild-all/202402100205.pwxiz1zk-...@intel.com/
Co-developed-by: Ruowen Qin
Signed-off-by
Hi Julian,
On 11/22/24 5:43 AM, Julian Anastasov wrote:
>
> Hello,
>
> On Thu, 21 Nov 2024, Jinghao Jia wrote:
>
>> Under certain kernel configurations when building with Clang/LLVM, the
>> compiler does not generate a return or jump as the te
et tree rather than net-next
* Add a "Fixes" tag for the initial git commit
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: kernel test robot
Closes:
https://lore.kernel.org/oe-kbuild-all/202402100205.pwxiz1zk-...@intel.com/
Co-developed-by: Ruowen Qin
Signed-off-by:
Hi Julian,
Thanks for getting back to us!
On 11/18/24 6:41 AM, Julian Anastasov wrote:
>
> Hello,
>
> On Mon, 11 Nov 2024, Jinghao Jia wrote:
>
>> Under certain kernel configurations when building with Clang/LLVM, the
>> compiler does not generate a retur
leaves the function without a terminator.
Zero the on-stack buffer to avoid this possible UB.
Reported-by: kernel test robot
Closes:
https://lore.kernel.org/oe-kbuild-all/202402100205.pwxiz1zk-...@intel.com/
Co-developed-by: Ruowen Qin
Signed-off-by: Ruowen Qin
Signed-off-by: Jinghao Jia
---
ne
On 3/16/24 08:46, Masami Hiramatsu (Google) wrote:
> On Thu, 14 Mar 2024 18:56:35 -0500
> Jinghao Jia wrote:
>
>> On 3/14/24 10:17, Masami Hiramatsu (Google) wrote:
>>> From: Masami Hiramatsu (Google)
>>>
>>> Read from an unsafe
On 3/14/24 10:17, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google)
>
> Read from an unsafe address with copy_from_kernel_nofault() in
> arch_adjust_kprobe_addr() because this function is used before checking
> the address is in text or not. Syzcaller bot found a bug and reported
On 2/4/24 06:09, Masami Hiramatsu (Google) wrote:
> On Sat, 3 Feb 2024 21:13:00 -0600
> Jinghao Jia wrote:
>
>> With the instruction decoder, we are now able to decode and recognize
>> instructions with opcode extensions. There are more instructions in
>> these
ring buffer, since the exception is triggered in the copy
buffer rather than the original location.
Check for INT and UD in can_probe and reject any kprobes trying to
attach to these instructions.
Suggested-by: Masami Hiramatsu (Google)
Signed-off-by: Jinghao Jia
---
arch/x86/kernel/kprobes
like RIP, let's boost them so that we get the
performance benefit.
Signed-off-by: Jinghao Jia
---
arch/x86/kernel/kprobes/core.c | 23 +--
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
Both can_probe and can_boost have int return type but are using int as
boolean in their context.
Refactor both functions to make them actually return boolean.
Signed-off-by: Jinghao Jia
---
arch/x86/kernel/kprobes/common.h | 2 +-
arch/x86/kernel/kprobes/core.c | 33
scussion.
- Improve code comments in general.
Jinghao Jia (3):
x86/kprobes: Refactor can_{probe,boost} return type to bool
x86/kprobes: Prohibit kprobing on INT and UD
x86/kprobes: Boost more instructions from grp2/3/4/5
arch/x86/kernel/kprobes/common.h | 2 +-
arch/x86/kernel/kprobes/core.
On 1/29/24 19:44, Masami Hiramatsu (Google) wrote:
> On Sun, 28 Jan 2024 15:25:59 -0600
> Jinghao Jia wrote:
>
>>>> /* Check if paddr is at an instruction boundary */
>>>> static int can_probe(unsigned long paddr)
>>>> {
>>>> @@ -
On 1/27/24 20:22, Masami Hiramatsu (Google) wrote:
> On Fri, 26 Jan 2024 22:41:24 -0600
> Jinghao Jia wrote:
>
>> With the instruction decoder, we are now able to decode and recognize
>> instructions with opcode extensions. There are more instructions in
>> these
On 1/27/24 19:19, Masami Hiramatsu (Google) wrote:
> On Fri, 26 Jan 2024 22:41:23 -0600
> Jinghao Jia wrote:
>
>> Both INTs (INT n, INT1, INT3, INTO) and UDs (UD0, UD1, UD2) serve
>> special purposes in the kernel, e.g., INT3 is used by KGDB and UD2 is
>> involved i
On 1/27/24 13:47, Xin Li wrote:
> On 1/26/2024 8:41 PM, Jinghao Jia wrote:
>> Both INTs (INT n, INT1, INT3, INTO) and UDs (UD0, UD1, UD2) serve
>> special purposes in the kernel, e.g., INT3 is used by KGDB and UD2 is
>> involved in LLVM-KCFI instrumentation. At the
instructions were not boosted
previously because they use opcode extensions that are not handled by the
kernel. But now with the instruction decoder they can be easily handled.
Boosting (and further jump optimizing) these instructions leads to a 10x
performance gain for a single probe on QEMU.
Jinghao
like RIP, let's boost them so that we get the
performance benefit.
Signed-off-by: Jinghao Jia
---
arch/x86/kernel/kprobes/core.c | 21 +++--
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
kernel ring buffer, since the exception is triggered
in the copy buffer rather than the original location.
Check for INTs and UDs in can_probe and reject any kprobes trying to
attach to these instructions.
Suggested-by: Masami Hiramatsu (Google)
Signed-off-by: Jinghao Jia
---
arch/x86/kernel
lation
directly in kprobe_emulate_call_indirect. At this point we can obtain
the instruction size from p->ainsn.size so that we can calculate the
correct return address.
Fixes: 6256e668b7af ("x86/kprobes: Use int3 instead of debug trap for
single-step")
Signed-off-by: Jinghao Jia
---
arch/x86/k
20 matches
Mail list logo