tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NULL pointer arithmetic issues



On 22.02.2020 19:39, Joerg Sonnenberger wrote:
> On Sat, Feb 22, 2020 at 05:25:42PM +0100, Kamil Rytarowski wrote:
>> When running the ATF tests under MKLIBCSANITIZER [1], there are many
>> NULL pointer arithmetic issues .
> 
> Which flags are the sanitizers using? Because I wouldn't be surprised if
> they just hit _PSLIST_VALIDATE_PTRS and friends.
> 
> Joerg
> 

This patch did not help. I double checked that this branch is really taken.

Index: sys/sys/pslist.h
===================================================================
RCS file: /cvsroot/src/sys/sys/pslist.h,v
retrieving revision 1.7
diff -u -r1.7 pslist.h
--- sys/sys/pslist.h	1 Dec 2019 15:28:19 -0000	1.7
+++ sys/sys/pslist.h	22 Feb 2020 20:51:42 -0000
@@ -32,6 +32,7 @@
 #ifndef	_SYS_PSLIST_H
 #define	_SYS_PSLIST_H

+#include <sys/cdefs.h>
 #include <sys/param.h>
 #include <sys/atomic.h>

@@ -288,7 +289,9 @@
  * Type-safe macros for convenience.
  */

-#if defined(__COVERITY__) || defined(__LGTM_BOT__)
+#if defined(__COVERITY__) || defined(__LGTM_BOT__) || \
+	__has_feature(undefined_behavior_sanitizer) || \
+	defined(__SANITIZE_UNDEFINED__)
 #define	_PSLIST_VALIDATE_PTRS(P, Q)		0
 #define	_PSLIST_VALIDATE_CONTAINER(P, T, F)	0
 #else

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index