linux-um archives
 help / color / mirror / Atom feed
From: James W McMechan <mcmechanjw@juno.com>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Host panic when UML reads host /dev/shm
Date: Sun, 23 Nov 2003 15:08:27 -0800	[thread overview]
Message-ID: <20031123.150830.-1747969.0.mcmechanjw@juno.com> (raw)

I have been tracing down the Oops on a vanilla 2.4.22 kernel
This appears to be a Oops with a semaphore held that will
lock out all other accesses to the tmpfs/shmfs filesystem.

I traced it to read_dir in hostfs_user.c by setting
breakpoints on all the hostfs_user.c functions.

Ok I now have a simple test program which Oops
the host kernel instantly (3 times through loop)

This is very strange my attached test program when run
as a unprivileged user Oops the kernel and locks /dev/shm
in general a unprivileged user should not be able to do this

It has taken a while in order to check that the kernel I was
running was without patches (i.e. no skas)
It still Oops on the third loop :(

I have also noted that the tmpfs/shmfs does not have a set
of files like other filesystems under fs/ it seems to be located
in mm/shmem.c instead... very strange

Oh well it is a problem with the vanilla 2.4.22 kernel so
more testing and off to the LKML...

Anybody have a better guess where to send this?

For your Enjoyment the test program

/* by James_McMechan at hotmail com */
/* test program to Oops shmfs usually mounted at /dev/shm */
/* yes it is dumb but unprivileged users should not be able */
/* to Oops the kernel regardless of how dumb the program */
#include <sys/types.h>                                                   
      
#include <dirent.h>
#include <stdio.h>

main()
{
        DIR *dir;
        struct dirent *ent;
        off_t pos = 0;

        do {
                dir = opendir("/dev/shm");
                seekdir(dir, pos);
                ent = readdir(dir);
                if (ent == 0) {
                        printf("end of directory\n");
                        perror("readdir ended with");
                } else {
                        printf("d_name is %s\n",ent->d_name);
                        pos = telldir(dir);
                        if (pos < 0)
                                perror("telldir failed with");
                }
                closedir(dir);
        } while (ent != 0);
}

________________________________________________________________
The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

             reply	other threads:[~2003-11-23 23:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-23 23:08 James W McMechan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-11-25  3:02 [uml-devel] Host panic when UML reads host /dev/shm James W McMechan
2003-11-20 18:15 [uml-devel] Host panic triggered by UML BlaisorBlade
2003-11-20 18:56 ` Frank Dekervel
2003-11-20 19:37   ` [uml-devel] Host panic when UML reads host /dev/shm BlaisorBlade
2003-11-20 22:32     ` Frank Dekervel
2003-11-20 22:47       ` Frank Dekervel
2003-11-22 18:11         ` BlaisorBlade
2003-11-24  3:36           ` Frank Dekervel
2003-11-21  2:22     ` Jeff Dike
2003-11-22 18:12       ` BlaisorBlade

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=20031123.150830.-1747969.0.mcmechanjw@juno.com \
    --to=mcmechanjw@juno.com \
    --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