28 May, 2010

1 commit

  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     

09 Feb, 2010

1 commit

  • In particular, several occurances of funny versions of 'success',
    'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address',
    'beginning', 'desirable', 'separate' and 'necessary' are fixed.

    Signed-off-by: Daniel Mack
    Cc: Joe Perches
    Cc: Junio C Hamano
    Signed-off-by: Jiri Kosina

    Daniel Mack
     

05 Feb, 2010

1 commit


16 Dec, 2009

2 commits

  • For embedded systems, the blinking cursor at startup time can be annoying
    and unintended. Add a new kernel parameter to change the default cursor
    shape.

    Signed-off-by: Clemens Ladisch
    Cc: Daniel Mack
    Acked-by: Pavel Machek
    Cc: David Newall
    Cc: Alan Cox
    Cc: Greg Kroah-Hartman
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Clemens Ladisch
     
  • The kernel offers with TIOCL_GETKMSGREDIRECT ioctl() the possibility to
    redirect the kernel messages to a specific console.

    However, since it's not possible to switch to the kernel message console
    after a panic(), it would be nice if the kernel would print the panic
    message on the current console.

    This patch series adds a new interface to access the global kmsg_redirect
    variable by a function to be able to use it in code where
    CONFIG_VT_CONSOLE is not set (kernel/panic.c).

    This patch:

    Instead of using and exporting a global value kmsg_redirect, introduce a
    function vt_kmsg_redirect() that both can set and return the console where
    messages are printed.

    Change all users of kmsg_redirect (the VT code itself and kernel/power.c)
    to the new interface.

    The main advantage is that vt_kmsg_redirect() can also be used when
    CONFIG_VT_CONSOLE is not set.

    Signed-off-by: Bernhard Walle
    Cc: Alan Cox
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bernhard Walle
     

14 Nov, 2009

1 commit


20 Sep, 2009

4 commits

  • Signed-off-by: Marcin Slusarz
    Signed-off-by: Greg Kroah-Hartman

    Marcin Slusarz
     
  • The VT specific compat_ioctl handlers are the only ones
    in common code that require the BKL. Moving them into
    the vt driver lets us remove the BKL from the other handlers
    and cleans up the code.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • This is needed and requested in various forms for ConsoleKit, screenblank
    handling and the like so do the job with a single interface. Also build the
    interface so that unlike VT_WAITACTIVE and friends it won't miss events.

    FIXME: Should this be a waitactive ioctl or a new device file you can poll
    and read events from. We need the code anyway to fix up the existing broken
    wait for console switch logic but the ConsoleKit people would prefer the
    new device to the ioctl we have here

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     
  • fix the following 'make includecheck' warning:

    drivers/char/vt.c: linux/device.h is included more than once.

    Signed-off-by: Jaswinder Singh Rajput
    Signed-off-by: Greg Kroah-Hartman

    Jaswinder Singh Rajput
     

16 Sep, 2009

1 commit

  • Many years ago when this driver was written, it had a use, but these
    days it's nothing but trouble and distributions should not enable it
    in any situation.

    Pretty much every console device a sparc machine could see has a
    bonafide real driver, making the PROM console hack unnecessary.

    If any new device shows up, we should write a driver instead of
    depending upon this crutch to save us. We've been able to take care
    of this even when no chip documentation exists (sunxvr500, sunxvr2500)
    so there are no excuses.

    Signed-off-by: David S. Miller

    David S. Miller
     

17 Jul, 2009

1 commit

  • Bootmem is not used for the vt screen buffer anymore as slab is now
    available at the time the console is initialized.

    Get rid of the now superfluous distinction between slab and bootmem,
    it's always slab.

    This also fixes a kmalloc leak which Catalin described thusly:

    Commit a5f4f52e ("vt: use kzalloc() instead of the bootmem allocator")
    replaced the alloc_bootmem() with kzalloc() but didn't set vc_kmalloced to
    1 and the memory block is later leaked. The corresponding kmemleak trace:

    unreferenced object 0xdf828000 (size 8192):
    comm "swapper", pid 0, jiffies 4294937296
    backtrace:
    [] __save_stack_trace+0x17/0x1c
    [] log_early+0x55/0x84
    [] kmemleak_alloc+0x33/0x3c
    [] __kmalloc+0xd7/0xe4
    [] con_init+0xbf/0x1b8
    [] console_init+0x11/0x20
    [] start_kernel+0x137/0x1e4

    Signed-off-by: Johannes Weiner
    Reviewed-by: Pekka Enberg
    Tested-by: Catalin Marinas
    Signed-off-by: Andrew Morton
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

13 Jul, 2009

1 commit

  • * Remove smp_lock.h from files which don't need it (including some headers!)
    * Add smp_lock.h to files which do need it
    * Make smp_lock.h include conditional in hardirq.h
    It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

    This will make hardirq.h inclusion cheaper for every PREEMPT=n config
    (which includes allmodconfig/allyesconfig, BTW)

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

17 Jun, 2009

1 commit

  • The console blank timer is currently hardcoded to 10*60 seconds which
    might be annoying on systems with no input devices attached to wake up the
    console again. Especially during development, disabling the screen saver
    can be handy - for example when debugging the root fs mount mechanism or
    other scenarios where no userspace program could be started to do that at
    runtime from userspace.

    This patch defines a core_param for the variable in charge which allows
    users to entirely disable the blank feature at boot time by setting it 0.
    The value can still be overwritten at runtime using the standard ioctl
    call - this just allows to conditionally change the default.

    Signed-off-by: Daniel Mack
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Mack
     

12 Jun, 2009

4 commits

  • This file is no longer annotated for false positives but the kmemleak.h
    include was still present.

    Signed-off-by: Catalin Marinas
    Acked-by: Alan Cox

    Catalin Marinas
     
  • * 'for-linus' of git://linux-arm.org/linux-2.6:
    kmemleak: Add the corresponding MAINTAINERS entry
    kmemleak: Simple testing module for kmemleak
    kmemleak: Enable the building of the memory leak detector
    kmemleak: Remove some of the kmemleak false positives
    kmemleak: Add modules support
    kmemleak: Add kmemleak_alloc callback from alloc_large_system_hash
    kmemleak: Add the vmalloc memory allocation/freeing hooks
    kmemleak: Add the slub memory allocation/freeing hooks
    kmemleak: Add the slob memory allocation/freeing hooks
    kmemleak: Add the slab memory allocation/freeing hooks
    kmemleak: Add documentation on the memory leak detector
    kmemleak: Add the base support

    Manual conflict resolution (with the slab/earlyboot changes) in:
    drivers/char/vt.c
    init/main.c
    mm/slab.c

    Linus Torvalds
     
  • Now that kmem_cache_init() happens before console_init(), we should use
    kzalloc() and not the bootmem allocator.

    Signed-off-by: Pekka Enberg

    Pekka Enberg
     
  • There are allocations for which the main pointer cannot be found but
    they are not memory leaks. This patch fixes some of them. For more
    information on false positives, see Documentation/kmemleak.txt.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     

20 Apr, 2009

1 commit

  • This reverts commit 1c55f18717304100a5f624c923f7cb6511b4116d.

    Ingo Brueckl was assuming that reverting to 1:1 mapping for chars >= 128
    was not useful, but it happens to be: due to the limitations of the
    Linux console, when a blind user wants to read BIG5 on it, he has no
    other way than loading a font without SFM and let the 1:1 mapping permit
    the screen reader to get the BIG5 encoding.

    Signed-off-by: Samuel Thibault
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Samuel Thibault
     

25 Mar, 2009

1 commit

  • During bootup performance tracing I noticed many occurrences of
    vca* device creation and removal, leading to the usual userspace
    uevent processing, which are, in this case, rather pointless.

    A simple test showing the kernel timing (not including all the
    work userspace has to do), gives us these numbers:
    $ time for i in `seq 1000`; do echo a > /dev/tty2; done
    real 0m1.142s
    user 0m0.015s
    sys 0m0.540s

    If we move the hook for the vcs* driver core devices from the
    tty "binding" to the vc allocation/deallocation, which is what
    the vcs* devices represent, we get the following numbers:
    $ time for i in `seq 1000`; do echo a > /dev/tty2; done
    real 0m0.152s
    user 0m0.030s
    sys 0m0.072s

    Cc: Alan Cox
    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

09 Jan, 2009

1 commit

  • Building an allnoconfig kernel, sparse asked whether these could be
    static, so I checked, and they are only used in the file where they are
    declared.

    Signed-off-by: Roel Kluin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roel Kluin
     

03 Jan, 2009

2 commits

  • We have special case logic for resizing pty/tty pairs. We also have a per
    driver resize method so for the pty case we should use it.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Fixes the loss of echoed (and other ldisc-generated characters) when
    the tty is stopped or when the driver output buffer is full (happens
    frequently for input during continuous program output, such as ^C)
    and removes the Big Kernel Lock from the N_TTY line discipline.

    Adds an "echo buffer" to the N_TTY line discipline that handles all
    ldisc-generated output (including echoed characters). Along with the
    loss of characters, this also fixes the associated loss of sync between
    tty output and the ldisc state when characters cannot be immediately
    written to the tty driver.

    The echo buffer stores (in addition to characters) state operations that need
    to be done at the time of character output (like management of the column
    position). This allows echo to cooperate correctly with program output,
    since the ldisc state remains consistent with actual characters written.

    Since the echo buffer code now isolates the tty column state code
    to the process_out* and process_echoes functions, we can remove the
    Big Kernel Lock (BKL) and replace it with mutex locks.

    Highlights are:

    * Handles echo (and other ldisc output) when tty driver buffer is full
    - continuous program output can block echo
    * Saves echo when tty is in stopped state (e.g. ^S)
    - (e.g.: ^Q will correctly cause held characters to be released for output)
    * Control character pairs (e.g. "^C") are treated atomically and not
    split up by interleaved program output
    * Line discipline state is kept consistent with characters sent to
    the tty driver
    * Remove the big kernel lock (BKL) from N_TTY line discipline

    Signed-off-by: Joe Peterson
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Joe Peterson
     

14 Dec, 2008

1 commit

  • For the console, there is a 1:1 mapping of glyphs which cannot be found
    in the current font. This seems to be meant as a kind of 'emergency
    fallback' for fonts without unicode mapping which otherwise would
    display nothing readable on the screen.

    At the moment it affects all chars for which no substitution character
    is defined. In particular this means that for all chars (>= 128) where
    there is no iso88591-1/unicode character (e.g. control character area)
    you'll get the very strange 1:1 mapping of the (cp437) graphics card
    glyphs.

    I'm pretty sure that the 1:1 mapping should only affect strict ASCII
    code characters, i.e. chars < 128.

    The patch limits the mapping as it probably was meant anyway.

    Signed-off-by: Ingo Brueckl
    Acked-by: H. Peter Anvin
    Cc: Egmont Koblinger
    Signed-off-by: Linus Torvalds

    Ingo Brueckl
     

07 Nov, 2008

1 commit

  • Problem 1 (see patch below):
    vc_tab_stop is declared as an array of 8 unsigned ints in struct
    vc_data in include/linux/console_struct.h .
    In drivers/char/vt.c only 5 of these 8 unsigned ints get initialized
    leading to unintended tabulator placement on displays with more than
    160 columns text.

    Problem 2 (open):
    Upcoming displays will have more than 256 columns of text leading to
    invalid memory access in drivers/char/vt.c during tabulator
    calculations:
    if (vc->vc_tab_stop[vc->vc_x >> 5] & (1 << (vc->vc_x & 31)))
    break;

    Signed-off-by: Wolfgang Kroworsch
    Cc: Alan Cox
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfgang Kroworsch
     

17 Oct, 2008

1 commit


15 Oct, 2008

