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4gdGVsbC4NCg0KV2UgZWl0aGVyIG5lZWQgdG8gZmlndXJlIG91dCB3aGVy
ZSB0aGlzIGlvY3RsIGludGVyZmFjZSBleHBlY3RzIHRoZQ0KcmVzcG9uc2UgdG8gZ28sIG9yIHJl
bW92ZSB0aGUgaW9jdGwgYW5kIHRoaXMgY29kZSBlbnRpcmVseSBzaW5jZSBpdCdzDQpvYnZpb3Vz
bHkgbm90IGJlaW5nIHVzZWQuDQoNClRoYW5rcy4NCg==


2011-11-29 17:40:15

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: prism54 bug...

2011/11/26 David Miller <[email protected]>:
>
> Someone please look into this.
>
> In prism2_ioctl_scan_req() gcc generates a warning:
>
> drivers/net/wireless/prism54/isl_ioctl.c: In function ‘prism2_ioctl_scan_req’:
> drivers/net/wireless/prism54/isl_ioctl.c:2733:14: warning: array subscript is above array bounds [-Warray-bounds]
>
> it's a pretty serious issue, it's about the call to:
>
>                current_ev = prism54_translate_bss(ndev, &info, current_ev,
>                                                   extra + IW_SCAN_MAX_DATA,
>                                                   &(bsslist->bsslist[i]),
>                                                   noise);
>
> it's not the bsslist->bsslist[i] thing, that's fine.
>
> It's "extra + IW_SCAN_MAX_DATA".
>
>        char *extra = "";
>        char *current_ev = "foo";
>
> and IW_SCAN_MAX_DATA is 4096.  Effectively these calls crap IW entries
> into random pieces of memory as far as I can tell.
>
> We either need to figure out where this ioctl interface expects the
> response to go, or remove the ioctl and this code entirely since it's
> obviously not being used.

I'm going to kill all this shit. Thanks for the report.

Luis