23 Jan, 2020

1 commit

  • commit 28d76df18f0ad5bcf5fa48510b225f0ed262a99b upstream.

    Tom Hatskevich reported that we look up "iocp" then, in the called
    functions we do a second copy_from_user() and look it up again.
    The problem that could cause is:

    drivers/message/fusion/mptctl.c
    674 /* All of these commands require an interrupt or
    675 * are unknown/illegal.
    676 */
    677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0)
    ^^^^
    We take this lock.

    678 return ret;
    679
    680 if (cmd == MPTFWDOWNLOAD)
    681 ret = mptctl_fw_download(arg);
    ^^^
    Then the user memory changes and we look up "iocp" again but a different
    one so now we are holding the incorrect lock and have a race condition.

    682 else if (cmd == MPTCOMMAND)
    683 ret = mptctl_mpt_command(arg);

    The security impact of this bug is not as bad as it could have been
    because these operations are all privileged and root already has
    enormous destructive power. But it's still worth fixing.

    This patch passes the "iocp" pointer to the functions to avoid the
    second lookup. That deletes 100 lines of code from the driver so
    it's a nice clean up as well.

    Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam
    Reported-by: Tom Hatskevich
    Reviewed-by: Greg Kroah-Hartman
    Signed-off-by: Dan Carpenter
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     

