1. 16 5月, 2017 1 次提交
    • O
      tty: export tty_open_by_driver · 12e84c71
      Okash Khawaja 提交于
      This exports tty_open_by_driver so that it can be called from other
      places inside the kernel. The checks for null file pointer are based on
      Alan Cox's patch here:
      http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1215095.html.
      Description below is quoted from it:
      
      "[RFC] tty_port: allow a port to be opened with a tty that has no file handle
      
          Let us create tty objects entirely in kernel space. Untested proposal to
          show why all the ideas around rewriting half the uart stack are not needed.
      
          With this a kernel created non file backed tty object could be used to handle
          data, and set terminal modes. Not all ldiscs can cope with this as N_TTY in
          particular has to work back to the fs/tty layer.
      
          The tty_port code is however otherwise clean of file handles as far as I can
          tell as is the low level tty port write path used by the ldisc, the
          configuration low level interfaces and most of the ldiscs.
      
          Currently you don't have any exposure to see tty hangups because those are
          built around the file layer. However a) it's a fixed port so you probably
          don't care about that b) if you do we can add a callback and c) you almost
          certainly don't want the userspace tear down/rebuild behaviour anyway.
      
          This should however be sufficient if we wanted for example to enumerate all
          the bluetooth bound fixed ports via ACPI and make them directly available.
      
          It doesn't deal with the case of a user opening a port that's also kernel
          opened and that would need some locking out (so it returned EBUSY if bound
          to a kernel device of some kind). That needs resolving along with how you
          "up" or "down" your new bluetooth device, or enumerate it while providing
          the existing tty API to avoid regressions (and to debug)."
      
      The exported funtion is used later in this patch set to gain access to tty_struct.
      
      [changed export symbol level - gkh]
      Signed-off-by: NOkash Khawaja <okash.khawaja@gmail.com>
      Reviewed-by: NSamuel Thibault <samuel.thibault@ens-lyon.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      12e84c71
  2. 09 5月, 2017 1 次提交
    • K
      format-security: move static strings to const · 06324664
      Kees Cook 提交于
      While examining output from trial builds with -Wformat-security enabled,
      many strings were found that should be defined as "const", or as a char
      array instead of char pointer.  This makes some static analysis easier,
      by producing fewer false positives.
      
      As these are all trivial changes, it seemed best to put them all in a
      single patch rather than chopping them up per maintainer.
      
      Link: http://lkml.kernel.org/r/20170405214711.GA5711@beastSigned-off-by: NKees Cook <keescook@chromium.org>
      Acked-by: Jes Sorensen <jes@trained-monkey.org>	[runner.c]
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Yisen Zhuang <yisen.zhuang@huawei.com>
      Cc: Salil Mehta <salil.mehta@huawei.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Matt Redfearn <matt.redfearn@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Mugunthan V N <mugunthanvnm@ti.com>
      Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
      Cc: Jarod Wilson <jarod@redhat.com>
      Cc: Florian Westphal <fw@strlen.de>
      Cc: Antonio Quartulli <a@unstable.cc>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Kejian Yan <yankejian@huawei.com>
      Cc: Daode Huang <huangdaode@hisilicon.com>
      Cc: Qianqian Xie <xieqianqian@huawei.com>
      Cc: Philippe Reynes <tremyfr@gmail.com>
      Cc: Colin Ian King <colin.king@canonical.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Christian Gromm <christian.gromm@microchip.com>
      Cc: Andrey Shvetsov <andrey.shvetsov@k2l.de>
      Cc: Jason Litzinger <jlitzingerdev@gmail.com>
      Cc: WANG Cong <xiyou.wangcong@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      06324664
  3. 04 5月, 2017 1 次提交
    • M
      oom: improve oom disable handling · d75da004
      Michal Hocko 提交于
      Tetsuo has reported that sysrq triggered OOM killer will print a
      misleading information when no tasks are selected:
      
        sysrq: SysRq : Manual OOM execution
        Out of memory: Kill process 4468 ((agetty)) score 0 or sacrifice child
        Killed process 4468 ((agetty)) total-vm:43704kB, anon-rss:1760kB, file-rss:0kB, shmem-rss:0kB
        sysrq: SysRq : Manual OOM execution
        Out of memory: Kill process 4469 (systemd-cgroups) score 0 or sacrifice child
        Killed process 4469 (systemd-cgroups) total-vm:10704kB, anon-rss:120kB, file-rss:0kB, shmem-rss:0kB
        sysrq: SysRq : Manual OOM execution
        sysrq: OOM request ignored because killer is disabled
        sysrq: SysRq : Manual OOM execution
        sysrq: OOM request ignored because killer is disabled
        sysrq: SysRq : Manual OOM execution
        sysrq: OOM request ignored because killer is disabled
      
      The real reason is that there are no eligible tasks for the OOM killer
      to select but since commit 7c5f64f8 ("mm: oom: deduplicate victim
      selection code for memcg and global oom") the semantic of out_of_memory
      has changed without updating moom_callback.
      
      This patch updates moom_callback to tell that no task was eligible which
      is the case for both oom killer disabled and no eligible tasks.  In
      order to help distinguish first case from the second add printk to both
      oom_killer_{enable,disable}.  This information is useful on its own
      because it might help debugging potential memory allocation failures.
      
      Fixes: 7c5f64f8 ("mm: oom: deduplicate victim selection code for memcg and global oom")
      Link: http://lkml.kernel.org/r/20170404134705.6361-1-mhocko@kernel.orgSigned-off-by: NMichal Hocko <mhocko@suse.com>
      Reported-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d75da004
  4. 24 4月, 2017 1 次提交
  5. 20 4月, 2017 1 次提交
    • D
      Annotate hardware config module parameters in drivers/tty/ · 3b60daf8
      David Howells 提交于
      When the kernel is running in secure boot mode, we lock down the kernel to
      prevent userspace from modifying the running kernel image.  Whilst this
      includes prohibiting access to things like /dev/mem, it must also prevent
      access by means of configuring driver modules in such a way as to cause a
      device to access or modify the kernel image.
      
      To this end, annotate module_param* statements that refer to hardware
      configuration and indicate for future reference what type of parameter they
      specify.  The parameter parser in the core sees this information and can
      skip such parameters with an error message if the kernel is locked down.
      The module initialisation then runs as normal, but just sees whatever the
      default values for those parameters is.
      
      Note that we do still need to do the module initialisation because some
      drivers have viable defaults set in case parameters aren't specified and
      some drivers support automatic configuration (e.g. PNP or PCI) in addition
      to manually coded parameters.
      
      This patch annotates drivers in drivers/tty/.
      Suggested-by: NAlan Cox <gnomes@lxorguk.ukuu.org.uk>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cc: Jiri Slaby <jslaby@suse.com>
      cc: linux-serial@vger.kernel.org
      3b60daf8
  6. 19 4月, 2017 4 次提交
  7. 18 4月, 2017 2 次提交
  8. 14 4月, 2017 1 次提交
    • G
      Revert "tty: don't panic on OOM in tty_set_ldisc()" · a8983d01
      Greg Kroah-Hartman 提交于
      This reverts commit 5362544b as it is
      reported to cause a reproducable crash.
      
      Fixes: 5362544b ("tty: don't panic on OOM in tty_set_ldisc()")
      Reported-by: NVegard Nossum <vegard.nossum@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: <syzkaller@googlegroups.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
      a8983d01
  9. 13 4月, 2017 3 次提交
  10. 12 4月, 2017 5 次提交
    • A
      vt: make mouse selection of non-ASCII consistent · 7f1534e1
      Adam Borowski 提交于
      For some reason a handful of ISO-8859-1 symbols are excluded from "word
      chars" while the vast majority of Unicode is hard-coded as included, even
      when inappropriate (we really would want to _not_ select line-drawing/etc).
      Those symbols are: ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷
      
      Thus, let's not special-case any non-ASCII anymore.  Attempts to set these
      via ioctl will be silently ignored.
      
      As an extra bonus, we debloat the kernel by 128 bytes.
      Signed-off-by: NAdam Borowski <kilobyte@angband.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7f1534e1
    • A
      vt: set mouse selection word-chars to gpm's default · 7d6d44ae
      Adam Borowski 提交于
      Since forever, gpm was this code's only user, and it overrides the table on
      start so the default was never seen -- until Bill Allombert's "consolation"
      came in.  The in-kernel set is "A-Za-z0-9_" which fails to catch typical
      file names, etc.  Let's change this to gpm's conservative default, ie
      "-A-Za-z0-9_./"; most terminals include more, for example xfce4-terminal has
      "-A-Za-z0-9,./?%&#:_=+@~".
      
      There's some discussion at https://bugs.debian.org/846587Signed-off-by: NAdam Borowski <kilobyte@angband.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7d6d44ae
    • P
      imx-serial: Reduce RX DMA startup latency when opening for reading · 18a42088
      Peter Senna Tschudin 提交于
      Reduce RX DMA start latency for the first reception when port is opened
      for reading. Instead of waiting for an interrupt signaling data on RX
      FIFO or data too old on RX FIFO, start RX DMA immediately when the
      serial port is opened for reading.
      
      Before this patch, the average RX DMA latency for the first reception
      was 42489 microseconds with a standard deviation of 25721 microseconds
      in 36 samples.
      
      After the patch the average RX DMA latency for the first reception, when
      the serial port is opened for reading, is 653 microseconds with a
      standard deviation of 294 microseconds in 36 samples.
      Signed-off-by: NPeter Senna Tschudin <peter.senna@collabora.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      18a42088
    • J
      serial: omap: suspend device on probe errors · 77e6fe7f
      Johan Hovold 提交于
      Make sure to actually suspend the device before returning after a failed
      (or deferred) probe.
      
      Note that autosuspend must be disabled before runtime pm is disabled in
      order to balance the usage count due to a negative autosuspend delay as
      well as to make the final put suspend the device synchronously.
      
      Fixes: 388bc262 ("omap-serial: Fix the error handling in the omap_serial probe")
      Cc: Shubhrajyoti D <shubhrajyoti@ti.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      77e6fe7f
    • J
      serial: omap: fix runtime-pm handling on unbind · 099bd73d
      Johan Hovold 提交于
      An unbalanced and misplaced synchronous put was used to suspend the
      device on driver unbind, something which with a likewise misplaced
      pm_runtime_disable leads to external aborts when an open port is being
      removed.
      
      Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa024010
      ...
      [<c046e760>] (serial_omap_set_mctrl) from [<c046a064>] (uart_update_mctrl+0x50/0x60)
      [<c046a064>] (uart_update_mctrl) from [<c046a400>] (uart_shutdown+0xbc/0x138)
      [<c046a400>] (uart_shutdown) from [<c046bd2c>] (uart_hangup+0x94/0x190)
      [<c046bd2c>] (uart_hangup) from [<c045b760>] (__tty_hangup+0x404/0x41c)
      [<c045b760>] (__tty_hangup) from [<c045b794>] (tty_vhangup+0x1c/0x20)
      [<c045b794>] (tty_vhangup) from [<c046ccc8>] (uart_remove_one_port+0xec/0x260)
      [<c046ccc8>] (uart_remove_one_port) from [<c046ef4c>] (serial_omap_remove+0x40/0x60)
      [<c046ef4c>] (serial_omap_remove) from [<c04845e8>] (platform_drv_remove+0x34/0x4c)
      
      Fix this up by resuming the device before deregistering the port and by
      suspending and disabling runtime pm only after the port has been
      removed.
      
      Also make sure to disable autosuspend before disabling runtime pm so
      that the usage count is balanced and device actually suspended before
      returning.
      
      Note that due to a negative autosuspend delay being set in probe, the
      unbalanced put would actually suspend the device on first driver unbind,
      while rebinding and again unbinding would result in a negative
      power.usage_count.
      
      Fixes: 7e9c8e7d ("serial: omap: make sure to suspend device before remove")
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      099bd73d
  11. 09 4月, 2017 11 次提交
  12. 05 4月, 2017 1 次提交
  13. 01 4月, 2017 1 次提交
  14. 31 3月, 2017 7 次提交