1 commit

  • This reverts commit c9e587abfdec2c2aaa55fab83bcb4972e2f84f9b, and the
    subsequent commits that fixed it up:

    - afa9b649 "fbcon: prevent cursor disappearance after switching to 512
    character font"

    - d850a2fa "vt/fbcon: fix background color on line feed"

    - 7fe3915a "vt/fbcon: update scrl_erase_char after 256/512-glyph font
    switch"

    by request of Alan Cox. Quoth Alan:
    "Unfortunately it's wrong and its been causing breakages because
    various apps like ncurses expect our previous (and correct)
    behaviour."

    Alexander sent out a similar patch.

    Requested-by: Alan Cox
    Tested-by: Jan Engelhardt
    Cc: Alexander V. Lukyanov
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

14 Oct, 2008

4 commits

  • Carry on pushing code out of tty_io when it belongs to other drivers. I'm
    not 100% happy with some of this and it will be worth revisiting some of the
    exports later when the restructuring work is done.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Right now there are various drivers that try to use tty->count to know when
    they get the final close. Aristeau Rozanski showed while debugging the vt
    sysfs race that this isn't entirely safe.

    Instead of driver side tricks to work around this introduce a shutdown which
    is called when the tty is being destructed. This also means that the shutdown
    method is tied into the refcounting.

    Use this to rework the console close/sysfs logic.

    Remove lots of special case code from the tty core code. The pty code can now
    have a shutdown() method that replaces the special case hackery in the tree
    free up paths.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • For hysterical raisins the vt layer drops and retakes locks in the write
    method. This is a left over from the days when user/kernel data was passed
    directly to the tty not pre-buffered.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Right now we have ifdefs and hooks in the core ioctl handler for TIOCLINUX
    and then test if its a console. This is brain dead. Instead call the
    tioclinux helper from the relevant driver ioctl methods.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     

16 Aug, 2008

1 commit

  • This moves it to being a tty operation. That removes special cases and now
    also means that resize can be picked up by um and other non vt consoles
    which may have a resize operation.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     

05 Aug, 2008

1 commit

  • 2.6.26 corrected the mutex locking on tty resizing to fix the case where
    you could get the tty/vt sizing out of sync. That turns out to have a
    deadlock.

    The actual fix is really major and I've got it lined up as part of the ops
    changes for 2.6.28 so for 2.6.26/2.6.27 it is safer to reintroduce this
    ages old minor bug.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     

26 Jul, 2008

1 commit


25 Jul, 2008

2 commits

  • vt.c DO_UPDATE macro checks if the console is visible but doesn't check if
    the console is blanked.

    In fact updating fbcon while the console is blanked is not only
    unnecessary but can even cause screen corruption.

    Therefore I am adding a simple check on console_blanked in DO_UPDATE.

    Signed-off-by: Stefano Stabellini
    Cc: Krzysztof Helt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefano Stabellini
     
  • Hold console sem while creating/destroying sysfs files. Serialisation is
    so far done by BKL held in tty release_dev and chrdev_open, but no other
    locks are held in open path.

    Signed-off-by: Jiri Slaby
    Cc: Alan Cox
    Cc: Aristeu Rozanski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

22 Jul, 2008

1 commit


07 Jun, 2008

2 commits

  • Lockdep says we can't take tasklist lock or sighand lock inside ctrl_lock.

    Signed-off-by: Nick Piggin
    Acked-by: Alan Cox
    Cc: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • Original report: """I used to force my console to black-on-white by the
    command `setterm -inversescreen on`. In 2.6.26-rc4, I get lots of black
    background characters."""

    Another addendum to commit c9e587ab. This was previously missed out since
    I was not aware of what vc_decscnm was for.

    Signed-off-by: Jan Engelhardt
    Reported-by:
    Tested-by:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Engelhardt
     

04 Jun, 2008

1 commit

  • By turning off the new CONSOLE_TRANSLATIONS option and dropping the
    associated code and tables from the kernel, we can save about 7KiB.

    Taken from linux-tiny project by Tim Bird and mangled further by dwmw2.

    Signed-off-by: Tim Bird
    Signed-off-by: David Woodhouse

    David Woodhouse