Linux-WPAN Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH][next] 6lowpan: fix off-by-one comparison of index id with LOWPAN_IPHC_CTX_TABLE_SIZE
@ 2019-06-24 14:47 Colin King
  2019-07-06 10:51 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2019-06-24 14:47 UTC (permalink / raw)
  To: Alexander Aring, Jukka Rissanen, David S . Miller,
	linux-bluetooth, linux-wpan, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The WARN_ON_ONCE check on id is off-by-one, it should be greater or equal
to LOWPAN_IPHC_CTX_TABLE_SIZE and not greater than. Fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/6lowpan/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/6lowpan/debugfs.c b/net/6lowpan/debugfs.c
index 1c140af06d52..a510bed8165b 100644
--- a/net/6lowpan/debugfs.c
+++ b/net/6lowpan/debugfs.c
@@ -170,7 +170,7 @@ static void lowpan_dev_debugfs_ctx_init(struct net_device *dev,
 	struct dentry *root;
 	char buf[32];
 
-	WARN_ON_ONCE(id > LOWPAN_IPHC_CTX_TABLE_SIZE);
+	WARN_ON_ONCE(id >= LOWPAN_IPHC_CTX_TABLE_SIZE);
 
 	sprintf(buf, "%d", id);
 
-- 
2.20.1

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

* Re: [PATCH][next] 6lowpan: fix off-by-one comparison of index id with LOWPAN_IPHC_CTX_TABLE_SIZE
  2019-06-24 14:47 [PATCH][next] 6lowpan: fix off-by-one comparison of index id with LOWPAN_IPHC_CTX_TABLE_SIZE Colin King
@ 2019-07-06 10:51 ` Marcel Holtmann
  2019-07-06 23:23   ` Colin Ian King
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2019-07-06 10:51 UTC (permalink / raw)
  To: Colin King
  Cc: Alexander Aring, Jukka Rissanen, David S. Miller,
	linux-bluetooth, linux-wpan, netdev, kernel-janitors,
	linux-kernel

Hi Colin,

> The WARN_ON_ONCE check on id is off-by-one, it should be greater or equal
> to LOWPAN_IPHC_CTX_TABLE_SIZE and not greater than. Fix this.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> net/6lowpan/debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/6lowpan/debugfs.c b/net/6lowpan/debugfs.c
> index 1c140af06d52..a510bed8165b 100644
> --- a/net/6lowpan/debugfs.c
> +++ b/net/6lowpan/debugfs.c
> @@ -170,7 +170,7 @@ static void lowpan_dev_debugfs_ctx_init(struct net_device *dev,
> 	struct dentry *root;
> 	char buf[32];
> 
> -	WARN_ON_ONCE(id > LOWPAN_IPHC_CTX_TABLE_SIZE);
> +	WARN_ON_ONCE(id >= LOWPAN_IPHC_CTX_TABLE_SIZE);

this patch no longer applied cleanly to bluetooth-next. Can you send me an updated version.

Regards

Marcel

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

* Re: [PATCH][next] 6lowpan: fix off-by-one comparison of index id with LOWPAN_IPHC_CTX_TABLE_SIZE
  2019-07-06 10:51 ` Marcel Holtmann
@ 2019-07-06 23:23   ` Colin Ian King
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Ian King @ 2019-07-06 23:23 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Alexander Aring, Jukka Rissanen, David S. Miller,
	linux-bluetooth, linux-wpan, netdev, kernel-janitors,
	linux-kernel

On 06/07/2019 11:51, Marcel Holtmann wrote:
> Hi Colin,
> 
>> The WARN_ON_ONCE check on id is off-by-one, it should be greater or equal
>> to LOWPAN_IPHC_CTX_TABLE_SIZE and not greater than. Fix this.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>> net/6lowpan/debugfs.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/6lowpan/debugfs.c b/net/6lowpan/debugfs.c
>> index 1c140af06d52..a510bed8165b 100644
>> --- a/net/6lowpan/debugfs.c
>> +++ b/net/6lowpan/debugfs.c
>> @@ -170,7 +170,7 @@ static void lowpan_dev_debugfs_ctx_init(struct net_device *dev,
>> 	struct dentry *root;
>> 	char buf[32];
>>
>> -	WARN_ON_ONCE(id > LOWPAN_IPHC_CTX_TABLE_SIZE);
>> +	WARN_ON_ONCE(id >= LOWPAN_IPHC_CTX_TABLE_SIZE);
> 
> this patch no longer applied cleanly to bluetooth-next. Can you send me an updated version.

I'm confused by this, I just applied it OK on bluetooth-next [1] on the
head 9ce67c3235be71e8cf922a9b3d0b7359ed3f4ce5, am I applying this to the
wrong repo/branch?

[1]
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git


Colin

> 
> Regards
> 
> Marcel
> 

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24 14:47 [PATCH][next] 6lowpan: fix off-by-one comparison of index id with LOWPAN_IPHC_CTX_TABLE_SIZE Colin King
2019-07-06 10:51 ` Marcel Holtmann
2019-07-06 23:23   ` Colin Ian King

Linux-WPAN Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wpan/0 linux-wpan/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wpan linux-wpan/ https://lore.kernel.org/linux-wpan \
		linux-wpan@vger.kernel.org
	public-inbox-index linux-wpan

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wpan


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git