When the directory contains UTF-8 characters those are converted as 3 or more bytes multibyte UTF8 character, kernel oops occurs. this is because the code assumes that in-place WCHAR to CHAR conversion is safe. when a WCHAR is converted, it can use 3 or more bytes. then buffer overflow occurs. As you can imagine, messed up structures will end up with a page fault. I have made my modifications that perfectly works for me. Please consult my attachments and contact me if you need any assistance.
Created attachment 850 [details] this patch prevents kernel oops with unicode directory entry
Comment on attachment 850 [details] this patch prevents kernel oops with unicode directory entry this patch is generated from wrong source tree
Created attachment 851 [details] this patch prevents kernel oops with unicode directory entry
Comment on attachment 851 [details] this patch prevents kernel oops with unicode directory entry this patch is a diff from standard kernel.org source code
Created attachment 852 [details] this file contains files with UTF-8 chars that will be converted as 3byte multibyte UTF-8 format
Hey I misunderstood about Unicode and UTF-8 ( only in terminology, I know what they are ;) ). By WCHAR or UTF-8, I mean Unicode. By multibyte UTF-8, I mean UTF8 encoding. By the way, I've done this on Fedora Core 3 with kernel 2.6.9-1.681_FC3smp. nls-utf8.ko is loaded. Samba server version was 3.0.10. with unix extension turned on. I'll check if this patch works fine with unix extension turend off.
This patch works good without "unix extension" on samba server. This patch works good on kernel 2.6.10-rc3-bk14.
Created attachment 860 [details] cifs-unicode-to-mbcs-conversion-bof-fix
I think the approach is ok in your patch, but the mainline code in 2.6.10pre I believe has already addressed this (the changes are in a new file fs/cifs/readdir.c) and in the process fixed two other problems with this routine.
fixed in 2.6.10 (patches available on project page for a few earlier kernel versions)