diff options
author | Emese Revfy <re.emese@gmail.com> | 2016-07-26 22:41:43 +0200 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-02-06 13:26:31 -0800 |
commit | e89c98504d8962186caa82a7f613a6d0b24cb917 (patch) | |
tree | 6174c271746c30108b5e63c113cb1221bb1d168c /arch/powerpc/include/asm | |
parent | dc259d15102b74f87f23166491aeb7b99ecf4da1 (diff) |
initify: Mark functions with the __nocapture attribute
The nocapture gcc attribute can be on functions only. The attribute
takes zero or more signed integer constants as parameters that specify
the function parameters to initify when the passed arguments are of const
char* type.
A negative attribute parameter value means that the corresponding function
parameter is returned by the function and the passed argument will only
be initified if the data flow of the returned value is not captured in
the caller.
If no values are passed to the attribute then all function parameters are
treated as nocapture.
If the marked parameter is a vararg then the plugin initifies all vararg
arguments.
Signed-off-by: Emese Revfy <re.emese@gmail.com>
[kees: updated markings, thanks to Arnd]
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/string.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/string.h b/arch/powerpc/include/asm/string.h index da3cdffca440..ba08cf461ca2 100644 --- a/arch/powerpc/include/asm/string.h +++ b/arch/powerpc/include/asm/string.h @@ -11,16 +11,17 @@ #define __HAVE_ARCH_MEMCMP #define __HAVE_ARCH_MEMCHR -extern char * strcpy(char *,const char *); -extern char * strncpy(char *,const char *, __kernel_size_t); -extern __kernel_size_t strlen(const char *); -extern int strcmp(const char *,const char *); -extern int strncmp(const char *, const char *, __kernel_size_t); -extern char * strcat(char *, const char *); +extern char * strcpy(char *,const char *) __nocapture(2); +extern char * strncpy(char *,const char *, __kernel_size_t) __nocapture(2); +extern __kernel_size_t strlen(const char *) __nocapture(1); +extern int strcmp(const char *,const char *) __nocapture(); +extern int +strncmp(const char *, const char *, __kernel_size_t) __nocapture(1, 2); +extern char * strcat(char *, const char *) __nocapture(2); extern void * memset(void *,int,__kernel_size_t); -extern void * memcpy(void *,const void *,__kernel_size_t); -extern void * memmove(void *,const void *,__kernel_size_t); -extern int memcmp(const void *,const void *,__kernel_size_t); +extern void * memcpy(void *,const void *,__kernel_size_t) __nocapture(2); +extern void * memmove(void *,const void *,__kernel_size_t) __nocapture(2); +extern int memcmp(const void *,const void *,__kernel_size_t) __nocapture(1, 2); extern void * memchr(const void *,int,__kernel_size_t); #endif /* __KERNEL__ */ |