26 Jul, 2011

1 commit

  • When creating the temp file there's a memory and file descriptor leak upon
    error.

    Signed-off-by: Davidlohr Bueso
    Signed-off-by: Richard Weinberger
    Reviewed-by: Vitaliy Ivanov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davidlohr Bueso
     

30 Jun, 2010

1 commit

  • The os-linux/mem.c file calls fchmod function, which is declared in sys/stat.h
    header file, so include it. Fixes build breakage under FC13.

    Signed-off-by: Liu Aleaxander
    Acked-by: Boaz Harrosh
    Cc: Jeff Dike
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Liu Aleaxander
     

09 Feb, 2008

2 commits

  • * arch/um/os-Linux/mem.c (make_tempfile): Don't deref NULL upon failed malloc.

    * arch/um/os-Linux/mem.c (make_tempfile): Handle NULL tempdir.
    Don't let a long tempdir (e.g., via TMPDIR) provoke heap corruption.

    [ jdike - formatting cleanups, deleted obsolete comment ]

    Signed-off-by: Jim Meyering
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jim Meyering
     
  • Style changes under arch/um/os-Linux:
    include trimming
    CodingStyle fixes
    some printks needed severity indicators

    make_tempfile turns out not to be used outside of mem.c, so it is now static.
    Its declaration in tempfile.h is no longer needed, and tempfile.h itself is no
    longer needed.

    create_tmp_file was also made static.

    checkpatch moans about an EXPORT_SYMBOL in user_syms.c which is part of a
    macro definition - this is copying a bit of kernel infrastructure into the
    libc side of UML because the kernel headers can't be included there.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

06 Feb, 2008

3 commits

  • Tidy kern_util.h. It turns out that most of the function declarations
    aren't used, so they can go away. os.h no longer includes
    kern_util.h, so files which got it through os.h now need to include it
    directly. A number of other files never needed it, so these includes
    are deleted.

    The structure which was used to pass signal handlers from the kernel
    side to the userspace side is gone. Instead, the handlers are
    declared here, and used directly from libc code. This allows
    arch/um/os-Linux/trap.c to be deleted, with its remnants being moved
    to arch/um/os-Linux/skas/trap.c.

    arch/um/os-Linux/tty.c had its inclusions changed, and it needed some
    style attention, so it got tidied.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This patch also does some improvements for uml code. Improvements include
    dropping unnecessary cast, killing some unnecessary code and still some
    constifying for pointers etc..

    Signed-off-by: WANG Cong
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    WANG Cong
     
  • This patch contains varied fixes and improvements for some files under
    arch/um/os-Linux/, such as a typo fix in a perror message, a missing
    argument fix for a printf, some constifying for pointers and so on.

    [ jdike - made sigprocmask failure return -errno instead of -1 ]

    Signed-off-by: WANG Cong
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    WANG Cong
     

17 Oct, 2007

1 commit

  • A number of files that were changed in the recent removal of tt mode
    are userspace files which call the os_* wrappers instead of calling
    libc directly. A few other files were affected by this, through

    This patch makes these call glibc directly.

    There are also style fixes in the affected areas.

    os_print_error has no remaining callers, so it is deleted.

    There is a interface change to os_set_exec_close, eliminating a
    parameter which was always the same. The callers are fixed as well.

    os_process_pc got its error path cleaned up.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

08 May, 2007

3 commits

  • This patch converts calls in the os layer to os_{read,write}_file to calls
    directly to libc read() and write() where it is clear that the I/O buffer is
    in the kernel.

    We can do that here instead of calling os_{read,write}_file_k since we are in
    libc code and can call libc directly.

    With the change in the calls, error handling needs to be changed to refer to
    errno directly rather than the return value of the call.

    CATCH_EINTR wrappers were also added where needed.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • The build started finding calls from non-init to init functions. These are
    just cases of init functions not being properly marked, so this patch fixes
    that.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • user_util.h isn't needed any more, so delete it and remove all includes of it.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

12 Feb, 2007

2 commits


30 Sep, 2006

1 commit

  • Close two file descriptor leaks, one in the ubd driver and one to
    /proc/mounts. The ubd driver bug also leaked some vmalloc space. The
    /proc/mounts leak was a descriptor that was just never closed.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

26 Sep, 2006

1 commit


01 Jul, 2006

2 commits

  • Fix an off-by-one bug in temp file creation. Seeking to the desired length
    and writing a byte resulted in the file being one byte longer than expected.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • When parsing /proc/mounts looking for a tmpfs mount on /dev/shm, if a string
    that we are looking for if split across reads, then it won't be recognized.

    Fix this by refilling the buffer whenever we advance the cursor.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

20 Apr, 2006

1 commit

  • UML really wants shared memory semantics form its physical memory map file,
    and the place for that is /dev/shm. So move the default, and fix the error
    messages to recognize that this value can be overridden.

    Signed-off-by: Rob Landley
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rob Landley
     

11 Apr, 2006

1 commit

  • Switch this proc from storing 4k of data (a whole path) on the stack to
    keeping it on the heap.

    Maybe it's not called in process context but only in early boot context (where
    in UML you have a normal process stack on the host) but just to be safe, fix
    it.

    While at it some little readability simplifications.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     

01 Apr, 2006

1 commit

  • Changes since first version
    added check for MADV_REMOVE support on the host
    fixed error return botch
    shrunk sprintf array by one character

    This adds hotplug memory support to UML. The mconsole syntax is
    config mem=[+-]n[KMG]
    In other words, add or subtract some number of kilobytes, megabytes, or
    gigabytes.

    Unplugged pages are allocated and then madvise(MADV_TRUNCATE), which is a
    currently experimental madvise extension. These pages are tracked so they
    can be plugged back in later if the admin decides to give them back. The
    first page to be unplugged is used to keep track of about 4M of other
    pages. A list_head is the first thing on this page. The rest is filled
    with addresses of other unplugged pages. This first page is not madvised,
    obviously.

    When this page is filled, the next page is used in a similar way and linked
    onto a list with the first page. Etc. This whole process reverses when
    pages are plugged back in. When a tracking page no longer tracks any
    unplugged pages, then it is next in line for plugging, which is done by
    freeing pages back to the kernel.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

07 Nov, 2005

1 commit

  • A number of fixes to improve behavior when large physical memory sizes
    are specified:

    - libc files need -D_FILE_OFFSET_BITS=64 because there are unavoidable uses
    of non-64 interfaces in libc

    - some %d need to be %u

    Signed-off-by: Jeff Dike
    Cc: Paolo Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

18 Sep, 2005

1 commit