All of lore.kernel.org
 help / color / mirror / Atom feed
* re: nl802154: add support for security layer
@ 2015-10-01 22:17 Dan Carpenter
  2015-10-02  7:20 ` Alexander Aring
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2015-10-01 22:17 UTC (permalink / raw)
  To: alex.aring; +Cc: linux-wpan

Hello Alexander Aring,

The patch a26c5fd7622d: "nl802154: add support for security layer"
from Sep 28, 2015, leads to the following static checker warning:

	net/ieee802154/nl802154.c:1535 nl802154_add_llsec_key()
	warn: if statement not indented

net/ieee802154/nl802154.c
  1530          if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX,
  1531                               info->attrs[NL802154_ATTR_SEC_KEY],
  1532                               nl802154_key_policy))
  1533                  return -EINVAL;
  1534  
  1535          if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] ||
  1536              !attrs[NL802154_KEY_ATTR_BYTES])

Should this be a return -EINVAL?

  1537  
  1538          if (ieee802154_llsec_parse_key_id(attrs[NL802154_KEY_ATTR_ID], &id) < 0)
  1539                  return -ENOBUFS;
  1540  

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: nl802154: add support for security layer
  2015-10-01 22:17 nl802154: add support for security layer Dan Carpenter
@ 2015-10-02  7:20 ` Alexander Aring
  2015-10-02  7:47     ` Dan Carpenter
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Aring @ 2015-10-02  7:20 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-wpan

Hello Dan Carpenter,

On Fri, Oct 02, 2015 at 01:17:55AM +0300, Dan Carpenter wrote:
> Hello Alexander Aring,
> 
> The patch a26c5fd7622d: "nl802154: add support for security layer"
> from Sep 28, 2015, leads to the following static checker warning:
> 
> 	net/ieee802154/nl802154.c:1535 nl802154_add_llsec_key()
> 	warn: if statement not indented
> 
> net/ieee802154/nl802154.c
>   1530          if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX,
>   1531                               info->attrs[NL802154_ATTR_SEC_KEY],
>   1532                               nl802154_key_policy))
>   1533                  return -EINVAL;
>   1534  
>   1535          if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] ||
>   1536              !attrs[NL802154_KEY_ATTR_BYTES])
> 
> Should this be a return -EINVAL?
> 

Yes. Can you please provide a patch which based on bluetooth-next to
linux-wpan mailinglist?

Thanks.

- Alex

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [patch] nl802154: Missing return in nl802154_add_llsec_key()
  2015-10-02  7:20 ` Alexander Aring
@ 2015-10-02  7:47     ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2015-10-02  7:47 UTC (permalink / raw)
  To: Alexander Aring; +Cc: linux-wpan, Marcel Holtmann, kernel-janitors

There was a missing return here so it meant that often
ieee802154_llsec_parse_key_id() was not called.

Fixes: a26c5fd7622d ('nl802154: add support for security layer')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 1e9e865..16ef0d9 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -1534,6 +1534,7 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info)
 
 	if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] ||
 	    !attrs[NL802154_KEY_ATTR_BYTES])
+		return -EINVAL;
 
 	if (ieee802154_llsec_parse_key_id(attrs[NL802154_KEY_ATTR_ID], &id) < 0)
 		return -ENOBUFS;

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [patch] nl802154: Missing return in nl802154_add_llsec_key()
@ 2015-10-02  7:47     ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2015-10-02  7:47 UTC (permalink / raw)
  To: Alexander Aring; +Cc: linux-wpan, Marcel Holtmann, kernel-janitors

There was a missing return here so it meant that often
ieee802154_llsec_parse_key_id() was not called.

Fixes: a26c5fd7622d ('nl802154: add support for security layer')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 1e9e865..16ef0d9 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -1534,6 +1534,7 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info)
 
 	if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] ||
 	    !attrs[NL802154_KEY_ATTR_BYTES])
+		return -EINVAL;
 
 	if (ieee802154_llsec_parse_key_id(attrs[NL802154_KEY_ATTR_ID], &id) < 0)
 		return -ENOBUFS;

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [patch] nl802154: Missing return in nl802154_add_llsec_key()
  2015-10-02  7:47     ` Dan Carpenter
@ 2015-10-02 10:37       ` Alexander Aring
  -1 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2015-10-02 10:37 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-wpan, Marcel Holtmann, kernel-janitors

Hi,

On Fri, Oct 02, 2015 at 10:47:29AM +0300, Dan Carpenter wrote:
> There was a missing return here so it meant that often
> ieee802154_llsec_parse_key_id() was not called.
> 
> Fixes: a26c5fd7622d ('nl802154: add support for security layer')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 

Acked-by: Alexander Aring <alex.aring@gmail.com>

Thanks.

- Alex

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] nl802154: Missing return in nl802154_add_llsec_key()
@ 2015-10-02 10:37       ` Alexander Aring
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2015-10-02 10:37 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-wpan, Marcel Holtmann, kernel-janitors

Hi,

On Fri, Oct 02, 2015 at 10:47:29AM +0300, Dan Carpenter wrote:
> There was a missing return here so it meant that often
> ieee802154_llsec_parse_key_id() was not called.
> 
> Fixes: a26c5fd7622d ('nl802154: add support for security layer')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 

Acked-by: Alexander Aring <alex.aring@gmail.com>

Thanks.

- Alex

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] nl802154: Missing return in nl802154_add_llsec_key()
  2015-10-02  7:47     ` Dan Carpenter
@ 2015-10-02 21:35       ` Marcel Holtmann
  -1 siblings, 0 replies; 8+ messages in thread
From: Marcel Holtmann @ 2015-10-02 21:35 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Alexander Aring, linux-wpan, kernel-janitors

Hi Dan,

> There was a missing return here so it meant that often
> ieee802154_llsec_parse_key_id() was not called.
> 
> Fixes: a26c5fd7622d ('nl802154: add support for security layer')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] nl802154: Missing return in nl802154_add_llsec_key()
@ 2015-10-02 21:35       ` Marcel Holtmann
  0 siblings, 0 replies; 8+ messages in thread
From: Marcel Holtmann @ 2015-10-02 21:35 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Alexander Aring, linux-wpan, kernel-janitors

Hi Dan,

> There was a missing return here so it meant that often
> ieee802154_llsec_parse_key_id() was not called.
> 
> Fixes: a26c5fd7622d ('nl802154: add support for security layer')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-02 21:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-01 22:17 nl802154: add support for security layer Dan Carpenter
2015-10-02  7:20 ` Alexander Aring
2015-10-02  7:47   ` [patch] nl802154: Missing return in nl802154_add_llsec_key() Dan Carpenter
2015-10-02  7:47     ` Dan Carpenter
2015-10-02 10:37     ` Alexander Aring
2015-10-02 10:37       ` Alexander Aring
2015-10-02 21:35     ` Marcel Holtmann
2015-10-02 21:35       ` Marcel Holtmann

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.