You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/runtime/src/libraries/Native/Unix/System.Native/pal_io.c(924,64): error G8742B11B: use of function '__builtin_alloca' is discouraged; there is no way to check for failure but failure may still occur, resulting in a possibly exploitable security vulnerability [-Werror,-Walloca] [/runtime/src/libraries/Native/build-native.proj]
struct pollfd* pollfds = (struct pollfd*)(useStackBuffer ? alloca(bufferSize) : malloc(bufferSize));
^
/usr/include/alloca.h:35:23: note: expanded from macro 'alloca'
# define alloca(size) __builtin_alloca (size)
^
1 error generated.
Should we disable this warning? Should we fix some uses? I know that coreclr has some extra checks (via AllocaCheck) and I dont think clang 10 flags those.
Activity
jkotas commentedon Mar 17, 2020
This specific case can be fixed by switching to a fixed size stack allocated buffer.
Is this the only use in libraries\native? I think it would be fine to shoot for no alloca under libraries\native.
omajid commentedon Mar 18, 2020
Okay, I will open a PR for that.
I think so. This is the only use of
alloca()that clang 10 errors out on.Fix src/libraries to build on clang 10 (#33734)