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 Feb, 2017

5 commits

  • For consistency with other reference counting APIs in the kernel, add
    drm_property_blob_get() and drm_property_blob_put() to reference count
    DRM blob properties.

    Compatibility aliases are added to keep existing code working. To help
    speed up the transition, all the instances of the old functions in the
    DRM core are already replaced in this commit.

    A semantic patch is provided that can be used to convert all drivers to
    the new helpers.

    Reviewed-by: Sean Paul
    Acked-by: Christian König
    Signed-off-by: Thierry Reding
    Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-7-thierry.reding@gmail.com

    Thierry Reding
     
  • For consistency with other reference counting APIs in the kernel, add
    drm_gem_object_get() and drm_gem_object_put(), as well as an unlocked
    variant of the latter, to reference count GEM buffer objects.

    Compatibility aliases are added to keep existing code working. To help
    speed up the transition, all the instances of the old functions in the
    DRM core are already replaced in this commit.

    The existing semantic patch for the DRM subsystem-wide conversion is
    extended to account for these new helpers.

    Reviewed-by: Sean Paul
    Acked-by: Christian König
    Signed-off-by: Thierry Reding
    Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-6-thierry.reding@gmail.com

    Thierry Reding
     
  • For consistency with other reference counting APIs in the kernel, add
    drm_framebuffer_get() and drm_framebuffer_put() to reference count DRM
    framebuffers.

    Compatibility aliases are added to keep existing code working. To help
    speed up the transition, all the instances of the old functions in the
    DRM core are already replaced in this commit.

    The existing semantic patch for the DRM subsystem-wide conversion is
    extended to account for these new helpers.

    Reviewed-by: Sean Paul
    Acked-by: Christian König
    Signed-off-by: Thierry Reding
    Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-5-thierry.reding@gmail.com

    Thierry Reding
     
  • For consistency with other reference counting APIs in the kernel, add
    drm_connector_get() and drm_connector_put() functions to reference count
    connectors.

    Compatibility aliases are added to keep existing code working. To help
    speed up the transition, all the instances of the old functions in the
    DRM core are already replaced in this commit.

    The existing semantic patch for mode object reference count conversion
    is extended for these new helpers.

    Reviewed-by: Sean Paul
    Acked-by: Christian König
    Signed-off-by: Thierry Reding
    Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-4-thierry.reding@gmail.com

    Thierry Reding
     
  • For consistency with other reference counting APIs in the kernel, add
    drm_mode_object_get() and drm_mode_object_put() to reference count DRM
    mode objects.

    Compatibility aliases are added to keep existing code working. To help
    speed up the transition, all the instances of the old functions in the
    DRM core are already replaced in this commit.

    A semantic patch is provided that can be used to convert all drivers to
    the new helpers.

    Reviewed-by: Sean Paul
    Acked-by: Christian König
    Signed-off-by: Thierry Reding
    Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-3-thierry.reding@gmail.com

    Thierry Reding
     

11 Dec, 2016

4 commits


11 Oct, 2016

1 commit


02 Oct, 2016

2 commits

  • pm_runtime.cocci starts with one rule that searches for a variety of
    functions calls, followed by various rules that report errors. Previously,
    the only connection between the first rule and the rest was to check that
    the first rule had matched somewhere. Change the rules to propagate a
    position from the first rule to the others, to make sure that the sites
    reported on are the same as the sites that were identified as having the
    relevant functions.

    Signed-off-by: Julia Lawall
    Signed-off-by: Michal Marek

    Julia Lawall
     
  • Memdup_user encapsulates a memory allocation with the flag GFP_KERNEL, so
    only allow this flag in the original code.

    Signed-off-by: Julia Lawall
    Signed-off-by: Michal Marek

    Julia Lawall
     

22 Jul, 2016

1 commit


21 Jun, 2016

3 commits

  • krealloc() must not be used against devm_*() allocated
    memory regions:

    - if a bigger memory is to be allocated, krealloc() and
    __krealloc() could return a different pointer than the
    one given to them, creating a memory region which is not
    managed, thus it will not be automatically released on
    device removal.

    - if a bigger memory is to be allocated, krealloc() could
    kfree() the managed memory region which is passed to it.
    The old pointer is left registered as a resource for the
    device. On device removal, this dangling pointer will be
    used and an unrelated memory region could be released.

    - if the requested size is equal to 0, krealloc() can also
    just behave like kfree(). Here too, the old pointer is
    kept associated with the device. On device removal, this
    invalid pointer will be used and an unrelated memory
    region could be released.

    For all these reasons, krealloc() must not be used on a
    pointer returned by devm_*() functions.

    Cc: Tejun Heo
    Cc: Pekka Enberg
    Acked-by: Julia Lawall
    Signed-off-by: Yann Droneaud
    Signed-off-by: Michal Marek

    Yann Droneaud
     
  • Updates free/devm_free.cocci to recognize functions added by:

    - commit 64c862a839a8 ('devres: add kernel standard devm_k.alloc functions')
    - commit e31108cad3de ('devres: introduce API "devm_kstrdup"')
    - commit 3046365bb470 ('devres: introduce API "devm_kmemdup')
    - commit 43339bed7010 ('devres: Add devm_get_free_pages API')
    - commit 75f2a4ead5d5 ('devres: Add devm_kasprintf and devm_kvasprintf API')

    See also Documentation/driver-model/devres.txt

    Cc: Joe Perches
    Cc: Manish Badarkhe
    Cc: Srinivas Pandruvada
    Cc: Eli Billauer
    Cc: Himangi Saraogi
    Cc: Geert Uytterhoeven
    Cc: Wolfram Sang
    Cc: Daniel Thompson
    Acked-by: Julia Lawall
    Signed-off-by: Yann Droneaud
    Signed-off-by: Michal Marek

    Yann Droneaud
     
  • Since commit 3ef0e5ba4673 ('slab: introduce kzfree()'),
    kfree() is no more the only function to be considered:
    kzfree() should be recognized too.

    In particular, kzfree() must not be called on memory
    allocated through devm_*() functions.

    Cc: Johannes Weiner
    Acked-by: Julia Lawall
    Signed-off-by: Yann Droneaud
    Signed-off-by: Michal Marek

    Yann Droneaud
     

20 Jun, 2016

1 commit


27 May, 2016

1 commit

  • Pull misc kbuild updates from Michal Marek:
    "This is the non-critical part of kbuild:

    - Coccinelle fixes, one semantic patch less in this round [Vaishali
    Thakkar, Wolfram Sang, Kees Cook]

    - rpm-pkg support for (open)SUSE's update-bootloader [Jiří Kosian]

    - rpm-pkg restored support for $RPMOPTS [Srinivas Pandruvada]

    - deb-pkg fixes for the linux-headers package [Bjørn Mork, Azriel
    Samson]"

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    coccicheck: Fix missing 0 index in kill loop
    scripts/package/Makefile: rpmbuild add support of RPMOPTS
    builddeb: fix missing headers in linux-headers package
    builddeb: include objtool binary in headers package
    kbuild/mkspec: support 'update-bootloader'-based systems
    scripts: coccinelle: remove check to move constants to right
    Coccinelle: setup_timer: Add space in front of parentheses

    Linus Torvalds
     

20 Apr, 2016

2 commits


13 Apr, 2016

1 commit

  • In order to protect against file removal races, debugfs files created via
    debugfs_create_file() now get wrapped by a struct file_operations at their
    opening.

    If the original struct file_operations are known to be safe against removal
    races by themselves already, the proxy creation may be bypassed by creating
    the files through debugfs_create_file_unsafe().

    In order to help debugfs users who use the common
    DEFINE_SIMPLE_ATTRIBUTE() + debugfs_create_file()
    idiom to transition to removal safe struct file_operations, the helper
    macro DEFINE_DEBUGFS_ATTRIBUTE() has been introduced.

    Thus, the preferred strategy is to use
    DEFINE_DEBUGFS_ATTRIBUTE() + debugfs_create_file_unsafe()
    now.

    Introduce a Coccinelle script that searches for
    DEFINE_SIMPLE_ATTRIBUTE()-defined struct file_operations handed into
    debugfs_create_file(). Suggest to turn these usages into the
    DEFINE_DEBUGFS_ATTRIBUTE() + debugfs_create_file_unsafe()
    pattern.

    Signed-off-by: Nicolai Stange
    Acked-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Nicolai Stange
     

19 Feb, 2016

5 commits


18 Feb, 2016

1 commit


13 Jan, 2016

1 commit

  • Unsigned expressions cannot be lesser than zero. Presence of comparisons
    'unsigned (|>=) 0' often indicates a bug, usually wrong type of variable.
    The patch beside finding such comparisons tries to eliminate false positives,
    mainly by bypassing range checks.

    gcc can detect such comparisons also using -Wtype-limits switch, but it warns
    also in correct cases, making too much noise.

    Signed-off-by: Andrzej Hajda
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Andrzej Hajda
     

27 Oct, 2015

8 commits


09 Sep, 2015

2 commits

  • Merge second patch-bomb from Andrew Morton:
    "Almost all of the rest of MM. There was an unusually large amount of
    MM material this time"

    * emailed patches from Andrew Morton : (141 commits)
    zpool: remove no-op module init/exit
    mm: zbud: constify the zbud_ops
    mm: zpool: constify the zpool_ops
    mm: swap: zswap: maybe_preload & refactoring
    zram: unify error reporting
    zsmalloc: remove null check from destroy_handle_cache()
    zsmalloc: do not take class lock in zs_shrinker_count()
    zsmalloc: use class->pages_per_zspage
    zsmalloc: consider ZS_ALMOST_FULL as migrate source
    zsmalloc: partial page ordering within a fullness_list
    zsmalloc: use shrinker to trigger auto-compaction
    zsmalloc: account the number of compacted pages
    zsmalloc/zram: introduce zs_pool_stats api
    zsmalloc: cosmetic compaction code adjustments
    zsmalloc: introduce zs_can_compact() function
    zsmalloc: always keep per-class stats
    zsmalloc: drop unused variable `nr_to_migrate'
    mm/memblock.c: fix comment in __next_mem_range()
    mm/page_alloc.c: fix type information of memoryless node
    memory-hotplug: fix comments in zone_spanned_pages_in_node() and zone_spanned_pages_in_node()
    ...

    Linus Torvalds
     
  • add [pci|dma]_pool_zalloc coccinelle check.
    replaces instances of [pci|dma]_pool_alloc() followed by memset(0)
    with [pci|dma]_pool_zalloc().

    Signed-off-by: Sean O. Stalley
    Acked-by: Julia Lawall
    Cc: Vinod Koul
    Cc: Bjorn Helgaas
    Cc: Gilles Muller
    Cc: Nicolas Palix
    Cc: Michal Marek
    Cc: Sebastian Andrzej Siewior
    Cc: Jonathan Corbet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sean O. Stalley
     

19 Aug, 2015

1 commit