12 Jul, 2019

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is mostly update of the usual drivers: qla2xxx, hpsa, lpfc, ufs,
    mpt3sas, ibmvscsi, megaraid_sas, bnx2fc and hisi_sas as well as the
    removal of the osst driver (I heard from Willem privately that he
    would like the driver removed because all his test hardware has
    failed). Plus number of minor changes, spelling fixes and other
    trivia.

    The big merge conflict this time around is the SPDX licence tags.
    Following discussion on linux-next, we believe our version to be more
    accurate than the one in the tree, so the resolution is to take our
    version for all the SPDX conflicts"

    Note on the SPDX license tag conversion conflicts: the SCSI tree had
    done its own SPDX conversion, which in some cases conflicted with the
    treewide ones done by Thomas & co.

    In almost all cases, the conflicts were purely syntactic: the SCSI tree
    used the old-style SPDX tags ("GPL-2.0" and "GPL-2.0+") while the
    treewide conversion had used the new-style ones ("GPL-2.0-only" and
    "GPL-2.0-or-later").

    In these cases I picked the new-style one.

    In a few cases, the SPDX conversion was actually different, though. As
    explained by James above, and in more detail in a pre-pull-request
    thread:

    "The other problem is actually substantive: In the libsas code Luben
    Tuikov originally specified gpl 2.0 only by dint of stating:

    * This file is licensed under GPLv2.

    In all the libsas files, but then muddied the water by quoting GPLv2
    verbatim (which includes the or later than language). So for these
    files Christoph did the conversion to v2 only SPDX tags and Thomas
    converted to v2 or later tags"

    So in those cases, where the spdx tag substantially mattered, I took the
    SCSI tree conversion of it, but then also took the opportunity to turn
    the old-style "GPL-2.0" into a new-style "GPL-2.0-only" tag.

    Similarly, when there were whitespace differences or other differences
    to the comments around the copyright notices, I took the version from
    the SCSI tree as being the more specific conversion.

    Finally, in the spdx conversions that had no conflicts (because the
    treewide ones hadn't been done for those files), I just took the SCSI
    tree version as-is, even if it was old-style. The old-style conversions
    are perfectly valid, even if the "-only" and "-or-later" versions are
    perhaps more descriptive.

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (185 commits)
    scsi: qla2xxx: move IO flush to the front of NVME rport unregistration
    scsi: qla2xxx: Fix NVME cmd and LS cmd timeout race condition
    scsi: qla2xxx: on session delete, return nvme cmd
    scsi: qla2xxx: Fix kernel crash after disconnecting NVMe devices
    scsi: megaraid_sas: Update driver version to 07.710.06.00-rc1
    scsi: megaraid_sas: Introduce various Aero performance modes
    scsi: megaraid_sas: Use high IOPS queues based on IO workload
    scsi: megaraid_sas: Set affinity for high IOPS reply queues
    scsi: megaraid_sas: Enable coalescing for high IOPS queues
    scsi: megaraid_sas: Add support for High IOPS queues
    scsi: megaraid_sas: Add support for MPI toolbox commands
    scsi: megaraid_sas: Offload Aero RAID5/6 division calculations to driver
    scsi: megaraid_sas: RAID1 PCI bandwidth limit algorithm is applicable for only Ventura
    scsi: megaraid_sas: megaraid_sas: Add check for count returned by HOST_DEVICE_LIST DCMD
    scsi: megaraid_sas: Handle sequence JBOD map failure at driver level
    scsi: megaraid_sas: Don't send FPIO to RL Bypass queue
    scsi: megaraid_sas: In probe context, retry IOC INIT once if firmware is in fault
    scsi: megaraid_sas: Release Mutex lock before OCR in case of DCMD timeout
    scsi: megaraid_sas: Call disable_irq from process IRQ poll
    scsi: megaraid_sas: Remove few debug counters from IO path
    ...

    Linus Torvalds
     

19 Jun, 2019

1 commit


21 May, 2019

1 commit


04 Apr, 2019

1 commit

  • In preparation to enabling -Wimplicit-fallthrough, mark switch cases
    where we are expecting to fall through.

    This patch fixes the following warnings:

    drivers/message/fusion/mptscsih.c: In function mptscsih_io_done :
    drivers/message/fusion/mptscsih.c:741:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if ( ioc->bus_type == SAS ) {
    ^
    drivers/message/fusion/mptscsih.c:790:3: note: here
    case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */
    ^~~~
    drivers/message/fusion/mptscsih.c:884:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
    scsi_set_resid(sc, 0);
    ^~~~~~~~~~~~~~~~~~~~~
    drivers/message/fusion/mptscsih.c:885:3: note: here
    case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */
    ^~~~

    Warning level 3 was used: -Wimplicit-fallthrough=3

    This patch is part of the ongoing efforts to enable
    -Wimplicit-fallthrough.

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Martin K. Petersen

    Gustavo A. R. Silva
     

20 Mar, 2019

3 commits

  • Fixes gcc '-Wunused-but-set-variable' warning:

    drivers/message/fusion/mptspi.c: In function 'mptspi_writeIOCPage4':
    drivers/message/fusion/mptspi.c:262:9: warning:
    variable 'frameOffset' set but not used [-Wunused-but-set-variable]

    drivers/message/fusion/mptspi.c:261:9: warning:
    variable 'req_idx' set but not used [-Wunused-but-set-variable]

    They're never used and can be removed.

    Signed-off-by: YueHaibing
    Signed-off-by: Martin K. Petersen

    YueHaibing
     
  • In preparation to enabling -Wimplicit-fallthrough, mark switch cases where
    we are expecting to fall through.

    This patch fixes the following warning:

    drivers/message/fusion/mptbase.c: In function mptbase_reply :
    drivers/message/fusion/mptbase.c:643:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (event != MPI_EVENT_EVENT_CHANGE)
    ^
    drivers/message/fusion/mptbase.c:646:2: note: here
    case MPI_FUNCTION_CONFIG:
    ^~~~

    Warning level 3 was used: -Wimplicit-fallthrough=3

    Notice that, in this particular case, the code comment is modified in
    accordance with what GCC is expecting to find.

    This patch is part of the ongoing efforts to enable
    -Wimplicit-fallthrough.

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Martin K. Petersen

    Gustavo A. R. Silva
     
  • There are several statements and code blocks there are incorrectly
    indented. Fix these.

    Signed-off-by: Colin Ian King
    Signed-off-by: Martin K. Petersen

    Colin Ian King
     

19 Dec, 2018

1 commit

  • Most SCSI drivers want to enable "clustering", that is merging of
    segments so that they might span more than a single page. Remove the
    ENABLE_CLUSTERING define, and require drivers to explicitly set
    DISABLE_CLUSTERING to disable this feature.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Christoph Hellwig
     

28 Sep, 2018

1 commit

  • Clang warns when multiple pairs of parentheses are used for a single
    conditional statement.

    drivers/message/fusion/mptbase.c:338:11: warning: equality comparison
    with extraneous parentheses [-Wparentheses-equality]
    if ((ioc == NULL))
    ~~~~^~~~~~~
    drivers/message/fusion/mptbase.c:338:11: note: remove extraneous
    parentheses around the comparison to silence this warning
    if ((ioc == NULL))
    ~ ^ ~
    drivers/message/fusion/mptbase.c:338:11: note: use '=' to turn this
    equality comparison into an assignment
    if ((ioc == NULL))
    ^~
    =
    drivers/message/fusion/mptbase.c:342:12: warning: equality comparison
    with extraneous parentheses [-Wparentheses-equality]
    if ((pdev == NULL))
    ~~~~~^~~~~~~
    drivers/message/fusion/mptbase.c:342:12: note: remove extraneous
    parentheses around the comparison to silence this warning
    if ((pdev == NULL))
    ~ ^ ~
    drivers/message/fusion/mptbase.c:342:12: note: use '=' to turn this
    equality comparison into an assignment
    if ((pdev == NULL))
    ^~
    =
    2 warnings generated.

    Remove them and while we're at it, simplify the NULL checks as '!var' is
    used more than 'var == NULL'.

    Reported-by: Nick Desaulniers
    Signed-off-by: Nathan Chancellor
    Reviewed-by: Nick Desaulniers
    Signed-off-by: Martin K. Petersen

    Nathan Chancellor
     

12 Sep, 2018

1 commit


31 Jul, 2018

2 commits


11 Jul, 2018

1 commit


13 Jun, 2018

1 commit

  • The kmalloc() function has a 2-factor argument form, kmalloc_array(). This
    patch replaces cases of:

    kmalloc(a * b, gfp)

    with:
    kmalloc_array(a * b, gfp)

    as well as handling cases of:

    kmalloc(a * b * c, gfp)

    with:

    kmalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kmalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kmalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The tools/ directory was manually excluded, since it has its own
    implementation of kmalloc().

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kmalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kmalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kmalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kmalloc
    + kmalloc_array
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kmalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kmalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kmalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kmalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kmalloc(C1 * C2 * C3, ...)
    |
    kmalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kmalloc(sizeof(THING) * C2, ...)
    |
    kmalloc(sizeof(TYPE) * C2, ...)
    |
    kmalloc(C1 * C2 * C3, ...)
    |
    kmalloc(C1 * C2, ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

11 Jun, 2018

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is mostly updates to the usual drivers: ufs, qedf, mpt3sas, lpfc,
    xfcp, hisi_sas, cxlflash, qla2xxx.

    In the absence of Nic, we're also taking target updates which are
    mostly minor except for the tcmu refactor.

    The only real core change to worry about is the removal of high page
    bouncing (in sas, storvsc and iscsi). This has been well tested and no
    problems have shown up so far"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (268 commits)
    scsi: lpfc: update driver version to 12.0.0.4
    scsi: lpfc: Fix port initialization failure.
    scsi: lpfc: Fix 16gb hbas failing cq create.
    scsi: lpfc: Fix crash in blk_mq layer when executing modprobe -r lpfc
    scsi: lpfc: correct oversubscription of nvme io requests for an adapter
    scsi: lpfc: Fix MDS diagnostics failure (Rx < Tx)
    scsi: hisi_sas: Mark PHY as in reset for nexus reset
    scsi: hisi_sas: Fix return value when get_free_slot() failed
    scsi: hisi_sas: Terminate STP reject quickly for v2 hw
    scsi: hisi_sas: Add v2 hw force PHY function for internal ATA command
    scsi: hisi_sas: Include TMF elements in struct hisi_sas_slot
    scsi: hisi_sas: Try wait commands before before controller reset
    scsi: hisi_sas: Init disks after controller reset
    scsi: hisi_sas: Create a scsi_host_template per HW module
    scsi: hisi_sas: Reset disks when discovered
    scsi: hisi_sas: Add LED feature for v3 hw
    scsi: hisi_sas: Change common allocation mode of device id
    scsi: hisi_sas: change slot index allocation mode
    scsi: hisi_sas: Introduce hisi_sas_phy_set_linkrate()
    scsi: hisi_sas: fix a typo in hisi_sas_task_prep()
    ...

    Linus Torvalds
     

05 Jun, 2018

1 commit

  • Pull procfs updates from Al Viro:
    "Christoph's proc_create_... cleanups series"

    * 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (44 commits)
    xfs, proc: hide unused xfs procfs helpers
    isdn/gigaset: add back gigaset_procinfo assignment
    proc: update SIZEOF_PDE_INLINE_NAME for the new pde fields
    tty: replace ->proc_fops with ->proc_show
    ide: replace ->proc_fops with ->proc_show
    ide: remove ide_driver_proc_write
    isdn: replace ->proc_fops with ->proc_show
    atm: switch to proc_create_seq_private
    atm: simplify procfs code
    bluetooth: switch to proc_create_seq_data
    netfilter/x_tables: switch to proc_create_seq_private
    netfilter/xt_hashlimit: switch to proc_create_{seq,single}_data
    neigh: switch to proc_create_seq_data
    hostap: switch to proc_create_{seq,single}_data
    bonding: switch to proc_create_seq_data
    rtc/proc: switch to proc_create_single_data
    drbd: switch to proc_create_single
    resource: switch to proc_create_seq_data
    staging/rtl8192u: simplify procfs code
    jfs: simplify procfs code
    ...

    Linus Torvalds
     

29 May, 2018

1 commit

  • The BLK_EH_NOT_HANDLED implies nothing happen, but very often that
    is not what is happening - instead the driver already completed the
    command. Fix the symbolic name to reflect that a little better.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

16 May, 2018

1 commit


15 May, 2018

1 commit


08 May, 2018

2 commits


19 Apr, 2018

2 commits


26 Mar, 2018

1 commit

  • Some functions definitions have either the initial open brace and/or
    the closing brace outside of column 1.

    Move those braces to column 1.

    This allows various function analyzers like gnu complexity to work
    properly for these modified functions.

    Signed-off-by: Joe Perches
    Acked-by: Andy Shevchenko
    Acked-by: Paul Moore
    Acked-by: Alex Deucher
    Acked-by: Dave Chinner
    Reviewed-by: Darrick J. Wong
    Acked-by: Alexandre Belloni
    Acked-by: Martin K. Petersen
    Acked-by: Takashi Iwai
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Rafael J. Wysocki
    Acked-by: Nicolin Chen
    Acked-by: Martin K. Petersen
    Acked-by: Steven Rostedt (VMware)
    Signed-off-by: Jiri Kosina

    Joe Perches
     

31 Jan, 2018

1 commit


17 Jan, 2018

2 commits


09 Jan, 2018

1 commit

  • gcc-8 reports

    drivers/message/fusion/mptbase.c: In function 'mpt_display_event_info':
    ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified
    bound 100 equals destination size [-Wstringop-truncation]

    We need to use strlcpy() to make sure the dest string is nul-terminated.

    Signed-off-by: Xiongfeng Wang
    Reviewed-by: Arnd Bergmann
    Signed-off-by: Martin K. Petersen

    Xiongfeng Wang
     

08 Dec, 2017

1 commit


16 Nov, 2017

1 commit

  • Pull module updates from Jessica Yu:
    "Summary of modules changes for the 4.15 merge window:

    - treewide module_param_call() cleanup, fix up set/get function
    prototype mismatches, from Kees Cook

    - minor code cleanups"

    * tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
    module: Do not paper over type mismatches in module_param_call()
    treewide: Fix function prototypes for module_param_call()
    module: Prepare to convert all module_param_call() prototypes
    kernel/module: Delete an error message for a failed memory allocation in add_module_usage()

    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
     

31 Oct, 2017

1 commit

  • Several function prototypes for the set/get functions defined by
    module_param_call() have a slightly wrong argument types. This fixes
    those in an effort to clean up the calls when running under type-enforced
    compiler instrumentation for CFI. This is the result of running the
    following semantic patch:

    @match_module_param_call_function@
    declarer name module_param_call;
    identifier _name, _set_func, _get_func;
    expression _arg, _mode;
    @@

    module_param_call(_name, _set_func, _get_func, _arg, _mode);

    @fix_set_prototype
    depends on match_module_param_call_function@
    identifier match_module_param_call_function._set_func;
    identifier _val, _param;
    type _val_type, _param_type;
    @@

    int _set_func(
    -_val_type _val
    +const char * _val
    ,
    -_param_type _param
    +const struct kernel_param * _param
    ) { ... }

    @fix_get_prototype
    depends on match_module_param_call_function@
    identifier match_module_param_call_function._get_func;
    identifier _val, _param;
    type _val_type, _param_type;
    @@

    int _get_func(
    -_val_type _val
    +char * _val
    ,
    -_param_type _param
    +const struct kernel_param * _param
    ) { ... }

    Two additional by-hand changes are included for places where the above
    Coccinelle script didn't notice them:

    drivers/platform/x86/thinkpad_acpi.c
    fs/lockd/svc.c

    Signed-off-by: Kees Cook
    Signed-off-by: Jessica Yu

    Kees Cook
     

30 Aug, 2017

1 commit

  • Simplify the SMP passthrough code by switching it to the generic bsg-lib
    helpers that abstract away the details of the request code, and gets
    drivers out of seeing struct scsi_request.

    For the libsas host SMP code there is a small behavior difference in
    that we now always clear the residual len for successful commands,
    similar to the three other SMP handler implementations. Given that
    there is no partial command handling in the host SMP handler this should
    not matter in practice.

    [mkp: typos and checkpatch fixes]

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Christoph Hellwig
     

26 Aug, 2017

2 commits

  • VMWare ESXi emulates an mptsas HBA, but exposes all drives as
    direct-attached SAS drives. This it not how the driver originally
    envisioned things; SAS drives were supposed to be connected via an
    expander, and only SATA drives would be direct attached. As such, any
    hotplug event for direct-attach SAS drives was silently ignored, and the
    guest failed to detect new drives from within a VMWare ESXi environment.

    [mkp: typos]

    Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1030850
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • When we're resetting the host any remote port states will be reset
    anyway, so it's pointless to wait for dev_loss_tmo during host reset.

    Signed-off-by: Hannes Reinecke
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     

08 Aug, 2017

1 commit

  • gcc points out a theorerical string overflow:

    drivers/message/fusion/mptbase.c: In function 'mpt_detach':
    drivers/message/fusion/mptbase.c:2103:17: error: '%s' directive writing up to 31 bytes into a region of size 28 [-Werror=format-overflow=]
    sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s/summary", ioc->name);
    ^~~~~
    drivers/message/fusion/mptbase.c:2103:2: note: 'sprintf' output between 13 and 44 bytes into a destination of size 32

    We can simply double the size of the local buffer here to be on the
    safe side, and using snprintf() instead of sprintf() protects us
    if ioc->name was not terminated properly.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Martin K. Petersen

    Arnd Bergmann
     

25 Apr, 2017

2 commits


22 Feb, 2017

1 commit

  • Pull SCSI updates from James Bottomley:
    "This update includes the usual round of major driver updates (ncr5380,
    ufs, lpfc, be2iscsi, hisi_sas, storvsc, cxlflash, aacraid,
    megaraid_sas, ...).

    There's also an assortment of minor fixes and the major update of
    switching a bunch of drivers to pci_alloc_irq_vectors from Christoph"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (188 commits)
    scsi: megaraid_sas: handle dma_addr_t right on 32-bit
    scsi: megaraid_sas: array overflow in megasas_dump_frame()
    scsi: snic: switch to pci_irq_alloc_vectors
    scsi: megaraid_sas: driver version upgrade
    scsi: megaraid_sas: Change RAID_1_10_RMW_CMDS to RAID_1_PEER_CMDS and set value to 2
    scsi: megaraid_sas: Indentation and smatch warning fixes
    scsi: megaraid_sas: Cleanup VD_EXT_DEBUG and SPAN_DEBUG related debug prints
    scsi: megaraid_sas: Increase internal command pool
    scsi: megaraid_sas: Use synchronize_irq to wait for IRQs to complete
    scsi: megaraid_sas: Bail out the driver load if ld_list_query fails
    scsi: megaraid_sas: Change build_mpt_mfi_pass_thru to return void
    scsi: megaraid_sas: During OCR, if get_ctrl_info fails do not continue with OCR
    scsi: megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool
    scsi: megaraid_sas: Remove unused pd_index from megasas_build_ld_nonrw_fusion
    scsi: megaraid_sas: megasas_return_cmd does not memset IO frame to zero
    scsi: megaraid_sas: max_fw_cmds are decremented twice, remove duplicate
    scsi: megaraid_sas: update can_queue only if the new value is less
    scsi: megaraid_sas: Change max_cmd from u32 to u16 in all functions
    scsi: megaraid_sas: set pd_after_lb from MR_BuildRaidContext and initialize pDevHandle to MR_DEVHANDLE_INVALID
    scsi: megaraid_sas: latest controller OCR capability from FW before sending shutdown DCMD
    ...

    Linus Torvalds