[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-03-01 Thread Marco Elver via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG17ce89fa8016: [SanitizerBounds] Add support for NoSanitizeBounds function (authored by ztong0001, committed by melver). Changed prior to commit: h

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-03-01 Thread Marco Elver via Phabricator via cfe-commits
melver added a comment. In D119816#3349076 , @ztong0001 wrote: > Hi Marco, > @melver, Could you please help me landing it? I don't have write permission > to the repo. > Please use Tong Zhang Sure. I had already applied the patch locally to test, but th

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-03-01 Thread Tong Zhang via Phabricator via cfe-commits
ztong0001 added a comment. Hi Marco, @melver, Could you please help me landing it? I don't have write permission to the repo. Please use Tong Zhang Thanks, Tong Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119816/new/ https://reviews.llvm.org/D1

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-28 Thread Tong Zhang via Phabricator via cfe-commits
ztong0001 added a comment. Hi Marco, Yes I need help landing it. Please use Tong Zhang Thanks, - Tong Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119816/new/ https://reviews.llvm.org/D119816 ___ cfe-c

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-28 Thread Marco Elver via Phabricator via cfe-commits
melver accepted this revision. melver added a comment. This revision is now accepted and ready to land. LGTM Let me know if you need help landing this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119816/new/ https://reviews.llvm.org/D119816 ___

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-25 Thread Tong Zhang via Phabricator via cfe-commits
ztong0001 added a comment. In D119816#3346575 , @kees wrote: > FWIW, related problems with `pskb_expand_head` were seen again here: > https://github.com/ClangBuiltLinux/linux/issues/1599 > > I have trouble reproducing it, but I think the kernel patch ther

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-25 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. FWIW, related problems with `pskb_expand_head` were seen again here: https://github.com/ClangBuiltLinux/linux/issues/1599 I have trouble reproducing it, but I think the kernel patch there solves the problem created by `__alloc_size` vs `ksize()`. Repository: rG LLVM Git

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-25 Thread Tong Zhang via Phabricator via cfe-commits
ztong0001 added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:757 SanOpts.set(SanitizerKind::HWAddress, false); + if (mask & SanitizerKind::LocalBounds) +Fn->addFnAttr(llvm::Attribute::NoSanitizeBounds); melver wrote: >

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-25 Thread Marco Elver via Phabricator via cfe-commits
melver added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:757 SanOpts.set(SanitizerKind::HWAddress, false); + if (mask & SanitizerKind::LocalBounds) +Fn->addFnAttr(llvm::Attribute::NoSanitizeBounds); ztong0001 wrote: >

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-25 Thread Tong Zhang via Phabricator via cfe-commits
ztong0001 updated this revision to Diff 411457. ztong0001 added a comment. - update commit description - In: CodeGenFunction::StartFunction(), merge two checks(SanitizerKind::LocalBounds, SanitizerKind::ArrayBounds) into one(SanitizerKind::Bounds) - update test: clang/test/CodeGen/bounds-checkin

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-25 Thread Tong Zhang via Phabricator via cfe-commits
ztong0001 added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:757 SanOpts.set(SanitizerKind::HWAddress, false); + if (mask & SanitizerKind::LocalBounds) +Fn->addFnAttr(llvm::Attribute::NoSanitizeBounds); ztong0001 wrote:

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-25 Thread Tong Zhang via Phabricator via cfe-commits
ztong0001 added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:757 SanOpts.set(SanitizerKind::HWAddress, false); + if (mask & SanitizerKind::LocalBounds) +Fn->addFnAttr(llvm::Attribute::NoSanitizeBounds); melver wrote: >

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-25 Thread Tong Zhang via Phabricator via cfe-commits
ztong0001 added a comment. In D119816#3345302 , @melver wrote: > Looks good. Few minor changes. > > I did some more digging, and it's only fsanitize=local-bounds, so please > verify this and also update the commit description. In fact, the Linux kernel

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-25 Thread Marco Elver via Phabricator via cfe-commits
melver added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:757 SanOpts.set(SanitizerKind::HWAddress, false); + if (mask & SanitizerKind::LocalBounds) +Fn->addFnAttr(llvm::Attribute::NoSanitizeBounds); These 2 checks can

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-25 Thread Marco Elver via Phabricator via cfe-commits
melver requested changes to this revision. melver added a comment. This revision now requires changes to proceed. Looks good. Few minor changes. I did some more digging, and it's only fsanitize=local-bounds, so please verify this and also update the commit description. In fact, the Linux kernel

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-24 Thread Tong Zhang via Phabricator via cfe-commits
ztong0001 updated this revision to Diff 411191. ztong0001 added a comment. Thank you, Marco! I have made the following changes: - extend clang/test/CodeGen/bounds-checking.c to include additional test for newly added nosanitize_bounds attribute - added a new pure IR test in llvm/test/Instrument

[PATCH] D119816: [SanitizerBounds] Add support for NoSanitizeBounds function

2022-02-24 Thread Marco Elver via Phabricator via cfe-commits
melver requested changes to this revision. melver added a comment. This revision now requires changes to proceed. Thanks - this looks good so far. Comment at: clang/test/CodeGen/sanitize-coverage.c:56 // BOUNDS-NOT: call void @__ubsan_handle_out_of_bounds + // BOUNDS-NOT: c