ztong0001 added a comment.

In D119816#3331797 <https://reviews.llvm.org/D119816#3331797>, @melver wrote:

> Right, I was able to repro this. The problem is the trap, which generally 
> sucks that no_sanitize still leaves in the trap.
>
> We also have -fno-sanitize-undefined-trap-on-error, which seems to have no 
> effect either (should it?).
>
> So I think there are 2 problems:
>
> 1. Clang still emitting traps even though it shouldn't.
>
> 2. The Linux kernel problem.
>
> I think it's fine if you address problem 1 with this, as it's an oversight. 
> But I think problem 2 wants to be solved differently as I suggested.

I haven't tried -fno-sanitize-undefined-trap-on-error yet.

IMO trap in kernel gives a generic crash message which is... hard to tell from 
other cases without further investigating. If I enable KASAN kernel will print 
out something like

`
[    1.197953] BUG: KASAN: use-after-free in __pci_enable_msi_range+0x234/0x320
[    1.198327] Freed by task 1:
[    1.198327]  kfree+0x8f/0x2b0
[    1.198327]  msi_free_msi_descs_range+0xf5/0x130
`

I agree with you that there are two problems.
I think it makes sense to let optimizer aware of `ksize()` if the kernel API 
won't change dramatically in the future.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119816/new/

https://reviews.llvm.org/D119816

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to