[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-12 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/93408 >From f9e841ddaa865d529c806b2d115d5ddbc7109243 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 26 May 2024 11:40:01 +0200 Subject: [PATCH 01/17] [analyzer] Refine invalidation caused by `fread` This

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-12 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,443 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -triple x86_64-linux-gnu \ +// RUN: -analyzer-checker=core,unix.Stream,alpha.security.taint \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include

[clang] [llvm] [analyzer][NFC] Reorganize Z3 report refutation (PR #95128)

2024-06-12 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/95128 >From 6b9a5a6902c3efca6ac7d6a5dabc8950767560cc Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Tue, 11 Jun 2024 16:53:46 +0200 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -696,6 +730,69 @@ struct StreamOperationEvaluator { } // end anonymous namespace +//===--===//

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -98,6 +107,19 @@ struct StreamState { OpenFailed /// The last open operation has failed. } State; + StringRef getKindStr() const { +switch (State) { +

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -696,6 +730,69 @@ struct StreamOperationEvaluator { } // end anonymous namespace +//===--===//

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -696,6 +730,69 @@ struct StreamOperationEvaluator { } // end anonymous namespace +//===--===//

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -696,6 +730,69 @@ struct StreamOperationEvaluator { } // end anonymous namespace +//===--===//

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -696,6 +730,69 @@ struct StreamOperationEvaluator { } // end anonymous namespace +//===--===//

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -300,6 +333,8 @@ class StreamChecker : public Checkerhttps://github.com/llvm/llvm-project/pull/94957 ___ cfe-commits

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -696,6 +730,69 @@ struct StreamOperationEvaluator { } // end anonymous namespace +//===--===//

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: @@ -696,6 +730,69 @@ struct StreamOperationEvaluator { } // end anonymous namespace +//===--===//

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Krist=C3=B3f?= Umann , =?utf-8?q?Krist=C3=B3f?= Umann , =?utf-8?q?Krist=C3=B3f?= Umann Message-ID: In-Reply-To: https://github.com/steakhal commented: LGTM. I only had some nits and some terminology flexing. https://github.com/llvm/llvm-project/pull/94957

[clang] [analyzer] Add an ownership change visitor to StreamChecker (PR #94957)

2024-06-11 Thread Balazs Benics via cfe-commits
=?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann , =?utf-8?q?Kristóf?= Umann Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/94957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Finish moving alpha.core.SizeofPtr to clang-tidy (PR #95118)

2024-06-11 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. We should remember to mention this transfer explicitly in the release notes one day. But given that we don't really maintain/sync the release notes that's for another day, closer to the release branchoff.

[clang] [llvm] [analyzer][NFC] Reorganize Z3 report refutation (PR #95128)

2024-06-11 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/95128 This change keeps existing behavior, namely that if we hit a Z3 timeout we will accept the report as "satisfiable". This prepares for the commit "Harden safeguards for Z3 query times".

[clang] [llvm] Add SonarCloud (PR #94745)

2024-06-11 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/94745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Move 'alpha.cplusplus.MisusedMovedObject' to 'cplusplus.Move' in documentation (NFC) (PR #95003)

2024-06-10 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/95003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Replace X && isa(X) with isa_and_nonnull(X). NFC (PR #94987)

2024-06-10 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: LGTM, thanks! https://github.com/llvm/llvm-project/pull/94987 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-07 Thread Balazs Benics via cfe-commits
steakhal wrote: Let's do another round. https://github.com/llvm/llvm-project/pull/93408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/93408 >From f9e841ddaa865d529c806b2d115d5ddbc7109243 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 26 May 2024 11:40:01 +0200 Subject: [PATCH 01/16] [analyzer] Refine invalidation caused by `fread` This

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/93408 >From f9e841ddaa865d529c806b2d115d5ddbc7109243 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 26 May 2024 11:40:01 +0200 Subject: [PATCH 01/16] [analyzer] Refine invalidation caused by `fread` This

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-07 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,443 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -triple x86_64-linux-gnu \ +// RUN: -analyzer-checker=core,unix.Stream,alpha.security.taint \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-07 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,443 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -triple x86_64-linux-gnu \ +// RUN: -analyzer-checker=core,unix.Stream,alpha.security.taint \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-07 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,443 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -triple x86_64-linux-gnu \ +// RUN: -analyzer-checker=core,unix.Stream,alpha.security.taint \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include

[clang] [llvm] Add SonarCloud (PR #94745)

2024-06-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/94745 >From 099e93f425293daf376eccbe6fd771f297126588 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Fri, 7 Jun 2024 12:55:07 +0200 Subject: [PATCH 1/3] Add initial SonarCloud config ---

[clang] [llvm] Add SonarCloud (PR #94745)

2024-06-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/94745 >From 099e93f425293daf376eccbe6fd771f297126588 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Fri, 7 Jun 2024 12:55:07 +0200 Subject: [PATCH 1/2] Add initial SonarCloud config ---

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-06-07 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/93676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-06-07 Thread Balazs Benics via cfe-commits
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= , =?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= , =?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. LGTM, thanks. Minor nits. https://github.com/llvm/llvm-project/pull/93676

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-06-07 Thread Balazs Benics via cfe-commits
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= , =?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= , =?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= Message-ID: In-Reply-To: @@ -53,10 +62,10 @@ void f4(void) { int (*p)[m] = a; // p == [0] p += 1; // p == [1] - // FIXME: This warning is not needed + // FIXME:

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-06 Thread Balazs Benics via cfe-commits
steakhal wrote: Addressed all the feedback. https://github.com/llvm/llvm-project/pull/93408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-06 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/93408 Unicorn! GitHub body { background-color: #f1f1f1; margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .container { margin: 50px

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-06 Thread Balazs Benics via cfe-commits
@@ -907,6 +945,73 @@ void StreamChecker::preWrite(const FnDescription *Desc, const CallEvent , C.addTransition(State); } +static std::optional getPointeeType(const MemRegion *R) { + if (!R) +return std::nullopt; + if (const auto *ER = dyn_cast(R)) +return

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-06 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,412 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -triple x86_64-linux-gnu \ +// RUN: -analyzer-checker=core,unix.Stream,alpha.security.taint \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-06 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,412 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -triple x86_64-linux-gnu \ +// RUN: -analyzer-checker=core,unix.Stream,alpha.security.taint \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-06 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,412 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -triple x86_64-linux-gnu \ +// RUN: -analyzer-checker=core,unix.Stream,alpha.security.taint \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-06 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,412 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -triple x86_64-linux-gnu \ +// RUN: -analyzer-checker=core,unix.Stream,alpha.security.taint \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-06 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/93408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-06 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,412 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -triple x86_64-linux-gnu \ +// RUN: -analyzer-checker=core,unix.Stream,alpha.security.taint \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-06 Thread Balazs Benics via cfe-commits
@@ -907,6 +945,73 @@ void StreamChecker::preWrite(const FnDescription *Desc, const CallEvent , C.addTransition(State); } +static std::optional getPointeeType(const MemRegion *R) { + if (!R) +return std::nullopt; + if (const auto *ER = dyn_cast(R)) +return

[clang] [analyzer] New optin.taint.TaintedAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-06-05 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/92420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Factor out NoOwnershipChangeVisitor (PR #94357)

2024-06-05 Thread Balazs Benics via cfe-commits
steakhal wrote: Is this NFC? https://github.com/llvm/llvm-project/pull/94357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] New optin.taint.TaintedAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-06-05 Thread Balazs Benics via cfe-commits
@@ -938,6 +938,53 @@ optin.portability.UnixAPI " Finds implementation-defined behavior in UNIX/Posix functions. +.. _optin-taint-TaintedAlloc: + +optin.taint.TaintedAlloc (C, C++) +""" steakhal wrote:

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-03 Thread Balazs Benics via cfe-commits
steakhal wrote: Checkout the new implementation and the added "weird" fread tests. FYI unfortunately our store interferes a bit, as you will see in the last test (`test_unaligned_start_read`) when the store does not purge the previous binding when we have an overlapping write to the store.

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-03 Thread Balazs Benics via cfe-commits
@@ -937,8 +990,21 @@ void StreamChecker::evalFreadFwrite(const FnDescription *Desc, // At read, invalidate the buffer in any case of error or success, // except if EOF was already present. - if (IsFread && !E.isStreamEof()) -State = escapeArgs(State, C, Call, {0});

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-03 Thread Balazs Benics via cfe-commits
@@ -717,18 +717,71 @@ const ExplodedNode *StreamChecker::getAcquisitionSite(const ExplodedNode *N, return nullptr; } +/// Invalidate only the requested elements instead of the whole buffer. +/// This is basically a refinement of the more generic 'escapeArgs' or +/// the

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-03 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/93408 >From f9e841ddaa865d529c806b2d115d5ddbc7109243 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 26 May 2024 11:40:01 +0200 Subject: [PATCH 1/8] [analyzer] Refine invalidation caused by `fread` This

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-03 Thread Balazs Benics via cfe-commits
steakhal wrote: Fixed most NFC typos and suggestions. Let's continue the discussion. https://github.com/llvm/llvm-project/pull/93408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-03 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/93408 >From f9e841ddaa865d529c806b2d115d5ddbc7109243 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 26 May 2024 11:40:01 +0200 Subject: [PATCH 1/6] [analyzer] Refine invalidation caused by `fread` This

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-03 Thread Balazs Benics via cfe-commits
@@ -717,18 +717,71 @@ const ExplodedNode *StreamChecker::getAcquisitionSite(const ExplodedNode *N, return nullptr; } +/// Invalidate only the requested elements instead of the whole buffer. +/// This is basically a refinement of the more generic 'escapeArgs' or +/// the

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-06-03 Thread Balazs Benics via cfe-commits
@@ -937,8 +990,21 @@ void StreamChecker::evalFreadFwrite(const FnDescription *Desc, // At read, invalidate the buffer in any case of error or success, // except if EOF was already present. - if (IsFread && !E.isStreamEof()) -State = escapeArgs(State, C, Call, {0});

[clang] [clang][analyzer] Move unix.BlockInCriticalSection out of alpha (PR #93815)

2024-06-03 Thread Balazs Benics via cfe-commits
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/93815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][analyzer] Move PutenvStackArrayChecker out of alpha package (PR #93980)

2024-06-03 Thread Balazs Benics via cfe-commits
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/93980 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][analyzer] Move PutenvStackArrayChecker out of alpha package (PR #93980)

2024-06-03 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/93980 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-06-01 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -0,0 +1,74 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.PointerSub -verify %s + +void f1(void) { + int x, y, z[10]; + int d = - // expected-warning{{Subtraction of two pointers

[clang] [clang][analyzer] Move PutenvStackArrayChecker out of alpha package. (PR #93980)

2024-06-01 Thread Balazs Benics via cfe-commits
@@ -1179,6 +1179,41 @@ security.insecureAPI.DeprecatedOrUnsafeBufferHandling (C) strncpy(buf, "a", 1); // warn } +.. _security-putenv-stack-array: + +security.PutenvStackArray (C) +" +Finds calls to the ``putenv`` function which pass a pointer

[clang] [clang][analyzer] Move PutenvStackArrayChecker out of alpha package. (PR #93980)

2024-06-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/93980 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move PutenvStackArrayChecker out of alpha package. (PR #93980)

2024-06-01 Thread Balazs Benics via cfe-commits
@@ -1179,6 +1179,41 @@ security.insecureAPI.DeprecatedOrUnsafeBufferHandling (C) strncpy(buf, "a", 1); // warn } +.. _security-putenv-stack-array: + +security.PutenvStackArray (C) +" +Finds calls to the ``putenv`` function which pass a pointer

[clang] [clang][analyzer] Move PutenvStackArrayChecker out of alpha package. (PR #93980)

2024-06-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I have only a handful of remarks. LGTM otherwise. https://github.com/llvm/llvm-project/pull/93980 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][analyzer] Move unix.BlockInCriticalSection out of alpha (PR #93815)

2024-06-01 Thread Balazs Benics via cfe-commits
@@ -1235,6 +1235,49 @@ Check calls to various UNIX/Posix functions: ``open, pthread_once, calloc, mallo .. literalinclude:: checkers/unix_api_example.c :language: c +.. _unix-BlockInCriticalSection: + +unix.BlockInCriticalSection (C)

[clang] [clang][analyzer] Move unix.BlockInCriticalSection out of alpha (PR #93815)

2024-06-01 Thread Balazs Benics via cfe-commits
@@ -1235,6 +1235,49 @@ Check calls to various UNIX/Posix functions: ``open, pthread_once, calloc, mallo .. literalinclude:: checkers/unix_api_example.c :language: c +.. _unix-BlockInCriticalSection: + +unix.BlockInCriticalSection (C)

[clang] [clang][analyzer] Move unix.BlockInCriticalSection out of alpha (PR #93815)

2024-06-01 Thread Balazs Benics via cfe-commits
@@ -1235,6 +1235,49 @@ Check calls to various UNIX/Posix functions: ``open, pthread_once, calloc, mallo .. literalinclude:: checkers/unix_api_example.c :language: c +.. _unix-BlockInCriticalSection: + +unix.BlockInCriticalSection (C)

[clang] [clang][analyzer] Move unix.BlockInCriticalSection out of alpha (PR #93815)

2024-06-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM. Minor typos/doc suggestions. https://github.com/llvm/llvm-project/pull/93815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][analyzer] Move unix.BlockInCriticalSection out of alpha (PR #93815)

2024-06-01 Thread Balazs Benics via cfe-commits
@@ -1235,6 +1235,49 @@ Check calls to various UNIX/Posix functions: ``open, pthread_once, calloc, mallo .. literalinclude:: checkers/unix_api_example.c :language: c +.. _unix-BlockInCriticalSection: + +unix.BlockInCriticalSection (C)

[clang] [clang][analyzer] Move unix.BlockInCriticalSection out of alpha (PR #93815)

2024-06-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/93815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move unix.BlockInCriticalSection out of alpha (PR #93815)

2024-06-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/93815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Fix comparison to True/False (PR #94038)

2024-06-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/94038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Fix comparison to True/False (PR #94038)

2024-06-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/94038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix(clang/**.py): fix comparison to True/False (PR #94038)

2024-06-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. I'm not sure if llvm follows PEP8, but the change looks good regardless. https://github.com/llvm/llvm-project/pull/94038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][analyzer][NFC] Improve docs of alpha.unix.BlockInCriticalSection (PR #93812)

2024-05-31 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/93812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -938,6 +938,53 @@ optin.portability.UnixAPI " Finds implementation-defined behavior in UNIX/Posix functions. +.. _optin-taint-TaintAlloc: + +optin.taint.TaintAlloc (C, C++) +""" + +This checker warns for cases when the

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -1695,6 +1707,12 @@ MallocChecker::processNewAllocation(const CXXAllocatorCall , // MallocUpdateRefState() instead of MallocMemAux() which breaks the // existing binding. SVal Target = Call.getObjectUnderConstruction(); + if (Call.getOriginExpr()->isArray()) { +

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -938,6 +938,53 @@ optin.portability.UnixAPI " Finds implementation-defined behavior in UNIX/Posix functions. +.. _optin-taint-TaintAlloc: + +optin.taint.TaintAlloc (C, C++) steakhal wrote: I was thinking of suggesting

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -1730,6 +1721,21 @@ def UnixAPIPortabilityChecker : Checker<"UnixAPI">, } // end optin.portability + +//===--===// +// Taint checkers.

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/92420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. I join Donát, and I agree that this looks good as it is. I had a handful of final remarks but I have no strong opinion on any of the raised points. Merge this, once you considered them and took action if you agreed.

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-05-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I'd say it looks pretty good. Objectively speaking it improves the TP rate. I have compared these reports against the constant interpreters of clang and gcc to see if in constexpr context which of these expression would trigger "UB" there. I found I think

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.PointerSub -verify %s + +void f1(void) { + int x, y, z[10]; + int d = - // expected-warning{{Subtraction of two pointers that do not point into the same array is undefined behavior}} + d = z - //

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.PointerSub -verify %s + +void f1(void) { + int x, y, z[10]; + int d = - // expected-warning{{Subtraction of two pointers that do not point into the same array is undefined behavior}} + d = z - //

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-05-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/93676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-26 Thread Balazs Benics via cfe-commits
steakhal wrote: > I'll port this patch downstream to see how this would behave on the Juliet > C++ benchmark or on some real-world code. Ah nvm. llvm/main diverged quite a bit since 18.1.6. I can't just pick this one. Given this, I won't backport and test this PR.

[clang] [analyzer] Adding taint analysis capability to unix.Malloc checker (PR #92420)

2024-05-26 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: The patch makes sense to me. Have you considered applying the same heuristic to C++ array new allocations? I'll port this patch downstream to see how this would behave on the Juliet C++ benchmark or on some real-world code.

[clang] [clang][analyzer] PutenvStackArrayChecker: No warning from 'main' (PR #93299)

2024-05-26 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/93299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-05-26 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/93408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-05-26 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/93408 This change enables more accurate modeling of the write effects of `fread`. In particular, instead of invalidating the whole buffer, in a best-effort basis, we would try to invalidate the actually accesses

[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #91879)

2024-05-23 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/91879 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Use ArrayRef for input parameters (PR #93203)

2024-05-23 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/93203 Fixes #79684 >From ef65ed8c193c43c1914dc39bf1cd48da83872fc5 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Thu, 23 May 2024 10:56:33 +0200 Subject: [PATCH] [analyzer][NFC] Use ArrayRef for input parameters

[clang] [clang][AST] Fix end location of DeclarationNameInfo on instantiated methods (PR #92654)

2024-05-22 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/92654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] Fix end location of DeclarationNameInfo on instantiated methods (PR #92654)

2024-05-22 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/92654 >From 3f3c98a55a6d89ddb05085c41d1fffad331595ce Mon Sep 17 00:00:00 2001 From: Alejandro _lvarez Ayll_n Date: Sat, 18 May 2024 16:53:33 +0200 Subject: [PATCH] [clang][AST] Fix end location of DeclarationNameInfo

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-21 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: steakhal wrote: Make sure you adjust/sync the commit title, content and the PR title before merging. https://github.com/llvm/llvm-project/pull/92424 ___ cfe-commits mailing

[clang] [clang][AST] Fix end location of DeclarationNameInfo on instantiated methods (PR #92654)

2024-05-21 Thread Balazs Benics via cfe-commits
steakhal wrote: > nit: add a note in `clang/docs/ReleaseNotes.rst` Thanks. Added. Let me know if it's in the right section. @hokein https://github.com/llvm/llvm-project/pull/92654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][AST] Fix end location of DeclarationNameInfo on instantiated methods (PR #92654)

2024-05-21 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/92654 >From 58ca4d9be1dbc43ad40b6e26b8a5d79e20be8d93 Mon Sep 17 00:00:00 2001 From: Alejandro _lvarez Ayll_n Date: Sat, 18 May 2024 16:53:33 +0200 Subject: [PATCH 1/2] [clang][AST] Fix end location of

[clang] [clang][AST] Fix end location of DeclarationNameInfo on instantiated methods (PR #92654)

2024-05-18 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/92654 Fixes #71161 [D64087](https://reviews.llvm.org/D64087) updated some locations of the instantiated method but forgot `DNLoc`. `FunctionDecl::getNameInfo()` constructs a `DeclarationNameInfo` using `Decl::Loc`

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-18 Thread Balazs Benics via cfe-commits
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/92424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-18 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/92424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-18 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -2792,6 +2792,31 @@ Warn on mmap() calls that are both writable and executable. // code } +.. _alpha-security-putenv-stack-array: + +alpha.security.PutenvStackArray +"""

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-18 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -2792,6 +2792,31 @@ Warn on mmap() calls that are both writable and executable. // code } +.. _alpha-security-putenv-stack-array: + +alpha.security.PutenvStackArray +""" +Finds calls

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Balazs Benics via cfe-commits
@@ -1179,6 +1179,54 @@ security.insecureAPI.DeprecatedOrUnsafeBufferHandling (C) strncpy(buf, "a", 1); // warn } +.. _security-putenv-with-auto: + +security.PutenvWithAuto +""" +Finds calls to the ``putenv`` function which pass a pointer to an

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Balazs Benics via cfe-commits
steakhal wrote: > The "cert" package looks not useful and the checker has not a meaningful name > with the old naming scheme. > Additionally tests and documentation is updated. > The checker looks good enough to be moved into non-alpha package. Personally, I prefer reviewing content changes

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/92424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   7   8   9   10   >