On 9.03.2017 03:58, Theodore Ts'o wrote: > On Tue, Mar 07, 2017 at 10:40:53PM +0200, Nikolay Borisov wrote: >> So this is wrong, the reason why the issues seemed fix is because I >> switched my compiler to version 5.4.0. So this manifests only if I'm >> using gcc 4.7.4. With the pr_info added here is the output of a boot. So >> there are multiple invocations of ext4_ext_map_blocks and the freeing, >> including with the address being used in subsequent kasan reports : >> ffff88006ae8fdb0 > > Can you help bisect this, then? I'm using Debian Testing, and the > default gcc is gcc 6.3.0. I'm currently forcing the use of gcc 5.4.1 > because I was running into problems with gcc 6.x a while back. (TBH, > I was thinking about trying to see if gcc 6.3 was stable for kernel > compiles when I had some spare time.) But I don't have access to > *any* gcc 4.x on my development system, and I don't think I've tried > using gcc 4.x in a long, Long, LONG time. > > I'm currently kicking off a test run using 5.4.1 with KASAN enabled to > see if I can trigger it myself. Can you send me a copy of your > .config so I can see what else might be interesting with your config? > (e.g., SLAB vs SLUB, etc.) Attached the config. FUrther debugging and talking with the kasan developers I think this actually might be a kasan problem when used with an old compiler. I bisected this all the way to 1771c6e1a567ea0ba2, which is the commit introducing the user access instrumentation. Here is a mail thread where I confirmed that this might be a kasan issue : https://lkml.org/lkml/2017/3/8/69 What I believe is happening is that the manual checks inserted in user access code misses some context information due to instrumentation not inserted by the compiler. Kasan gets confused as a result, hence the warnings. > > Thanks, > > - Ted >