From: Andrew Hendry <ahendry@tusc.com.au>
To: Herbert Poetzl <herbert@13thfloor.at>
Cc: eis@baty.hanse.de, linux-x25@vger.kernel.org,
Linux Kernel ML <linux-kernel@vger.kernel.org>
Subject: Re: x25_create initializing socket data twice ...
Date: Thu, 03 Mar 2005 14:20:54 +1100 [thread overview]
Message-ID: <1109820054.3014.146.camel@localhost.localdomain> (raw)
In-Reply-To: <20050303011413.GB11516@mail.13thfloor.at>
Hi Herbert,
On the same path sk_set_owner also gets called twice, I think this
causes double module use count when creating sockets. Module use count
need some attention all over x25.
Im not sure if the fix is as straightforward, the calls are:
sock_init_data(sock,sk) vs
sock_init_data(NULL,sk)
Andrew.
On Thu, 2005-03-03 at 12:14, Herbert Poetzl wrote:
> Hi Folks!
>
> x25_create() [net/x25/af_x25.c] is calling sock_init_data()
> twice ... once indirectly via x25_alloc_socket() and a
> second time directly via sock_init_data(sock, sk);
>
> while this might not look as critical as it seems, it can
> easily break stuff which assumes that sock_init_data()
> isn't called twice on the same socket ...
>
> maybe something like this might be appropriate?
>
> --- ./net/x25/af_x25.c.orig 2005-03-02 12:39:11 +0100
> +++ ./net/x25/af_x25.c 2005-03-03 02:12:11 +0100
> @@ -490,7 +490,6 @@ static int x25_create(struct socket *soc
>
> x25 = x25_sk(sk);
>
> - sock_init_data(sock, sk);
> sk_set_owner(sk, THIS_MODULE);
>
> x25_init_timers(sk);
>
>
> best,
> Herbert
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-x25" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2005-03-03 3:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-03 1:14 x25_create initializing socket data twice Herbert Poetzl
2005-03-03 3:20 ` Andrew Hendry [this message]
2005-03-03 19:37 ` Aristeu Sergio Rozanski Filho
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=1109820054.3014.146.camel@localhost.localdomain \
--to=ahendry@tusc.com.au \
--cc=eis@baty.hanse.de \
--cc=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-x25@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