1. 17 Dec, 2018 1 commit
    • Guenter Roeck's avatar
      staging: speakup: Replace strncpy with memcpy · 16906e5a
      Guenter Roeck authored
      commit fd29edc7
      
       upstream.
      
      gcc 8.1.0 generates the following warnings.
      
      drivers/staging/speakup/kobjects.c: In function 'punc_store':
      drivers/staging/speakup/kobjects.c:522:2: warning:
      	'strncpy' output truncated before terminating nul
      	copying as many bytes from a string as its length
      drivers/staging/speakup/kobjects.c:504:6: note: length computed here
      
      drivers/staging/speakup/kobjects.c: In function 'synth_store':
      drivers/staging/speakup/kobjects.c:391:2: warning:
      	'strncpy' output truncated before terminating nul
      	copying as many bytes from a string as its length
      drivers/staging/speakup/kobjects.c:388:8: note: length computed here
      
      Using strncpy() is indeed less than perfect since the length of data to
      be copied has already been determined with strlen(). Replace strncpy()
      with memcpy() to address the warning and optimize the code a little.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      16906e5a
  2. 28 Jul, 2018 1 commit
  3. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard...
      b2441318
  4. 18 Sep, 2017 1 commit
    • Okash Khawaja's avatar
      staging: speakup: fix speakup-r empty line lockup · e5f5d0e2
      Okash Khawaja authored
      
      
      When cursor is at beginning of an empty or whitespace-only line and
      speakup-r typed, kernel locks up. This happens because deadlock of in
      input_event function over dev->event_lock, as demonstrated by lockdep
      logs. The reason for that is speakup simulates a down arrow - because
      cursor is at an empty line - while inside key press notifier handler
      which is ultimately triggered from input_event function. The simulated
      key press leads to input_event being called again, this time under its
      own context. So the spinlock is dev->event_lock is acquired while still
      being held.
      
      This patch ensures that key press is not simulated from inside key press
      notifier handler. Instead it delegates to cursor_timer. It starts the
      timer and passes RA_DOWN_ARROW as argument. When timer handler runs and
      sees RA_DOWN_ARROW, it will then call kbd_fakekey2(RA_DOWN_ARROW) which
      will correctly simulate the keypress inside timer context.
      
      When not inside key press notifier callback, the behaviour will remain
      the same as before this patch.
      Signed-off-by: default avatarOkash Khawaja <okash.khawaja@gmail.com>
      Reviewed-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e5f5d0e2
  5. 28 Aug, 2017 1 commit
  6. 18 Aug, 2017 2 commits
  7. 18 Jul, 2017 3 commits
    • Okash Khawaja's avatar
      staging: speakup: safely register and unregister ldisc · e23a9b43
      Okash Khawaja authored
      
      
      This patch makes use of functions added in the previous patch. It
      registers ldisc during init of main speakup module and unregisters it
      during exit. It also removes the code to register ldisc every time a
      synth module is loaded. This way we only register the ldisc once when
      main speakup module is loaded. Since main speakup module is required by
      all synth modules, it is only unloaded when all synths have been
      unloaded. Therefore we unregister the ldisc once, when all speakup
      related references to the ldisc have returned. In unlikely scenario of
      something outside speakup using the ldisc, the ldisc refcount check in
      tty_unregister_ldisc will ensure that it is not unregistered while in
      use.
      
      The function to register ldisc doesn't cause speakup init function to
      fail. That is different from current behaviour where failure to register
      ldisc results in failure to load the specific synth module. This is
      because speakup module is also required by those synths which don't use
      tty and ldisc. We don't want to prevent those modules from loading when
      ldisc fails to register. The synth modules will correctly fail when
      trying to set N_SPEAKUP to tty, if ldisc registrationi had failed.
      Signed-off-by: default avatarOkash Khawaja <okash.khawaja@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e23a9b43
    • Okash Khawaja's avatar
      staging: speakup: add functions to register and unregister ldisc · 9f8dced2
      Okash Khawaja authored
      
      
      This patch adds the above two functions and makes them available to
      main.c where they will be called during init and exit functions of
      main speakup module. Following patch will make use of them.
      Signed-off-by: default avatarOkash Khawaja <okash.khawaja@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9f8dced2
    • Okash Khawaja's avatar
      staging: speakup: safely close tty · 216ce296
      Okash Khawaja authored
      
      
      Speakup opens tty using tty_open_by_driver. When closing, it calls
      tty_ldisc_release but doesn't close and remove the tty itself. As a
      result, that tty cannot be opened from user space. This patch calls
      tty_release_struct which ensures that tty is safely removed and freed
      up. It also calls tty_ldisc_release, so speakup doesn't need to call it.
      Signed-off-by: default avatarOkash Khawaja <okash.khawaja@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      216ce296
  8. 29 Jun, 2017 1 commit
  9. 27 Jun, 2017 2 commits
  10. 25 Jun, 2017 1 commit
  11. 13 Jun, 2017 2 commits
  12. 06 Jun, 2017 4 commits
  13. 03 Jun, 2017 2 commits
  14. 25 May, 2017 2 commits
  15. 16 May, 2017 5 commits
  16. 15 May, 2017 3 commits
  17. 25 Apr, 2017 1 commit
  18. 20 Apr, 2017 1 commit
    • David Howells's avatar
      Annotate hardware config module parameters in drivers/staging/speakup/ · dbf05cb0
      David Howells authored
      
      
      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/staging/speakup/.
      Suggested-by: default avatarAlan Cox <gnomes@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cc: speakup@linux-speakup.org
      cc: devel@driverdev.osuosl.org
      dbf05cb0
  19. 27 Mar, 2017 4 commits
  20. 23 Mar, 2017 2 commits