netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pengfei Xu <pengfei.xu@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: <eadavis@qq.com>, Linus Torvalds <torvalds@linux-foundation.org>,
	"Simon Horman" <horms@kernel.org>,
	Markus Suvanto <markus.suvanto@gmail.com>,
	"Jeffrey E Altman" <jaltman@auristor.com>,
	Marc Dionne <marc.dionne@auristor.com>,
	"Wang Lei" <wang840925@gmail.com>,
	Jeff Layton <jlayton@redhat.com>,
	Steve French <smfrench@gmail.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	<linux-afs@lists.infradead.org>, <keyrings@vger.kernel.org>,
	<linux-cifs@vger.kernel.org>, <linux-nfs@vger.kernel.org>,
	<ceph-devel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<heng.su@intel.com>
Subject: Re: [PATCH] keys, dns: Fix missing size check of V1 server-list header
Date: Wed, 10 Jan 2024 19:06:24 +0800	[thread overview]
Message-ID: <ZZ56MMinZLrmF9Z+@xpf.sh.intel.com> (raw)
In-Reply-To: <1694631.1704881668@warthog.procyon.org.uk>

On 2024-01-10 at 10:14:28 +0000, David Howells wrote:
> Pengfei Xu <pengfei.xu@intel.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.

Thanks for description!

> 
> > 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

I tried as follows, 6 bytes failed and 7 bytes passed:
"
# echo -n -e '\0\0\01\xff\0\0' | keyctl padd dns_resolver desc @p
add_key: Invalid argument
# echo -n -e '\0\0\01\xff\0\0\0' | keyctl padd dns_resolver desc @p
74678921
# uname -r
6.7.0-rc8
"

Thanks!

> 
> David
> 

  reply	other threads:[~2024-01-10 11:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 15:30 [GIT PULL] afs, dns: Fix dynamic root interaction with negative DNS David Howells
2023-12-21 18:19 ` pr-tracker-bot
2023-12-23 17:28 ` Simon Horman
2023-12-23 19:14   ` Linus Torvalds
2023-12-24  0:02     ` [PATCH] keys, dns: Fix missing size check of V1 server-list header David Howells
2023-12-24 10:22       ` Simon Horman
2024-01-10  4:40       ` Pengfei Xu
2024-01-10  5:19         ` Edward Adam Davis
2024-01-10  5:47           ` Pengfei Xu
2024-01-10  5:27         ` Pengfei Xu
2024-01-10 10:14         ` David Howells
2024-01-10 11:06           ` Pengfei Xu [this message]
2024-01-10 17:23             ` David Howells
2024-01-10 18:52               ` Linus Torvalds

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=ZZ56MMinZLrmF9Z+@xpf.sh.intel.com \
    --to=pengfei.xu@intel.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=eadavis@qq.com \
    --cc=edumazet@google.com \
    --cc=heng.su@intel.com \
    --cc=horms@kernel.org \
    --cc=jaltman@auristor.com \
    --cc=jarkko@kernel.org \
    --cc=jlayton@redhat.com \
    --cc=keyrings@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=markus.suvanto@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=smfrench@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=wang840925@gmail.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 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).