Bug 9128
Summary: | PF_KEY SADB_GET messages return SADB_DUMP from the kernel | ||
---|---|---|---|
Product: | Networking | Reporter: | Charles Hardin (chardin) |
Component: | Other | Assignee: | Arnaldo Carvalho de Melo (acme) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | akpm |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.18 | Subsystem: | |
Regression: | --- | Bisected commit-id: |
Description
Charles Hardin
2007-10-05 09:01:49 UTC
Reply-To: akpm@linux-foundation.org (Please reply via emailed reply-to-all, not via the bugzilla web interface) On Fri, 5 Oct 2007 09:01:50 -0700 (PDT) bugme-daemon@bugzilla.kernel.org wrote: > http://bugzilla.kernel.org/show_bug.cgi?id=9128 > > Summary: PF_KEY SADB_GET messages return SADB_DUMP from the > kernel > Product: Networking > Version: 2.5 > KernelVersion: 2.6.18 > Platform: All > OS/Version: Linux > Tree: Mainline > Status: NEW > Severity: normal > Priority: P1 > Component: Other > AssignedTo: acme@ghostprotocols.net > ReportedBy: chardin@2wire.com > > > Most recent kernel where this bug did not occur: > Distribution: Centos 5 > Hardware Environment: Dell 490 > Software Environment: Centos 5 > Problem Description: > Sending an SADB_GET to the PF_KEY socket returns an SADB_DUMP in the out_hdr > > Steps to reproduce: > Send an SADB_GET to the PF_KEY socket and dump the returned packet > > > This patch should fix the problem > diff --git a/net/key/af_key.c b/net/key/af_key.c > index 5502df1..7a5e993 100644 > --- a/net/key/af_key.c > +++ b/net/key/af_key.c > @@ -1546,7 +1546,7 @@ static int pfkey_get(struct sock *sk, struct sk_buff > *skb, > > out_hdr = (struct sadb_msg *) out_skb->data; > out_hdr->sadb_msg_version = hdr->sadb_msg_version; > - out_hdr->sadb_msg_type = SADB_DUMP; > + out_hdr->sadb_msg_type = SADB_GET; > out_hdr->sadb_msg_satype = pfkey_proto2satype(proto); > out_hdr->sadb_msg_errno = 0; > out_hdr->sadb_msg_reserved = 0; > Please submit kernel patches via email, as per http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt. Net patches should be sent to netdev@vger.kernel.org and perhaps linux-kernel@vger.kernel.org. But whatever - I can convert this patch into a suitable one and send it in to David if people think it is good? On Fri, Oct 05, 2007 at 10:37:55AM -0700, Andrew Morton wrote:
>
> But whatever - I can convert this patch into a suitable one and send it in
> to David if people think it is good?
Looks good to me.
Thanks,
Linus's current tree has out_hdr->sadb_msg_type = SADB_GETSPI; there which I assume has fixed this issue, so I'll close the report, thanks. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=net/key/af_key.c;hb=HEAD Still shows the pfkey_get function setting PFKEY_DUMP... Second, PFKEY_GETSPI is not PFKEY_GET - it really needs to be PFKEY_GET so dispatch functions on the PF_KEY socket can do the right thing when the send messages down to the kernel and are expecting a match to be returned per the RFC... (In reply to comment #4) > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=net/key/af_key.c;hb=HEAD > > Still shows the pfkey_get function setting PFKEY_DUMP... > > Second, PFKEY_GETSPI is not PFKEY_GET - it really needs to be PFKEY_GET so > dispatch functions on the PF_KEY socket can do the right thing when the send > messages down to the kernel and are expecting a match to be returned per the > RFC... > Obviously those should have been SADB_* as appropriate - long day... Please send a patch as per http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt to netdev@vger.kernel.org and akpm@linux-foundation.org, thanks. |