Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irda: precedence bug in irlmp_seq_hb_idx()

This is decrementing the pointer, instead of the value stored in the
pointer. KASan detects it as an out of bounds reference.

Reported-by: "Berry Cheng 程君(成淼)" <chengmiao.cj@alibaba-inc.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dan Carpenter and committed by
David S. Miller
50010c20 ca88ea12

+1 -1
+1 -1
net/irda/irlmp.c
··· 1839 1839 for (element = hashbin_get_first(iter->hashbin); 1840 1840 element != NULL; 1841 1841 element = hashbin_get_next(iter->hashbin)) { 1842 - if (!off || *off-- == 0) { 1842 + if (!off || (*off)-- == 0) { 1843 1843 /* NB: hashbin left locked */ 1844 1844 return element; 1845 1845 }