linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] Hostfs doesn't work - digging the kernel
@ 2004-05-23  9:36 alnsn
  2004-05-23 10:26 ` alnsn
  2004-05-23 19:51 ` Henrik Nordstrom
  0 siblings, 2 replies; 3+ messages in thread
From: alnsn @ 2004-05-23  9:36 UTC (permalink / raw)
  To: user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 1052 bytes --]

Hi,
I'm trying to mount hostfs from inside my tiny uml. Host linux is RH9
with linux-2.6.6 and linux-2.4.26 vanilla kernels. UML patch is
2.4.26-1.
Mounting with no -o option results in UML kernel panic because
mount_arg argument is NULL in this case:

char *host_root_filename(char *mount_arg)
{   
    char *root = DEFAULT_ROOT;

    if((mount_arg != NULL) && (*mount_arg != '\0'))
        root = mount_arg;

    return(uml_strdup(mount_arg));
}

Returning uml_strdup(NULL) causes this panic to happen.
Correct behavior, I think, is return uml_strdup(root).

Even with -o option I can't mount. Function hostfs_init_file composes a
path beginning with jail_dir (/ in my case), then go mount and file.
    const char *path[] = { jail_dir, mount, file, NULL };
In my case path is either // or //tmp. The open64 function can't open both.
If I do these transformations:
"//" -> ""
"//tmp" -> "/tmp"
they are mounted but I can't read files.
I suggest always transform path like this. What do you think?
-- 
Alexander Nasonov

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-05-23 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-23  9:36 [uml-devel] Hostfs doesn't work - digging the kernel alnsn
2004-05-23 10:26 ` alnsn
2004-05-23 19:51 ` Henrik Nordstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox