Linux bluetooth development
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Fix starting security procedures when not needed
Date: Tue, 10 May 2011 11:56:24 -0300	[thread overview]
Message-ID: <20110510145624.GA6502@piper> (raw)
In-Reply-To: <BANLkTinX+8SXu+6jg5v4vHjde1fOWP2_cw@mail.gmail.com>

Hi Luiz,

On 13:21 Tue 10 May, Luiz Augusto von Dentz wrote:
> Hi Vinicius,
> 
> On Tue, May 10, 2011 at 2:49 AM, Vinicius Costa Gomes
> <vinicius.gomes@openbossa.org> wrote:
> > The default value of sec_level when setting *any* option
> > using bt_io_set() was BT_SECURITY_MEDIUM. This was causing
> > the security procedure being started in some situations that
> > it should not.
> > ---
> >  btio/btio.c |    1 -
> >  1 files changed, 0 insertions(+), 1 deletions(-)
> >
> > diff --git a/btio/btio.c b/btio/btio.c
> > index a3cf38a..df028a6 100644
> > --- a/btio/btio.c
> > +++ b/btio/btio.c
> > @@ -659,7 +659,6 @@ static gboolean parse_set_opts(struct set_opts *opts, GError **err,
> >        /* Set defaults */
> >        opts->defer = DEFAULT_DEFER_TIMEOUT;
> >        opts->master = -1;
> > -       opts->sec_level = BT_IO_SEC_MEDIUM;
> >        opts->mode = L2CAP_MODE_BASIC;
> >        opts->flushable = -1;
> 
> I believe this was on purpose so that if you want another security
> level you need to force it when using BtIO, this could be set in the
> kernel by default but since it already uses LOW that could break some
> applications.

If this was by design, I would gladly have my first patch applied.

It is just that it is weird that I have to pass the security level on
every call to bt_io_set() if I don't want the security level to change.

In any case, while writing this email, I realized that only checking
all bt_io_set() calls wasn't enough, so this patch may be incomplete.
All bt_io_listen() users should be safe, but there are some callers
of bt_io_connect() that may depend on BtIO setting the default
security level to MEDIUM.

> 
> 
> -- 
> Luiz Augusto von Dentz
> Computer Engineer


Cheers,
-- 
Vinicius

  reply	other threads:[~2011-05-10 14:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-09 23:49 [PATCH] Fix starting security procedures when not needed Vinicius Costa Gomes
2011-05-10 10:21 ` Luiz Augusto von Dentz
2011-05-10 14:56   ` Vinicius Costa Gomes [this message]
2011-05-10 16:29     ` Luiz Augusto von Dentz
2011-05-11  4:54       ` Johan Hedberg

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=20110510145624.GA6502@piper \
    --to=vinicius.gomes@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.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