mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vlad Yasevich <vyasevich@gmail.com>
To: "Geyslan Gregório Bem" <geyslan@gmail.com>
Cc: Neil Horman <nhorman@tuxdriver.com>,
	"David S. Miller" <davem@davemloft.net>,
	"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: net: sctp: possible dereference after freeing
Date: Sat, 19 Oct 2013 13:36:35 -0400	[thread overview]
Message-ID: <DA7AE80C-302D-4B9D-9C0E-BA980E25DFCE@gmail.com> (raw)
In-Reply-To: <CAGG-pUT=qrYxOQ5jeU=9KipYO+MAA9oJj=241YMqo54S7K+xsA@mail.gmail.com>



On Oct 19, 2013, at 7:49 AM, Geyslan Gregório Bem <geyslan@gmail.com> wrote:

> 2013/10/19 Geyslan Gregório Bem <geyslan@gmail.com>:
>> Hi maintainers,
>> 
>> I would like to know if these are catches:
>> 
>> /net/sctp/endpointola.c (281)
>> static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
>> {
>>    struct sock *sk;
>> ...
>>    kfree(ep);
>>    SCTP_DBG_OBJCNT_DEC(ep);
>> }
>> 
>> The 'ep' object counter is being decremented?! Is the kfree to be there indeed?
>> Let me know what was intended here.
>> 
>> Same here:
>> /net/sctp/endpointola.c (165)
>> static void sctp_transport_destroy_rcu(struct rcu_head *head)
>> {
>>    struct sctp_transport *transport;
>> ...
>>    kfree(transport);
>>    SCTP_DBG_OBJCNT_DEC(transport);
>> }
>> 
>> Regards,
>> 
>> Geyslan Gregório Bem
>> hackingbits.com
> 
> Oops. I got it. ;)
> 
> extern atomic_t sctp_dbg_objcnt_ep;
> http://lxr.free-electrons.com/source/include/net/sctp/sctp.h#L269
> extern atomic_t sctp_dbg_objcnt_transport;
> http://lxr.free-electrons.com/source/arch/x86/include/asm/atomic.h#L105
> 
> Cheers.

There is no reference here since the macro turns variable name to string using ## name.
So the order doesn't matter really.

-vlad 

      reply	other threads:[~2013-10-19 17:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-19 11:38 Geyslan Gregório Bem
2013-10-19 11:49 ` Geyslan Gregório Bem
2013-10-19 17:36   ` Vlad Yasevich [this message]

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=DA7AE80C-302D-4B9D-9C0E-BA980E25DFCE@gmail.com \
    --to=vyasevich@gmail.com \
    --cc=davem@davemloft.net \
    --cc=geyslan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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

all inboxes | Powered by JetHome®