All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Chris von Recklinghausen <crecklin@redhat.com>,
	keescook@chromium.org, labbott@redhat.com, pabeni@redhat.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	kernel-hardening@lists.openwall.com
Subject: Re: [PATCH v7] add param that allows bootline control of hardened usercopy
Date: Wed, 4 Jul 2018 15:43:39 +0200	[thread overview]
Message-ID: <b1bfe507-3dda-fccb-5355-26f6cce9fa6a@suse.cz> (raw)
In-Reply-To: <1530646988-25546-1-git-send-email-crecklin@redhat.com>

On 07/03/2018 09:43 PM, Chris von Recklinghausen wrote:

Subject: [PATCH v7] add param that allows bootline control of hardened
usercopy

s/bootline/boot time/ ?

> v1->v2:
> 	remove CONFIG_HUC_DEFAULT_OFF
> 	default is now enabled, boot param disables
> 	move check to __check_object_size so as to not break optimization of
> 		__builtin_constant_p()

Sorry for late and drive-by suggestion, but I think the change above is
kind of a waste because there's a function call overhead only to return
immediately.

Something like this should work and keep benefits of both the built-in
check and avoiding function call?

static __always_inline void check_object_size(const void *ptr, unsigned
long n, bool to_user)
{
        if (!__builtin_constant_p(n) &&
			static_branch_likely(&bypass_usercopy_checks))
                __check_object_size(ptr, n, to_user);
}

  parent reply	other threads:[~2018-07-04 13:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03 19:43 [PATCH v7] add param that allows bootline control of hardened usercopy Chris von Recklinghausen
2018-07-04  5:42 ` Kees Cook
2018-07-04 13:43 ` Vlastimil Babka [this message]
2018-07-04 16:52   ` Kees Cook
2018-07-04 17:47     ` Vlastimil Babka
2018-07-15  2:04       ` Kees Cook
2018-07-16 11:30         ` Vlastimil Babka

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=b1bfe507-3dda-fccb-5355-26f6cce9fa6a@suse.cz \
    --to=vbabka@suse.cz \
    --cc=crecklin@redhat.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pabeni@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.