]> git.baikalelectronics.ru Git - kernel.git/commit
rt2x00: type bug in _rt2500usb_register_read()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Nov 2015 11:55:23 +0000 (14:55 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 30 Nov 2015 12:57:49 +0000 (14:57 +0200)
commit05359120b204ef1a0969b2ad620e5150a31a7ba4
tree611ae3c4c1b1d12cf2949648b803f9d673c64071
parentba6c26a0a33f39dcee2e29f0e5ce4999d2ce7a40
rt2x00: type bug in _rt2500usb_register_read()

This code causes a static checker bug.

drivers/net/wireless/ralink/rt2x00/rt2500usb.c:232 _rt2500usb_register_read()
warn: passing casted pointer 'value' to 'rt2500usb_register_read()' 32 vs 16.

If the low 16 bits were initialized to zero then this code would only be
a problem on big endian systems.  But in this case this is case the low
16 bits are never initialized.  This is called from a function which is
created using a macro:

RT2X00DEBUGFS_OPS(csr, "0x%.8x\n", u32);

We end up copying uninitialized data to the user which is bogus and an
information leak.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ralink/rt2x00/rt2500usb.c