drivers/staging/zram/zram_drv.c:352:8-14: ERROR: reference preceded by free on line 343

Nitin Gupta ngupta at vflare.org
Mon Oct 29 18:44:15 UTC 2012


Hi Julia and Fengguang,


On Sun, Oct 28, 2012 at 8:48 AM, Fengguang Wu <fengguang.wu at intel.com> wrote:
> Hi,
>
> On Sun, Oct 28, 2012 at 01:09:12AM +0800, Fengguang Wu wrote:
>> Hi Nitin,
>>
>> FYI, there are coccinelle warnings in
>>
>> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux master
>> head:   e657e078d3dfa9f96976db7a2b5fd7d7c9f1f1a6
>> commit: c8f2f0db1d0294aaf37e8a85bea9bbc4aaf5c0fe staging: zram: Fix handling of incompressible pages
>> date:   5 days ago
>>
>> + drivers/staging/zram/zram_drv.c:352:8-14: ERROR: reference preceded by free on line 343
>
> I'd like to cite some good comments from Julia:
>
> : I'm not 100% sure whether this is a bug, because the various elements
> : are under different conditionals, and I am not sure to understand the
> : relationship between them.  But I think there is enough of a chance that
> : there is a problem for it to be worth contacting the developer.
> :
> : There is also a problem with the indentation of the kfree, which has too
> : many tabs in front of it.
>

This is indeed a use-after-free bug and will be sending out the fix soon.
Thanks for pointing it out; coccinelle seems worth exploring.

Thanks,
Nitin



More information about the devel mailing list