All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: laurent vaudoit <laurent.vaudoit@gmail.com>, linux-can@vger.kernel.org
Subject: Re: Raw can socket close and disabling filters
Date: Sat, 23 Apr 2016 15:33:32 +0200	[thread overview]
Message-ID: <571B79AC.8000800@hartkopp.net> (raw)
In-Reply-To: <loom.20160422T133332-34@post.gmane.org>

Hi Laurent,

On 04/22/2016 01:39 PM, laurent vaudoit wrote:

> i'm using a 3.10 kernel with rtpatch applied, with raw can features.
> Running some debug in the release function, i've seen something weird (for
> me).
>
> In the function, we get the socket informations
> and then we unregister the notifier.
>
> After this, we test if the socket is bound and which is the ifindex.
>
> But when the unregister function is called, there is a call to the notifier
> with the event NETDEV_UNREGISTER, who leads to clear the socket inforamtions
> like bound and ifindex.
>
> So in the release function we can never enter in the code specific to a
> device.

The relevant removal is protected by lock_sock().

So when the notifier runs with NETDEV_UNREGISTER it will remove the 
filters & bind status.

In this case the block in raw_release() won't have anything to do to 
release the filters and the bind state, right?

Looks double work - but I wonder why we can rely on a notifier call when 
we call unregister_netdevice_notifier() ??

Regards,
Oliver


  reply	other threads:[~2016-04-23 13:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 11:39 Raw can socket close and disabling filters laurent vaudoit
2016-04-23 13:33 ` Oliver Hartkopp [this message]
2016-04-25  7:19   ` laurent vaudoit
2016-04-25  7:54     ` Oliver Hartkopp
2016-04-25  7:57       ` laurent vaudoit

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=571B79AC.8000800@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=laurent.vaudoit@gmail.com \
    --cc=linux-can@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 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.