Linux CAN drivers development
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Dmitry Antipov <dmantipov@yandex.ru>,
	Robin van der Gracht <robin@protonic.nl>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	linux-can@vger.kernel.org, netdev@vger.kernel.org,
	lvc-project@linuxtesting.org,
	syzbot+d4e8dc385d9258220c31@syzkaller.appspotmail.com
Subject: Re: [PATCH v2] can: fix skb reference counting in j1939_session_new()
Date: Fri, 29 Nov 2024 14:22:49 +0100	[thread overview]
Message-ID: <Z0nAKU7gJAdyY_KN@pengutronix.de> (raw)
In-Reply-To: <20241129-skinny-jackrabbit-of-relaxation-903ae4-mkl@pengutronix.de>

On Fri, Nov 29, 2024 at 02:05:11PM +0100, Marc Kleine-Budde wrote:
> On 29.11.2024 13:59:28, Marc Kleine-Budde wrote:
> > On 29.11.2024 13:55:56, Oleksij Rempel wrote:
> > > On Tue, Nov 05, 2024 at 12:48:23PM +0300, Dmitry Antipov wrote:
> > > > Since 'j1939_session_skb_queue()' do an extra 'skb_get()' for each
> > > > new skb, I assume that the same should be done for an initial one
> > > > in 'j1939_session_new()' just to avoid refcount underflow.
> > > > 
> > > > Reported-by: syzbot+d4e8dc385d9258220c31@syzkaller.appspotmail.com
> > > > Closes: https://syzkaller.appspot.com/bug?extid=d4e8dc385d9258220c31
> > > > Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
> > > > Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> > > 
> > > Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > > Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > 
> > Can you re-phrase the commit message. The "assume" is not appropriate :)
> 
> What about:
> 
> Since j1939_session_skb_queue() does an extra skb_get() for each new
> skb, do the same for the initial one in j1939_session_new() to avoid
> refcount underflow.

Sounds good. Thx!

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2024-11-29 13:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05  9:48 [PATCH v2] can: fix skb reference counting in j1939_session_new() Dmitry Antipov
2024-11-05 16:37 ` Jiri Pirko
2024-11-06  9:43   ` Oleksij Rempel
2024-11-06 11:05     ` Dmitry Antipov
2024-11-29 13:25     ` Oleksij Rempel
2024-11-06 11:03   ` Dmitry Antipov
2024-11-06 14:42     ` Jiri Pirko
2024-11-29 12:55 ` Oleksij Rempel
2024-11-29 12:59   ` Marc Kleine-Budde
2024-11-29 13:05     ` Marc Kleine-Budde
2024-11-29 13:22       ` Oleksij Rempel [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=Z0nAKU7gJAdyY_KN@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=dmantipov@yandex.ru \
    --cc=linux-can@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=robin@protonic.nl \
    --cc=socketcan@hartkopp.net \
    --cc=syzbot+d4e8dc385d9258220c31@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox