24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

08 Jul, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200707180857.GA30600@embeddedor
    Signed-off-by: Dmitry Torokhov

    Gustavo A. R. Silva
     

11 Jan, 2020

6 commits

  • Drop the second, redundant reinitialisation of the endpoint-descriptor
    pointer from probe.

    Signed-off-by: Johan Hovold
    Acked-by: Vladis Dronov
    Link: https://lore.kernel.org/r/20191210113737.4016-7-johan@kernel.org
    Signed-off-by: Dmitry Torokhov

    Johan Hovold
     
  • Make sure to use the current altsetting when printing size of any extra
    descriptors of the interface.

    Also fix the s/endpoint/interface/ mixup in the message itself.

    Signed-off-by: Johan Hovold
    Acked-by: Vladis Dronov
    Link: https://lore.kernel.org/r/20191210113737.4016-6-johan@kernel.org
    Signed-off-by: Dmitry Torokhov

    Johan Hovold
     
  • The driver was checking the number of endpoints of the first alternate
    setting instead of the current one, something which could lead to the
    driver binding to an invalid interface.

    This in turn could cause the driver to misbehave or trigger a WARN() in
    usb_submit_urb() that kernels with panic_on_warn set would choke on.

    Fixes: 162f98dea487 ("Input: gtco - fix crash on detecting device without endpoints")
    Signed-off-by: Johan Hovold
    Acked-by: Vladis Dronov
    Link: https://lore.kernel.org/r/20191210113737.4016-5-johan@kernel.org
    Signed-off-by: Dmitry Torokhov

    Johan Hovold
     
  • Make sure to always use the descriptors of the current alternate setting
    to avoid future issues when accessing fields that may differ between
    settings.

    Signed-off-by: Johan Hovold
    Acked-by: Vladis Dronov
    Link: https://lore.kernel.org/r/20191210113737.4016-4-johan@kernel.org
    Signed-off-by: Dmitry Torokhov

    Johan Hovold
     
  • The driver was checking the number of endpoints of the first alternate
    setting instead of the current one, something which could lead to the
    driver binding to an invalid interface.

    This in turn could cause the driver to misbehave or trigger a WARN() in
    usb_submit_urb() that kernels with panic_on_warn set would choke on.

    Fixes: 8e20cf2bce12 ("Input: aiptek - fix crash on detecting device without endpoints")
    Signed-off-by: Johan Hovold
    Acked-by: Vladis Dronov
    Link: https://lore.kernel.org/r/20191210113737.4016-3-johan@kernel.org
    Signed-off-by: Dmitry Torokhov

    Johan Hovold
     
  • The driver was checking the number of endpoints of the first alternate
    setting instead of the current one, something which could be used by a
    malicious device (or USB descriptor fuzzer) to trigger a NULL-pointer
    dereference.

    Fixes: 1afca2b66aac ("Input: add Pegasus Notetaker tablet driver")
    Signed-off-by: Johan Hovold
    Acked-by: Martin Kepplinger
    Acked-by: Vladis Dronov
    Link: https://lore.kernel.org/r/20191210113737.4016-2-johan@kernel.org
    Signed-off-by: Dmitry Torokhov

    Johan Hovold
     

23 Nov, 2019

1 commit

  • Adjust indentation from spaces to tab (+optional two spaces) as in
    coding style with command like:
    $ sed -e 's/^ /\t/' -i */Kconfig

    Signed-off-by: Krzysztof Kozlowski
    Link: https://lore.kernel.org/r/1574306373-29581-1-git-send-email-krzk@kernel.org
    Signed-off-by: Dmitry Torokhov

    Krzysztof Kozlowski
     

02 Aug, 2019

1 commit


16 Jul, 2019

1 commit


13 Jul, 2019

1 commit

  • The GTCO tablet input driver configures itself from an HID report sent
    via USB during the initial enumeration process. Some debugging messages
    are generated during the parsing. A debugging message indentation
    counter is not bounds checked, leading to the ability for a specially
    crafted HID report to cause '-' and null bytes be written past the end
    of the indentation array. As long as the kernel has CONFIG_DYNAMIC_DEBUG
    enabled, this code will not be optimized out. This was discovered
    during code review after a previous syzkaller bug was found in this
    driver.

    Signed-off-by: Grant Hernandez
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov

    Grant Hernandez
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not write to the free software foundation inc
    59 temple place suite 330 boston ma 02111 1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1334 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version of 2 of the license or
    at your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 4 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Richard Fontana
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520071858.207758043@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

2 commits


10 Mar, 2019

1 commit


28 Jul, 2018

1 commit


18 Mar, 2018

2 commits

  • If the device is unused and suspended, a call to open will cause the
    device to autoresume through the call to usb_autopm_get_interface().

    input_dev->users is already incremented by the input subsystem,
    therefore this expression will always be evaluated to true:

    if (pegasus->dev->users && usb_submit_urb(pegasus->irq, GFP_NOIO) < 0)
    retval = -EIO;

    The same URB will then be fail when resubmitted in pegasus_open().

    Introduce pegasus->is_open to keep track of the state instead.

    Signed-off-by: Marcus Folkesson
    Signed-off-by: Dmitry Torokhov

    Marcus Folkesson
     
  • usb_autopm_get_interface() that is called in pegasus_open() does an
    autoresume if the device is suspended.

    input_dev->mutex used in pegasus_resume() is in this case already
    taken by the input subsystem and will cause a deadlock.

    Signed-off-by: Marcus Folkesson
    Signed-off-by: Dmitry Torokhov

    Marcus Folkesson
     

18 Jan, 2018

1 commit

  • Inline macro for MODULE_LICENSE to make the license information easy to
    find, eg with grep. Inline the other module-related macros at the same
    time.

    A simplified version of the semantic patch for the MODULE_LICENSE
    case is as follows: (http://coccinelle.lip6.fr/)

    //
    @s@
    identifier i; expression e;
    @@

    @@
    declarer name MODULE_LICENSE;
    identifier s.i;
    expression s.e;
    @@
    MODULE_LICENSE(
    - i
    + e
    );
    //

    Signed-off-by: Julia Lawall
    [dtor: added a couple of drivers missed by the script, removed a few unused
    DRIVER_VERSION macros]
    Signed-off-by: Dmitry Torokhov

    Julia Lawall
     

17 Jan, 2018

1 commit

  • There is no need to #define the license of the driver, just put it in
    the MODULE_LICENSE() line directly as a text string.

    This allows tools that check that the module license matches the source
    code license to work properly, as there is no need to unwind the
    unneeded dereference. For some of these drivers, the #define is just a
    few lines above the MODULE_LICENSE() line, which is extra pointless.

    Reported-by: Philippe Ombredanne
    Signed-off-by: Greg Kroah-Hartman
    Reviewed-by: Philippe Ombredanne
    Signed-off-by: Dmitry Torokhov

    Greg Kroah-Hartman
     

03 Nov, 2017

1 commit

  • …el/git/gregkh/driver-core

    Pull initial SPDX identifiers from Greg KH:
    "License cleanup: add SPDX license identifiers to some files

    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 license headers were used, and references to
    license had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied
    to a file was done in a spreadsheet of side by side results from of
    the output of two independent scanners (ScanCode & Windriver)
    producing SPDX tag:value files created by Philippe Ombredanne.
    Philippe prepared the base worksheet, and did an initial spot review
    of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537
    files assessed. Kate Stewart did a file by file comparison of the
    scanner results in the spreadsheet to determine which SPDX license
    identifier(s) to be applied to the file. She confirmed any
    determination that was not immediately clear with lawyers working with
    the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:

    - Files considered eligible had to be source code files.

    - Make and config files were included as candidates if they contained
    >5 lines of source

    - File already had some variant of a license header in it (even if <5
    lines).

    All documentation files were explicitly excluded.

    The following heuristics were used to determine which SPDX license
    identifiers to apply.

    - when both scanners couldn't find any license traces, file was
    considered to have no license information in it, and the top level
    COPYING file license applied.

    For non */uapi/* files that summary was:

    SPDX license identifier # files
    ---------------------------------------------------|-------
    GPL-2.0 11139

    and resulted in the first patch in this series.

    If that file was a */uapi/* path one, it was "GPL-2.0 WITH
    Linux-syscall-note" otherwise it was "GPL-2.0". Results of that
    was:

    SPDX license identifier # files
    ---------------------------------------------------|-------
    GPL-2.0 WITH Linux-syscall-note 930

    and resulted in the second patch in this series.

    - if a file had some form of licensing information in it, and was one
    of the */uapi/* ones, it was denoted with the Linux-syscall-note if
    any GPL family license was found in the file or had no licensing in
    it (per prior point). Results summary:

    SPDX license identifier # files
    ---------------------------------------------------|------
    GPL-2.0 WITH Linux-syscall-note 270
    GPL-2.0+ WITH Linux-syscall-note 169
    ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
    ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
    LGPL-2.1+ WITH Linux-syscall-note 15
    GPL-1.0+ WITH Linux-syscall-note 14
    ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
    LGPL-2.0+ WITH Linux-syscall-note 4
    LGPL-2.1 WITH Linux-syscall-note 3
    ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
    ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1

    and that resulted in the third patch in this series.

    - when the two scanners agreed on the detected license(s), that
    became the concluded license(s).

    - when there was disagreement between the two scanners (one detected
    a license but the other didn't, or they both detected different
    licenses) a manual inspection of the file occurred.

    - In most cases a manual inspection of the information in the file
    resulted in a clear resolution of the license that should apply
    (and which scanner probably needed to revisit its heuristics).

    - When it was not immediately clear, the license identifier was
    confirmed with lawyers working with the Linux Foundation.

    - If there was any question as to the appropriate license identifier,
    the file was flagged for further research and to be revisited later
    in time.

    In total, over 70 hours of logged manual review was done on the
    spreadsheet to determine the SPDX license identifiers to apply to the
    source files by Kate, Philippe, Thomas and, in some cases,
    confirmation by lawyers working with the Linux Foundation.

    Kate also obtained a third independent scan of the 4.13 code base from
    FOSSology, and compared selected files where the other two scanners
    disagreed against that SPDX file, to see if there was new insights.
    The Windriver scanner is based on an older version of FOSSology in
    part, so they are related.

    Thomas did random spot checks in about 500 files from the spreadsheets
    for the uapi headers and agreed with SPDX license identifier in the
    files he inspected. For the non-uapi files Thomas did random spot
    checks in about 15000 files.

    In initial set of patches against 4.14-rc6, 3 files were found to have
    copy/paste license identifier errors, and have been fixed to reflect
    the correct identifier.

    Additionally Philippe spent 10 hours this week doing a detailed manual
    inspection and review of the 12,461 patched files from the initial
    patch version early this week with:

    - a full scancode scan run, collecting the matched texts, detected
    license ids and scores

    - reviewing anything where there was a license detected (about 500+
    files) to ensure that the applied SPDX license was correct

    - reviewing anything where there was no detection but the patch
    license was not GPL-2.0 WITH Linux-syscall-note to ensure that the
    applied SPDX license was correct

    This produced a worksheet with 20 files needing minor correction. This
    worksheet was then exported into 3 different .csv files for the
    different types of files to be modified.

    These .csv files were then reviewed by Greg. Thomas wrote a script to
    parse the csv files and add the proper SPDX tag to the file, in the
    format that the file expected. This script was further refined by Greg
    based on the output to detect more types of files automatically and to
    distinguish between header and source .c files (which need different
    comment types.) Finally Greg ran the script using the .csv files to
    generate the patches.

    Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
    Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
    Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

    * tag 'spdx_identifiers-4.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    License cleanup: add SPDX license identifier to uapi header files with a license
    License cleanup: add SPDX license identifier to uapi header files with no license
    License cleanup: add SPDX GPL-2.0 license identifier to files with no license

    Linus Torvalds
     

02 Nov, 2017

1 commit

  • 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 license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

28 Oct, 2017

1 commit

  • parse_hid_report_descriptor() has a while (i < length) loop, which
    only guarantees that there's at least 1 byte in the buffer, but the
    loop body can read multiple bytes which causes out-of-bounds access.

    Reported-by: Andrey Konovalov
    Reviewed-by: Andrey Konovalov
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     

19 Aug, 2017

1 commit


08 Aug, 2017

2 commits


13 Jul, 2017

1 commit

  • attribute_groups are not supposed to change at runtime. All functions
    working with attribute_groups provided by work with const
    attribute_group. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    9941 1560 0 11501 2ced drivers/input/tablet/aiptek.o

    File size After adding 'const':
    text data bss dec hex filename
    10005 1496 0 11501 2ced drivers/input/tablet/aiptek.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: Dmitry Torokhov

    Arvind Yadav
     

17 Mar, 2017

2 commits


25 Dec, 2016

1 commit


26 Aug, 2016

1 commit


20 Jul, 2016

5 commits


03 Jun, 2016

1 commit

  • This adds a driver for the Pegasus Notetaker Pen. When connected,
    this uses the Pen as an input tablet.

    This device was sold in various different brandings, for example
    "Pegasus Mobile Notetaker M210",
    "Genie e-note The Notetaker",
    "Staedtler Digital ballpoint pen 990 01",
    "IRISnotes Express" or
    "NEWLink Digital Note Taker".

    Here's an example, so that you know what we are talking about:
    http://www.genie-online.de/genie-e-note-2/

    https://pegatech.blogspot.com/ seems to be a remaining official resource.

    This device can also transfer saved (offline recorded handwritten) data and
    there are userspace programs that do this, see https://launchpad.net/m210
    (Well, alternatively there are really fast scanners out there :)

    It's *really* fun to use as an input tablet though! So let's support this
    for everybody.

    Signed-off-by: Martin Kepplinger
    Signed-off-by: Dmitry Torokhov

    Martin Kepplinger
     

17 May, 2016

1 commit