Re: 2.6.0-mm1 - kernel panic (VFS bug?)

From: Nick Piggin
Date: Mon Jan 05 2004 - 23:12:12 EST




Libor Vanek wrote:

Hi,
I'm trying to do some debugging with 2.6.0 + mm1 patch (I attach my .config) and I found out this very strange thing when changing fs/open.c (about the line 933):

ORIGINAL CODE:
...
asmlinkage long sys_open(const char __user * filename, int flags, int mode)
{
char * tmp;
int fd, error;

#if BITS_PER_LONG != 32
flags |= O_LARGEFILE;
#endif
tmp = getname(filename);
fd = PTR_ERR(tmp);
...


MY TINY MODIFICATION:
...
asmlinkage long sys_open(const char __user * filename, int flags, int mode)
{
char * tmp;
int fd, error;
char tmp_path[PATH_MAX],tmp2_path[PATH_MAX];


#if BITS_PER_LONG != 32
flags |= O_LARGEFILE;
#endif
tmp = getname(filename);
printk (KERN_INFO "sys_open: %s\n",tmp);
fd = PTR_ERR(tmp);
...


This causes kernel to panic during boot. Messages are: (maybe some typos - writing from paper)
...
NET: Registering protocol family 17
Unable to handle kernel paging request at virtual address fffffff2


getname can return errors, actually. Looks like you're trying to print
the string at address -EFAULT.

When in doubt, always suspect your code.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/