linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com,
	arjan@linux.intel.com, linux@roeck-us.net,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] x86: override __compiletime_object_size()
Date: Wed, 27 Nov 2013 15:03:32 +0100	[thread overview]
Message-ID: <20131127140332.GC24403@gmail.com> (raw)
In-Reply-To: <529385AF0200007800106C84@nat28.tlf.novell.com>


* Jan Beulich <JBeulich@suse.com> wrote:

> As discussed in the context of commits 3df7b41a ("x86: Unify
> copy_from_user() size checking") and 7a3d9b0f ("x86: Unify
> copy_to_user() and add size checking to it"), we want to leverage
> __builtin_object_size() also on newer gcc versions, but with other
> architectures still using another model of copy_*_user() verification
> we can't replace the global definition. Do it in the (only) header
> needing the construct for now.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Cc: Arjan van de Ven <arjan@linux.intel.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> ---
>  arch/x86/include/asm/uaccess.h |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> --- 3.13-rc1/arch/x86/include/asm/uaccess.h
> +++ 3.13-rc1-x86-compiletime-object-size/arch/x86/include/asm/uaccess.h
> @@ -584,6 +584,12 @@ __copy_from_user_overflow(int size, unsi
>  
>  #endif
>  
> +/* linux/compiler-gcc4.h restricts this to gcc < 4.6, which doesn't suit us. */
> +#if defined(__GNUC__) && GCC_VERSION >= 40100
> +# undef __compiletime_object_size
> +# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
> +#endif
> +

Would be nice to have a more verbose changelog that explains what 
benefits this brings us.

Thanks,

	Ingo

  reply	other threads:[~2013-11-27 14:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21  8:43 [PATCH 1/2] x86: unify copy_from_user() size checking Jan Beulich
2013-10-26 10:31 ` Ingo Molnar
2013-10-26 16:05   ` Guenter Roeck
2013-10-28  7:23   ` Jan Beulich
2013-10-28 10:55     ` Ingo Molnar
2013-10-29  9:43   ` Jan Beulich
2013-10-29  9:54     ` Ingo Molnar
2013-10-29 10:08       ` Jan Beulich
2013-10-29 10:12         ` Ingo Molnar
2013-11-25 16:15           ` [PATCH] x86: override __compiletime_object_size() Jan Beulich
2013-11-27 14:03             ` Ingo Molnar [this message]
2013-11-27 14:20               ` Jan Beulich
2013-11-27 14:36                 ` Ingo Molnar
2013-10-26 13:51 ` [tip:x86/asm] x86: Unify copy_from_user() size checking tip-bot for Jan Beulich

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=20131127140332.GC24403@gmail.com \
    --to=mingo@kernel.org \
    --cc=JBeulich@suse.com \
    --cc=arjan@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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).