<div>Hi~ @list</div><div> </div><div>I&#39;m on my way to jump into the kernel network stack;)</div><div> </div><div>And I find the usage of neigh_tbl_lock might not make sense in following functions</div><div><br clear="all">
static int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)</div><div>static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)</div><div> </div><div>They both have the following code snippets</div>
<div> </div><div>read_lock(&amp;neigh_tbl_lock);                                       --L1<br> for (tbl = neigh_tables; tbl; tbl = tbl-&gt;next) {               --L2<br>  struct neighbour *neigh;                                           --L3</div>
<div>  if (tbl-&gt;family != ndm-&gt;ndm_family)                          --L4<br>   continue;                                                                  --L5<br>  read_unlock(&amp;neigh_tbl_lock);                                 --L6</div>
<div>  if (nla_len(dst_attr) &lt; tbl-&gt;key_len)                           --L7<br>   goto out_dev_put;</div><div> </div><div> </div><div>IMHO, there might be some race condition after L6. I mean when the L7 use the tbl, is it possible other processor releasing the table entry?</div>
<div>Am I wrong?</div><div> </div><div><br>-- <br>Yours sincerely<br>Jammy<br>
</div>