Skip to contentSkip to conversation

tipc: eliminate KASAN warning

PATCH Applied Jon Maloy 2 participants 2 messages Oct 25, 2017 – Oct 26, 2017

Subsystems (3)
lore
Share & tools
lore

Jon Maloy

author
#0 lore raw

PATCH 1/1 tipc: eliminate KASAN warning

The following warning was reported by syzbot on Oct 24. 2017:

KASAN: slab-out-of-bounds Read in tipc_nametbl_lookup_dst_nodes

This is a harmless bug, but we still want to get rid of the warning, so we swap the two conditions in question.

---
 net/tipc/name_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/tipc/name_table.c +1 -1
index 2856e19..b3829bc 100644
@@ -697,7 +697,7 @@ void tipc_nametbl_lookup_dst_nodes(struct net *net, u32 type, u32 lower,
 	spin_lock_bh(&seq->lock);
 	sseq = seq->sseqs + nameseq_locate_subseq(seq, lower);
 	stop = seq->sseqs + seq->first_free;
-	for (; sseq->lower <= upper && sseq != stop; sseq++) {
+	for (; sseq != stop && sseq->lower <= upper; sseq++) {
 		info = sseq->info;
 		list_for_each_entry(publ, &info->zone_list, zone_list) {
 			if (tipc_in_scope(domain, publ->node))
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw

From: Jon Maloy <[email protected]>
Date: Wed, 25 Oct 2017 16:19:52 +0200

Quoted 7 lines

The following warning was reported by syzbot on Oct 24. 2017:

KASAN: slab-out-of-bounds Read in tipc_nametbl_lookup_dst_nodes

This is a harmless bug, but we still want to get rid of the warning, so we swap the two conditions in question.

Applied, thanks.