All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sjur BRENDELAND <sjur.brandeland@stericsson.com>
To: Alan <alan@lxorguk.ukuu.org.uk>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: CAIF device
Date: Mon, 5 Apr 2010 13:19:14 +0200	[thread overview]
Message-ID: <81C3A93C17462B4BBD7E272753C105791696B5DCF0@EXDCVYMBSTM005.EQ1STM.local> (raw)
In-Reply-To: <20100401160916.2a2574f4@lxorguk.ukuu.org.uk>

Hi Alan.

Alan wrote:
> I was reading through the CAIF code and I noticed a couple of bugs
> 
> Doesn't check there is a write method so set on a read only
> device it's not good news (doubly so as there seem to be no
> permission checks ?) plus no permissions checks and also the
> following which looks unsafe
> 
>         dev_close(ser->dev);
>         unregister_netdevice(ser->dev);
>         list_del(&ser->node);
>         debugfs_deinit(ser);
> 
> Now ser is the netdev private data so what stops it going away when
> unregister_netdev is called ?

I think this should work fine as the unregistration of the ser->dev is done after rtnl_lock,
this delays the freeing of the device until rtnl_unlock.
> 
> Secondly tty devices are ref counted and this for some reason didn't
> get fixed in the driver yet.
> 
> [Patches to follow for the write and kref bugs, the others need the
> authors and someone who knows the netdev code these days to fix]

Thanks, looking forward to review your patches.

BR/Sjur

  reply	other threads:[~2010-04-05 11:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-01 15:09 CAIF device Alan
2010-04-05 11:19 ` Sjur BRENDELAND [this message]
2010-04-07 13:13   ` [PATCH] Caif: Ref counting Alan Cox
2010-04-07 23:50     ` David Miller
2010-04-07 13:17   ` [PATCH] CAIF: write check Alan Cox
2010-04-07 23:49     ` David Miller

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=81C3A93C17462B4BBD7E272753C105791696B5DCF0@EXDCVYMBSTM005.EQ1STM.local \
    --to=sjur.brandeland@stericsson.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=netdev@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.