diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-18 09:08:05 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-18 09:08:05 +0100 |
| commit | d9e3d899bc7a852d44b3305ed49799fbf090e756 (patch) | |
| tree | f3a75cb5f60be908a4384bd9e7add08486d7d338 /include/linux/string.h | |
| parent | cc2e60dfa6ba4ff2c054bca932b9afc8702a2f9a (diff) | |
| parent | 1291a0d5049dbc06baaaf66a9ff3f53db493b19b (diff) | |
Merge 4.15-rc4 into usb-next
We want the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/string.h')
| -rw-r--r-- | include/linux/string.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index 410ecf17de3c..cfd83eb2f926 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -259,7 +259,10 @@ __FORTIFY_INLINE __kernel_size_t strlen(const char *p) { __kernel_size_t ret; size_t p_size = __builtin_object_size(p, 0); - if (p_size == (size_t)-1) + + /* Work around gcc excess stack consumption issue */ + if (p_size == (size_t)-1 || + (__builtin_constant_p(p[p_size - 1]) && p[p_size - 1] == '\0')) return __builtin_strlen(p); ret = strnlen(p, p_size); if (p_size <= ret) |
