linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Kees Cook <keescook@chromium.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH] x86/boot/string: Add missing function declarations
Date: Thu, 09 Dec 2021 15:47:49 -0800	[thread overview]
Message-ID: <e825dec01f6ffd19fd5487f04280583c673b7f1d.camel@perches.com> (raw)
In-Reply-To: <202112091536.2DDF0DF@keescook>

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))



  reply	other threads:[~2021-12-09 23:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-12-10 18:57 ` [tip: x86/cleanups] x86/boot/string: Add missing function prototypes tip-bot2 for Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e825dec01f6ffd19fd5487f04280583c673b7f1d.camel@perches.com \
    --to=joe@perches.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).