linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/boot/string: Add missing function declarations
@ 2021-11-19 17:53 Kees Cook
  2021-12-09 23:37 ` Kees Cook
  2021-12-10 18:57 ` [tip: x86/cleanups] x86/boot/string: Add missing function prototypes tip-bot2 for Kees Cook
  0 siblings, 2 replies; 4+ messages in thread
From: Kees Cook @ 2021-11-19 17:53 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Kees Cook, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, linux-kernel, x86, linux-hardening

Silence "missing function declaration" warnings from string.h when
building under W=1.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/x86/boot/string.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/boot/string.h b/arch/x86/boot/string.h
index a232da487cd2..e5d2c6b8c2f1 100644
--- a/arch/x86/boot/string.h
+++ b/arch/x86/boot/string.h
@@ -8,8 +8,10 @@
 #undef memcmp
 
 void *memcpy(void *dst, const void *src, size_t len);
+void *memmove(void *dst, const void *src, size_t len);
 void *memset(void *dst, int c, size_t len);
 int memcmp(const void *s1, const void *s2, size_t len);
+int bcmp(const void *s1, const void *s2, size_t len);
 
 /* Access builtin version by default. */
 #define memcpy(d,s,l) __builtin_memcpy(d,s,l)
@@ -25,6 +27,7 @@ extern size_t strnlen(const char *s, size_t maxlen);
 extern unsigned int atou(const char *s);
 extern unsigned long long simple_strtoull(const char *cp, char **endp,
 					  unsigned int base);
+long simple_strtol(const char *cp, char **endp, unsigned int base);
 
 int kstrtoull(const char *s, unsigned int base, unsigned long long *res);
 int boot_kstrtoul(const char *s, unsigned int base, unsigned long *res);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86/boot/string: Add missing function declarations
  2021-11-19 17:53 [PATCH] x86/boot/string: Add missing function declarations Kees Cook
@ 2021-12-09 23:37 ` Kees Cook
  2021-12-09 23:47   ` Joe Perches
  2021-12-10 18:57 ` [tip: x86/cleanups] x86/boot/string: Add missing function prototypes tip-bot2 for Kees Cook
  1 sibling, 1 reply; 4+ messages in thread
From: Kees Cook @ 2021-12-09 23:37 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	linux-kernel, x86, linux-hardening

On Fri, Nov 19, 2021 at 09:53:25AM -0800, Kees Cook wrote:
> Silence "missing function declaration" warnings from string.h when
> building under W=1.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---

Hi, just a quick ping on this little fix.

Thanks!

-Kees

>  arch/x86/boot/string.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/x86/boot/string.h b/arch/x86/boot/string.h
> index a232da487cd2..e5d2c6b8c2f1 100644
> --- a/arch/x86/boot/string.h
> +++ b/arch/x86/boot/string.h
> @@ -8,8 +8,10 @@
>  #undef memcmp
>  
>  void *memcpy(void *dst, const void *src, size_t len);
> +void *memmove(void *dst, const void *src, size_t len);
>  void *memset(void *dst, int c, size_t len);
>  int memcmp(const void *s1, const void *s2, size_t len);
> +int bcmp(const void *s1, const void *s2, size_t len);
>  
>  /* Access builtin version by default. */
>  #define memcpy(d,s,l) __builtin_memcpy(d,s,l)
> @@ -25,6 +27,7 @@ extern size_t strnlen(const char *s, size_t maxlen);
>  extern unsigned int atou(const char *s);
>  extern unsigned long long simple_strtoull(const char *cp, char **endp,
>  					  unsigned int base);
> +long simple_strtol(const char *cp, char **endp, unsigned int base);
>  
>  int kstrtoull(const char *s, unsigned int base, unsigned long long *res);
>  int boot_kstrtoul(const char *s, unsigned int base, unsigned long *res);
> -- 
> 2.30.2
> 

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86/boot/string: Add missing function declarations
  2021-12-09 23:37 ` Kees Cook
@ 2021-12-09 23:47   ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2021-12-09 23:47 UTC (permalink / raw)
  To: Kees Cook, Thomas Gleixner
  Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	linux-kernel, x86, linux-hardening

On Thu, 2021-12-09 at 15:37 -0800, Kees Cook wrote:
> On Fri, Nov 19, 2021 at 09:53:25AM -0800, Kees Cook wrote:
> > Silence "missing function declaration" warnings from string.h when
> > building under W=1.
> > 
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> > ---
> 
> Hi, just a quick ping on this little fix.
[]
> > diff --git a/arch/x86/boot/string.h b/arch/x86/boot/string.h
[]
> > @@ -8,8 +8,10 @@
> >  #undef memcmp
> >  
> >  void *memcpy(void *dst, const void *src, size_t len);
> > +void *memmove(void *dst, const void *src, size_t len);
> >  void *memset(void *dst, int c, size_t len);
> >  int memcmp(const void *s1, const void *s2, size_t len);
> > +int bcmp(const void *s1, const void *s2, size_t len);

Unrelated trivia:

Is bcmp still used anywhere in the kernel?

confdata.c is a user-mode program right?

$ git grep -w bcmp
arch/x86/boot/string.c: * Clang may lower `memcmp == 0` to `bcmp == 0`.
arch/x86/boot/string.c:int bcmp(const void *s1, const void *s2, size_t len)
include/linux/string.h:extern int bcmp(const void *,const void *,__kernel_size_t);
lib/Makefile:# Prevent the compiler from calling builtins like memcmp() or bcmp() from this
lib/string.c: * bcmp - returns 0 if and only if the buffers have identical contents.
lib/string.c: * meaning, and architectures may implement their own more efficient bcmp(). So
lib/string.c:int bcmp(const void *a, const void *b, size_t len)
lib/string.c:EXPORT_SYMBOL(bcmp);
scripts/kconfig/confdata.c:     if (bcmp(map1, map2, st1.st_size))



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip: x86/cleanups] x86/boot/string: Add missing function prototypes
  2021-11-19 17:53 [PATCH] x86/boot/string: Add missing function declarations Kees Cook
  2021-12-09 23:37 ` Kees Cook
@ 2021-12-10 18:57 ` tip-bot2 for Kees Cook
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Kees Cook @ 2021-12-10 18:57 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Kees Cook, Borislav Petkov, x86, linux-kernel

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     bc7aaf52f963674690510e6c1f3710cd0394b25e
Gitweb:        https://git.kernel.org/tip/bc7aaf52f963674690510e6c1f3710cd0394b25e
Author:        Kees Cook <keescook@chromium.org>
AuthorDate:    Fri, 19 Nov 2021 09:53:25 -08:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Fri, 10 Dec 2021 19:49:06 +01:00

x86/boot/string: Add missing function prototypes

Silence "warning: no previous prototype for ... [-Wmissing-prototypes]"
warnings from string.h when building under W=1.

 [ bp: Clarify commit message. ]

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20211119175325.3668419-1-keescook@chromium.org
---
 arch/x86/boot/string.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/boot/string.h b/arch/x86/boot/string.h
index a232da4..e5d2c6b 100644
--- a/arch/x86/boot/string.h
+++ b/arch/x86/boot/string.h
@@ -8,8 +8,10 @@
 #undef memcmp
 
 void *memcpy(void *dst, const void *src, size_t len);
+void *memmove(void *dst, const void *src, size_t len);
 void *memset(void *dst, int c, size_t len);
 int memcmp(const void *s1, const void *s2, size_t len);
+int bcmp(const void *s1, const void *s2, size_t len);
 
 /* Access builtin version by default. */
 #define memcpy(d,s,l) __builtin_memcpy(d,s,l)
@@ -25,6 +27,7 @@ extern size_t strnlen(const char *s, size_t maxlen);
 extern unsigned int atou(const char *s);
 extern unsigned long long simple_strtoull(const char *cp, char **endp,
 					  unsigned int base);
+long simple_strtol(const char *cp, char **endp, unsigned int base);
 
 int kstrtoull(const char *s, unsigned int base, unsigned long long *res);
 int boot_kstrtoul(const char *s, unsigned int base, unsigned long *res);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-10 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19 17:53 [PATCH] x86/boot/string: Add missing function declarations Kees Cook
2021-12-09 23:37 ` Kees Cook
2021-12-09 23:47   ` Joe Perches
2021-12-10 18:57 ` [tip: x86/cleanups] x86/boot/string: Add missing function prototypes tip-bot2 for Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).