Skip to contentSkip to conversation

net/sched: tcindex: update imperfect hash filters respecting rcu

bug report Dan Carpenter 1 participant 1 message Feb 14, 2023 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Hello Pedro Tammela,

This is a semi-automatic email about new static checker warnings.

The patch ee059170b1f7: "net/sched: tcindex: update imperfect hash filters respecting rcu" from Feb 9, 2023, leads to the following Smatch complaint:

net/sched/cls_tcindex.c:509 tcindex_set_parms()
error: we previously assumed 'cf' could be null (see line 504)

net/sched/cls_tcindex.c
503 /* lookup the filter, guaranteed to exist */

   504			for (cf = rcu_dereference_bh_rtnl(*fp); cf;
                                                                ^^

This loops until "cf" is NULL

505 fp = &cf->next, cf = rcu_dereference_bh_rtnl(*fp))
506 if (cf->key == handle)
507 break;
508

   509			f->next = cf->next;
                                  ^^^^^^^^

Unchecked dereference

   510	
   511			cf = rcu_replace_pointer(*fp, f, 1);

regards,
dan carpenter