linux-um archives
 help / color / mirror / Atom feed
From: <alnsn@yandex.ru>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] Hostfs doesn't work - digging the kernel
Date: Sun, 23 May 2004 13:36:05 +0400	[thread overview]
Message-ID: <20040523093605.GA2223@x1000.localdomain> (raw)

[-- 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 --]

             reply	other threads:[~2004-05-23  9:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-23  9:36 alnsn [this message]
2004-05-23 10:26 ` [uml-devel] Hostfs doesn't work - digging the kernel alnsn
2004-05-23 19:51 ` Henrik Nordstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040523093605.GA2223@x1000.localdomain \
    --to=alnsn@yandex.ru \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox