[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1694631.1704881668@warthog.procyon.org.uk>
Date: Wed, 10 Jan 2024 10:14:28 +0000
From: David Howells <dhowells@...hat.com>
To: Pengfei Xu <pengfei.xu@...el.com>
Cc: dhowells@...hat.com, eadavis@...com,
Linus Torvalds <torvalds@...ux-foundation.org>,
Simon Horman <horms@...nel.org>,
Markus Suvanto <markus.suvanto@...il.com>,
Jeffrey E Altman <jaltman@...istor.com>,
"Marc
Dionne" <marc.dionne@...istor.com>,
Wang Lei <wang840925@...il.com>, "Jeff
Layton" <jlayton@...hat.com>,
Steve French <smfrench@...il.com>,
"Jarkko
Sakkinen" <jarkko@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
"Eric
Dumazet" <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
linux-afs@...ts.infradead.org, keyrings@...r.kernel.org,
linux-cifs@...r.kernel.org, linux-nfs@...r.kernel.org,
ceph-devel@...r.kernel.org, netdev@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
heng.su@...el.com
Subject: Re: [PATCH] keys, dns: Fix missing size check of V1 server-list header
Pengfei Xu <pengfei.xu@...el.com> wrote:
> Bisected info between v6.7-rc7(keyctl05 passed) and v6.7-rc8(keyctl05 failed)
> is in attached.
>
> keyctl05 failed in add_key with type "dns_resolver" syscall step tracked
> by strace:
> "
> [pid 863107] add_key("dns_resolver", "desc", "\0\0\1\377\0", 5, KEY_SPEC_SESSION_KEYRING <unfinished ...>
> [pid 863106] <... alarm resumed>) = 30
> [pid 863107] <... add_key resumed>) = -1 EINVAL (Invalid argument)
> "
It should fail as the payload is actually invalid. The payload specifies a
version 1 format - and that requires a 6-byte header. The bug the patched
fixes is that whilst there is a length check for the basic 3-byte header,
there was no length check for the extended v1 header.
> After increased the dns_res_payload to 7 bytes(6 bytes was still failed),
The following doesn't work for you?
echo -n -e '\0\0\01\xff\0\0' | keyctl padd dns_resolver desc @p
David
Powered by blists - more mailing lists