1. 07 Jun, 2014 31 commits
  2. 18 May, 2014 9 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.4.91 · 25c7b871
      Greg Kroah-Hartman authored
      25c7b871
    • Mikulas Patocka's avatar
      tgafb: fix mode setting with fbset · 3ddd37aa
      Mikulas Patocka authored
      commit 62496658 upstream.
      
      Mode setting in the TGA driver is broken for these reasons:
      
      - info->fix.line_length is set just once in tgafb_init_fix function. If
        we change videomode, info->fix.line_length is not recalculated - so
        the video mode is changed but the screen is corrupted because of wrong
        info->fix.line_length.
      
      - info->fix.smem_len is set in tgafb_init_fix to the size of the default
        video mode (640x480). If we set a higher resolution,
        info->fix.smem_len is smaller than the current screen size, preventing
        the userspace program from mapping the framebuffer.
      
      This patch fixes it:
      
      - info->fix.line_length initialization is moved to tgafb_set_par so that
        it is recalculated with each mode change.
      
      - info->fix.smem_len is set to a fixed value representing the real
        amount of video ram (the values are taken from xfree86 driver).
      
      - add a check to tgafb_check_var to prevent us from setting a videomode
        that doesn't fit into videoram.
      
      - in tgafb_register, tgafb_init_fix is moved upwards, to be called
        before fb_find_mode (because fb_find_mode already needs the videoram
        size set in tgafb_init_fix).
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      3ddd37aa
    • Andreas Schwab's avatar
      powerpc: Add vr save/restore functions · 7dff32ef
      Andreas Schwab authored
      commit 8fe9c93e upstream.
      
      GCC 4.8 now generates out-of-line vr save/restore functions when
      optimizing for size.  They are needed for the raid6 altivec support.
      Signed-off-by: default avatarAndreas Schwab <schwab@linux-m68k.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7dff32ef
    • Steven Rostedt (Red Hat)'s avatar
      tracepoint: Do not waste memory on mods with no tracepoints · 7bd3c53d
      Steven Rostedt (Red Hat) authored
      commit 7dec935a upstream.
      
      No reason to allocate tp_module structures for modules that have no
      tracepoints. This just wastes memory.
      
      Fixes: b75ef8b4 "Tracepoint: Dissociate from module mutex"
      Acked-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7bd3c53d
    • Thomas Graf's avatar
      netfilter: Can't fail and free after table replacement · 8ed40c12
      Thomas Graf authored
      commit c58dd2dd upstream.
      
      All xtables variants suffer from the defect that the copy_to_user()
      to copy the counters to user memory may fail after the table has
      already been exchanged and thus exposed. Return an error at this
      point will result in freeing the already exposed table. Any
      subsequent packet processing will result in a kernel panic.
      
      We can't copy the counters before exposing the new tables as we
      want provide the counter state after the old table has been
      unhooked. Therefore convert this into a silent error.
      
      Cc: Florian Westphal <fw@strlen.de>
      Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8ed40c12
    • Joe Perches's avatar
      net: Add net_ratelimited_function and net_<level>_ratelimited macros · 4ede126e
      Joe Perches authored
      commit 3a3bfb61 upstream.
      
      __ratelimit() can be considered an inverted bool test because
      it returns true when not ratelimited.  Several tests in the
      kernel tree use this __ratelimit() function incorrectly.
      
      No net_ratelimit uses are incorrect currently though.
      
      Most uses of net_ratelimit are to log something via printk or
      pr_<level>.
      
      In order to minimize the uses of net_ratelimit, and to start
      standardizing the code style used for __ratelimit() and net_ratelimit(),
      add a net_ratelimited_function() macro and net_<level>_ratelimited()
      logging macros similar to pr_<level>_ratelimited that use the global
      net_ratelimit instead of a static per call site "struct ratelimit_state".
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4ede126e
    • Andrey Vagin's avatar
      netfilter: nf_conntrack: reserve two bytes for nf_ct_ext->len · 4b87f408
      Andrey Vagin authored
      commit 223b02d9 upstream.
      
      "len" contains sizeof(nf_ct_ext) and size of extensions. In a worst
      case it can contain all extensions. Bellow you can find sizes for all
      types of extensions. Their sum is definitely bigger than 256.
      
      nf_ct_ext_types[0]->len = 24
      nf_ct_ext_types[1]->len = 32
      nf_ct_ext_types[2]->len = 24
      nf_ct_ext_types[3]->len = 32
      nf_ct_ext_types[4]->len = 152
      nf_ct_ext_types[5]->len = 2
      nf_ct_ext_types[6]->len = 16
      nf_ct_ext_types[7]->len = 8
      
      I have seen "len" up to 280 and my host has crashes w/o this patch.
      
      The right way to fix this problem is reducing the size of the ecache
      extension (4) and Florian is going to do this, but these changes will
      be quite large to be appropriate for a stable tree.
      
      Fixes: 5b423f6a (netfilter: nf_conntrack: fix racy timer handling with reliable)
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarAndrey Vagin <avagin@openvz.org>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4b87f408
    • Roman Pen's avatar
      blktrace: fix accounting of partially completed requests · 14eee5bd
      Roman Pen authored
      commit af5040da upstream.
      
      trace_block_rq_complete does not take into account that request can
      be partially completed, so we can get the following incorrect output
      of blkparser:
      
        C   R 232 + 240 [0]
        C   R 240 + 232 [0]
        C   R 248 + 224 [0]
        C   R 256 + 216 [0]
      
      but should be:
      
        C   R 232 + 8 [0]
        C   R 240 + 8 [0]
        C   R 248 + 8 [0]
        C   R 256 + 8 [0]
      
      Also, the whole output summary statistics of completed requests and
      final throughput will be incorrect.
      
      This patch takes into account real completion size of the request and
      fixes wrong completion accounting.
      Signed-off-by: default avatarRoman Pen <r.peniaev@gmail.com>
      CC: Steven Rostedt <rostedt@goodmis.org>
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      CC: Ingo Molnar <mingo@redhat.com>
      CC: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      14eee5bd
    • Peter Hurley's avatar
      n_tty: Fix n_tty_write crash when echoing in raw mode · 664c0fc6
      Peter Hurley authored
      commit 4291086b upstream.
      
      The tty atomic_write_lock does not provide an exclusion guarantee for
      the tty driver if the termios settings are LECHO & !OPOST.  And since
      it is unexpected and not allowed to call TTY buffer helpers like
      tty_insert_flip_string concurrently, this may lead to crashes when
      concurrect writers call pty_write. In that case the following two
      writers:
      * the ECHOing from a workqueue and
      * pty_write from the process
      race and can overflow the corresponding TTY buffer like follows.
      
      If we look into tty_insert_flip_string_fixed_flag, there is:
        int space = __tty_buffer_request_room(port, goal, flags);
        struct tty_buffer *tb = port->buf.tail;
        ...
        memcpy(char_buf_ptr(tb, tb->used), chars, space);
        ...
        tb->used += space;
      
      so the race of the two can result in something like this:
                    A                                B
      __tty_buffer_request_room
                                        __tty_buffer_request_room
      memcpy(buf(tb->used), ...)
      tb->used += space;
                                        memcpy(buf(tb->used), ...) ->BOOM
      
      B's memcpy is past the tty_buffer due to the previous A's tb->used
      increment.
      
      Since the N_TTY line discipline input processing can output
      concurrently with a tty write, obtain the N_TTY ldisc output_lock to
      serialize echo output with normal tty writes.  This ensures the tty
      buffer helper tty_insert_flip_string is not called concurrently and
      everything is fine.
      
      Note that this is nicely reproducible by an ordinary user using
      forkpty and some setup around that (raw termios + ECHO). And it is
      present in kernels at least after commit
      d945cb9c (pty: Rework the pty layer to
      use the normal buffering logic) in 2.6.31-rc3.
      
      js: add more info to the commit log
      js: switch to bool
      js: lock unconditionally
      js: lock only the tty->ops->write call
      
      References: CVE-2014-0196
      Reported-and-tested-by: default avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2: output_lock is a member of struct tty_struct]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      664c0fc6