All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: keyrings@vger.kernel.org
Subject: Re: [PATCH v3] KEYS: reaching the keys quotas correctly
Date: Tue, 03 Mar 2020 04:17:32 +0000	[thread overview]
Message-ID: <20200303041732.GA14653@sol.localdomain> (raw)
In-Reply-To: <1582864911-30823-1-git-send-email-xuyang2018.jy@cn.fujitsu.com>

On Fri, Feb 28, 2020 at 12:41:51PM +0800, Yang Xu wrote:
>
> Subject: Re: [PATCH v3] KEYS: reaching the keys quotas correctly

The subject should be in imperative tense, like
"KEYS: reach the keys quotas correctly"

> Currently, when we add a new user key, the calltrace as below:
> 
> add_key()
>   key_create_or_update()
>     key_alloc()
>     __key_instantiate_and_link
>       generic_key_instantiate
>         key_payload_reserve
>           ......
> 
> Since commit a08bf91ce28e ("KEYS: allow reaching the keys quotas exactly"),
> we can reach max bytes/keys in key_alloc, but we forget to remove this
> limit when we reserver space for payload in key_payload_reserve. So we
> can only reach max keys but not max bytes when having delta between plen
> and type->def_datalen. Remove this limit when instantiating the key, so we
> can keep consistent with key_alloc.
> 
> Also, fix the similar problem in keyctl_chown_key().
> 
> Fixes: 0b77f5bfb45c ("keys: make the keyring quotas controllable through /proc/sys")
> Fixes: a08bf91ce28e ("KEYS: allow reaching the keys quotas exactly")
> Cc: Eric Biggers <ebiggers@google.com>
> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>

Otherwise this looks fine.  Thanks!

Reviewed-by: Eric Biggers <ebiggers@google.com>

- Eric

  parent reply	other threads:[~2020-03-03  4:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 10:25 [PATCH] KEYS: reaching the keys quotas correctly when instanttiating Yang Xu
2020-02-27 16:26 ` Jarkko Sakkinen
2020-02-28  2:32   ` [PATCH v2] KEYS: reaching the keys quotas(max_bytes) correctly Yang Xu
2020-02-28  3:30     ` Eric Biggers
2020-02-28  4:41       ` [PATCH v3] KEYS: reaching the keys quotas correctly Yang Xu
2020-03-02 12:52         ` Jarkko Sakkinen
2020-03-03  4:17         ` Eric Biggers [this message]
2020-03-03  4:33         ` Yang Xu
2020-03-03 20:18         ` Jarkko Sakkinen
2020-03-19 15:08         ` David Howells
2020-03-19 21:15         ` Jarkko Sakkinen
2020-03-19 21:30         ` David Howells
2020-03-20  1:45         ` Jarkko Sakkinen
2020-03-20  8:59         ` David Howells
2020-02-28  3:37     ` [PATCH v2] KEYS: reaching the keys quotas(max_bytes) correctly Yang Xu
2020-03-02 12:51     ` Jarkko Sakkinen

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=20200303041732.GA14653@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=keyrings@vger.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 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.