[PATCH] MSAN use-of-uninitialized-value inside ngx_regex_module_init

Maxim Dounin mdounin at mdounin.ru
Thu Apr 9 16:36:57 UTC 2020


Hello!

On Thu, Apr 09, 2020 at 06:07:50AM +0000, Maciej wrote:

> Hi Nginx devlist!
> 
> This patch fix use-of-uninitialized-value inside ngx_regex_module_init that come after Nginx is run with Clang MSAN
> 
> SUMMARY: MemorySanitizer: use-of-uninitialized-value /workspace/nginx/src/core/ngx_regex.c:343:13 in ngx_regex_module_init
> ==45705==WARNING: MemorySanitizer: use-of-uninitialized-value
>     #0 0x13cc4df in ngx_regex_module_init /workspace/nginx/src/core/ngx_regex.c:343:13
>     #1 0x126187b in ngx_init_modules /workspace/nginx/src/core/ngx_module.c:72:17
>     #2 0x122d30e in ngx_init_cycle /workspace/nginx/src/core/ngx_cycle.c:625:9
>     #3 0x10f2189 in main /workspace/nginx/src/core/nginx.c:291:13
>     #4 0x109d10a in _start /usr/src/lib/csu/amd64/crt1.c:76:7

Quoting MemorySanitizer docs 
(https://clang.llvm.org/docs/MemorySanitizer.html#handling-external-code):

: MemorySanitizer requires that all program code is instrumented. 
: This also includes any libraries that the program depends on, even 
: libc. Failing to achieve this may result in false reports. For the 
: same reason you may need to replace all inline assembly code that 
: writes to memory with a pure C/C++ code.

Have you tried compiling PCRE with memory sanitizer as well?

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list