From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: dccp@vger.kernel.org
Subject: Re: [PATCH] DCCP: Initialize ireq6->pktopts before used it
Date: Tue, 10 Jun 2008 10:08:32 +0000 [thread overview]
Message-ID: <484E52A0.2000605@cn.fujitsu.com> (raw)
In-Reply-To: <484E42BE.9020408@cn.fujitsu.com>
Gerrit Renker wrote:
>> I think I should add dccp_v6_reqsk_init() do to the init work since
>> dccp_reqsk_init may be fail too.
>>
>>
> I think this is not necessary, it can be done like this
>
>
> req = inet6_reqsk_alloc(&dccp6_request_sock_ops);
> if (req = NULL)
> goto drop;
>
> ireq6 = inet6_rsk(req);
> ireq6->pktopts = NULL;
>
> if (dccp_reqsk_init(req, dccp_sk(sk), skb))
> goto drop_and_free;
>
> This is since dccp_reqsk_init() only initialises the inet_sk and dccp_sk
> parts, and does not do IPv6-specific initialisation.
>
> Irrespective of the oops, this is an error and will be fixed in the test
> tree today.
>
> With regard to the oops, the log pointed to the dccp_v6_reqsk_destructor
> and so it would make sense, since the pktopts was not initialised to NULL
> and since kfree_skb() calls skb->destructor().
>
> As before, thanks a lot for testing this code and for reporting this.
>
>
Hi Gerrit:
IPv4 may have the same problem althought it is hard to test it.
[PATCH] DCCP: Initialize inet_rsk(req)->opt before used it
dccp_reqsk_init() does not initialises the inet_rsk(req)->opt which will
be used in dccp_v4_reqsk_destructor().
This patch fixed this problem.
--- a/net/dccp/minisocks.c 2008-05-29 22:27:56.000000000 -0400
+++ b/net/dccp/minisocks.c 2008-06-05 06:36:59.000000000 -0400
@@ -266,6 +266,7 @@ int dccp_reqsk_init(struct request_sock
inet_rsk(req)->rmt_port = dccp_hdr(skb)->dccph_sport;
inet_rsk(req)->acked = 0;
+ inet_rsk(req)->opt = NULL;
dreq->dreq_timestamp_echo = 0;
/* inherit feature negotiation options from listening socket */
--- a/net/dccp/ipv4.c 2008-05-29 22:27:56.000000000 -0400
+++ b/net/dccp/ipv4.c 2008-06-05 06:41:48.000000000 -0400
@@ -607,7 +607,6 @@ int dccp_v4_conn_request(struct sock *sk
ireq = inet_rsk(req);
ireq->loc_addr = ip_hdr(skb)->daddr;
ireq->rmt_addr = ip_hdr(skb)->saddr;
- ireq->opt = NULL;
/*
* Step 3: Process LISTEN state
next prev parent reply other threads:[~2008-06-10 10:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 9:00 [PATCH] DCCP: Initialize ireq6->pktopts before used it Wei Yongjun
2008-06-10 9:05 ` Wei Yongjun
2008-06-10 9:50 ` Gerrit Renker
2008-06-10 9:59 ` Wei Yongjun
2008-06-10 10:07 ` Gerrit Renker
2008-06-10 10:08 ` Wei Yongjun [this message]
2008-06-10 10:14 ` Wei Yongjun
2008-06-10 10:34 ` Gerrit Renker
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=484E52A0.2000605@cn.fujitsu.com \
--to=yjwei@cn.fujitsu.com \
--cc=dccp@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox