# Re: \[PATCH v2 3/6\] KEYS: Prevent overflow of user-\>{qnkeys,qnbytes} in key\_alloc()

- From: Jarkko Sakkinen \<jarkko@kernel.org\>
- Date: 2026-10-19 20:53:17 
- List: linux-security-module
- Page: https://ratatoskr.run/linux-security-module/2026/10/17771978
- Thread: https://ratatoskr.run/keyrings/2026/10/17771254/t.md

```text
On Mon, Oct 19, 2026 at 12:23:32PM -0700, Eric Biggers wrote:
> On Mon, Oct 19, 2026 at 09:17:23PM +0300, Jarkko Sakkinen wrote:
> > Add the missing overflow checks for user->qnkeys and user->qnbytes
> > in order keep calculations within INT_MAX range, which is the
> > absolute maximum quota.
> > 
> > Cc: <redacted>
> > Assisted-by: LLM
> > Fixes: 7e047ef5fe2d ("[PATCH] keys: sort out key quota system")
> > Reviewed-by: David Howells <dhowells@redhat.com>
> > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
> 
> Don't keyctl_chown_key() and key_payload_reserve() need similar fixes?

Thanks, I'll investigate.

Unless any specific reason, I would not hold merging this series. I have
written down a follow-up backlog i.e., post-tasks once this series is
merged.

> 
> - Eric

Br, Jarkko
```
