[0/2] provide simple detection of indeterminate pointers

Message ID b23da7b4-e782-9ac8-3d28-541b93fc2fd5@gmail.com
Headers
Series provide simple detection of indeterminate pointers |

Message

Martin Sebor Nov. 1, 2021, 10:15 p.m. UTC
  This two-patch series adds support for the detection of uses
of pointers invalidated as a result of the lifetime of
the objects they point to having ended: either explicitly,
after a call to a dynamic deallocation function, or implicitly,
by virtue of an object with automatic storage duration having
gone out of scope.

To minimize false positives the initial logic is very simple
(even simplistic): the code only checks uses in basic blocks
dominated by the invalidating calls (either calls to
deallocation functions or GCC's clobbers).

A more thorough checker is certainly possible and I'd say most
desirable but will require a more sophisticated implementation
and a better predicate analyzer than is available, and so will
need to wait for GCC 13.

Martin
  

Comments

Martin Sebor Nov. 8, 2021, 10:41 p.m. UTC | #1
Ping for the two patches below:

-Wuse-after-free:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583044.html

and -Wdangling-pointer:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583045.html

On 11/1/21 4:15 PM, Martin Sebor wrote:
> This two-patch series adds support for the detection of uses
> of pointers invalidated as a result of the lifetime of
> the objects they point to having ended: either explicitly,
> after a call to a dynamic deallocation function, or implicitly,
> by virtue of an object with automatic storage duration having
> gone out of scope.
> 
> To minimize false positives the initial logic is very simple
> (even simplistic): the code only checks uses in basic blocks
> dominated by the invalidating calls (either calls to
> deallocation functions or GCC's clobbers).
> 
> A more thorough checker is certainly possible and I'd say most
> desirable but will require a more sophisticated implementation
> and a better predicate analyzer than is available, and so will
> need to wait for GCC 13.
> 
> Martin
  
Martin Sebor Nov. 15, 2021, 4:47 p.m. UTC | #2
Pinging the two patches below:

-Wuse-after-free:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583044.html

and -Wdangling-pointer:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583045.html

On 11/8/21 3:41 PM, Martin Sebor wrote:
> Ping for the two patches below:
> 
> -Wuse-after-free:
> https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583044.html
> 
> and -Wdangling-pointer:
> https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583045.html
> 
> On 11/1/21 4:15 PM, Martin Sebor wrote:
>> This two-patch series adds support for the detection of uses
>> of pointers invalidated as a result of the lifetime of
>> the objects they point to having ended: either explicitly,
>> after a call to a dynamic deallocation function, or implicitly,
>> by virtue of an object with automatic storage duration having
>> gone out of scope.
>>
>> To minimize false positives the initial logic is very simple
>> (even simplistic): the code only checks uses in basic blocks
>> dominated by the invalidating calls (either calls to
>> deallocation functions or GCC's clobbers).
>>
>> A more thorough checker is certainly possible and I'd say most
>> desirable but will require a more sophisticated implementation
>> and a better predicate analyzer than is available, and so will
>> need to wait for GCC 13.
>>
>> Martin
>
  
Martin Sebor Nov. 22, 2021, 4:41 p.m. UTC | #3
Pinging the two patches below:

-Wuse-after-free:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583044.html

and -Wdangling-pointer:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583045.html

On 11/15/21 9:47 AM, Martin Sebor wrote:
> Pinging the two patches below:
> 
> -Wuse-after-free:
> https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583044.html
> 
> and -Wdangling-pointer:
> https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583045.html
> 
> On 11/8/21 3:41 PM, Martin Sebor wrote:
>> Ping for the two patches below:
>>
>> -Wuse-after-free:
>> https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583044.html
>>
>> and -Wdangling-pointer:
>> https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583045.html
>>
>> On 11/1/21 4:15 PM, Martin Sebor wrote:
>>> This two-patch series adds support for the detection of uses
>>> of pointers invalidated as a result of the lifetime of
>>> the objects they point to having ended: either explicitly,
>>> after a call to a dynamic deallocation function, or implicitly,
>>> by virtue of an object with automatic storage duration having
>>> gone out of scope.
>>>
>>> To minimize false positives the initial logic is very simple
>>> (even simplistic): the code only checks uses in basic blocks
>>> dominated by the invalidating calls (either calls to
>>> deallocation functions or GCC's clobbers).
>>>
>>> A more thorough checker is certainly possible and I'd say most
>>> desirable but will require a more sophisticated implementation
>>> and a better predicate analyzer than is available, and so will
>>> need to wait for GCC 13.
>>>
>>> Martin
>>
>