All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jeremy@azazel.net
Cc: linux-x25@vger.kernel.org, netdev@vger.kernel.org,
	syzbot+afb980676c836b4a0afa@syzkaller.appspotmail.com
Subject: Re: [PATCH net] lapb: fixed leak of control-blocks.
Date: Sun, 16 Jun 2019 20:44:57 -0700 (PDT)	[thread overview]
Message-ID: <20190616.204457.1507896436828804410.davem@davemloft.net> (raw)
In-Reply-To: <20190616155437.25299-1-jeremy@azazel.net>

From: Jeremy Sowden <jeremy@azazel.net>
Date: Sun, 16 Jun 2019 16:54:37 +0100

> lapb_register calls lapb_create_cb, which initializes the control-
> block's ref-count to one, and __lapb_insert_cb, which increments it when
> adding the new block to the list of blocks.
> 
> lapb_unregister calls __lapb_remove_cb, which decrements the ref-count
> when removing control-block from the list of blocks, and calls lapb_put
> itself to decrement the ref-count before returning.
> 
> However, lapb_unregister also calls __lapb_devtostruct to look up the
> right control-block for the given net_device, and __lapb_devtostruct
> also bumps the ref-count, which means that when lapb_unregister returns
> the ref-count is still 1 and the control-block is leaked.
> 
> Call lapb_put after __lapb_devtostruct to fix leak.
> 
> Reported-by: syzbot+afb980676c836b4a0afa@syzkaller.appspotmail.com
> Signed-off-by: Jeremy Sowden <jeremy@azazel.net>

Applied and queued up for -stable.

      reply	other threads:[~2019-06-17  3:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21 13:43 memory leak in lapb_register syzbot
2019-06-16 15:54 ` [PATCH net] lapb: fixed leak of control-blocks Jeremy Sowden
2019-06-17  3:44   ` David Miller [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=20190616.204457.1507896436828804410.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jeremy@azazel.net \
    --cc=linux-x25@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+afb980676c836b4a0afa@syzkaller.appspotmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.