02 May, 2018

1 commit

  • commit f9d94b57e30fd1575b4935045b32d738668aa74b upstream.

    As recently Smatch suggested, a couple of places in ASIHPI driver may
    expand the array directly from the user-space value with speculation:
    sound/pci/asihpi/hpimsginit.c:70 hpi_init_response() warn: potential spectre issue 'res_size' (local cap)
    sound/pci/asihpi/hpioctl.c:189 asihpi_hpi_ioctl() warn: potential spectre issue 'adapters'

    This patch puts array_index_nospec() for hardening against them.

    BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
    Reported-by: Dan Carpenter
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

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
     

20 Sep, 2017

1 commit

  • The hm->h.size is intended to hold the actual size of the hm struct
    that is copied from userspace and should always be h.size), since userspace
    process has full control over the memory region pointed by puhm, it is
    possible that the value of hm->h.size is different from what is fetched-in
    previously (get_user(hm->h.size, (u16 __user *)puhm)). In other words,
    hm->h.size is overriden and the relation between hm->h.size and the hm
    struct is broken.

    This patch proposes to use a seperate variable, msg_size, to hold
    the value of the first fetch and override hm->h.size to msg_size
    after the second fetch to maintain the relation.

    Signed-off-by: Meng Xu
    Signed-off-by: Takashi Iwai

    Meng Xu
     

07 Sep, 2017

1 commit


31 Aug, 2017

1 commit


18 Oct, 2016

1 commit

  • Some elements in hr are not cleared before being copied to user space,
    leaking kernel heap memory to user space. For example, this happens in
    the error handling code for the HPI_ADAPTER_DELETE case. Zero the memory
    before it's copied.

    Signed-off-by: Vlad Tsyrklevich
    Signed-off-by: Takashi Iwai

    Vlad Tsyrklevich
     

08 Sep, 2016

1 commit


02 Sep, 2016

1 commit

  • Check for snd_pcm_ops structures that are only stored in the ops field of a
    snd_soc_platform_driver structure or passed as the third argument to
    snd_pcm_set_ops. The corresponding field or parameter is declared const,
    so snd_pcm_ops structures that have this property can be declared as const
    also.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct snd_pcm_ops i@p = { ... };

    @ok1@
    identifier r.i;
    struct snd_soc_platform_driver e;
    position p;
    @@
    e.ops = &i@p;

    @ok2@
    identifier r.i;
    expression e1, e2;
    position p;
    @@
    snd_pcm_set_ops(e1, e2, &i@p)

    @bad@
    position p != {r.p,ok1.p,ok2.p};
    identifier r.i;
    struct snd_pcm_ops e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct snd_pcm_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Takashi Iwai

    Julia Lawall
     

03 Jun, 2015

1 commit

  • Nothing in uses anything from , so
    remove it from there and fix up the resulting build problems
    triggered on x86 {64|32}-bit {def|allmod|allno}configs.

    The breakages were triggering in places where x86 builds relied
    on vmalloc() facilities but did not include
    explicitly and relied on the implicit inclusion via .

    Also add:

    - to
    - to

    ... which were two other implicit header file dependencies.

    Suggested-by: David Miller
    Signed-off-by: Stephen Rothwell
    [ Tidied up the changelog. ]
    Acked-by: David Miller
    Acked-by: Takashi Iwai
    Acked-by: Viresh Kumar
    Acked-by: Vinod Koul
    Cc: Andrew Morton
    Cc: Anton Vorontsov
    Cc: Boris Ostrovsky
    Cc: Colin Cross
    Cc: David Vrabel
    Cc: H. Peter Anvin
    Cc: Haiyang Zhang
    Cc: James E.J. Bottomley
    Cc: Jaroslav Kysela
    Cc: K. Y. Srinivasan
    Cc: Kees Cook
    Cc: Konrad Rzeszutek Wilk
    Cc: Kristen Carlson Accardi
    Cc: Len Brown
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Suma Ramars
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Signed-off-by: Ingo Molnar

    Stephen Rothwell
     

24 Mar, 2015

1 commit


29 Jan, 2015

1 commit


19 Jan, 2015

1 commit


04 Jan, 2015

1 commit


02 Jan, 2015

1 commit

  • snd_asihpi_hpi_new() takes a pointer to a pointer of a hwdep where if this
    parameter is provided the newly allocated hwdep is stored. All callers pass
    NULL though, so remove the parameter. This makes the code a bit cleaner and
    shorter.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Takashi Iwai

    Lars-Peter Clausen
     

31 Dec, 2014

1 commit


18 Dec, 2014

3 commits


03 Dec, 2014

1 commit


23 Nov, 2014

10 commits


10 Nov, 2014

1 commit

  • Add a new helper function snd_pcm_stop_xrun() to the standard sequnce
    lock/snd_pcm_stop(XRUN)/unlock by a single call, and replace the
    existing open codes with this helper.

    The function checks the PCM running state to prevent setting the wrong
    state, too, for more safety.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

21 Oct, 2014

1 commit


13 Aug, 2014

1 commit

  • We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
    meet kernel coding style guidelines. This issue was reported by checkpatch.

    A simplified version of the semantic patch that makes this change is as
    follows (http://coccinelle.lip6.fr/):

    //

    @@
    identifier i;
    declarer name DEFINE_PCI_DEVICE_TABLE;
    initializer z;
    @@

    - DEFINE_PCI_DEVICE_TABLE(i)
    + const struct pci_device_id i[]
    = z;

    //

    [bhelgaas: add semantic patch]
    Signed-off-by: Benoit Taine
    Signed-off-by: Bjorn Helgaas

    Benoit Taine
     

31 Mar, 2014

1 commit


12 Feb, 2014

1 commit


13 Sep, 2013

1 commit


16 Jul, 2013

1 commit


28 Jun, 2013

1 commit


29 May, 2013

1 commit

  • As drvdata is cleared to NULL at probe failure or at removal by the
    driver core, we don't have to call pci_set_drvdata(pci, NULL) any
    longer in each driver.

    The only remaining pci_set_drvdata(NULL) is in azx_firmware_cb() in
    hda_intel.c. Since this function itself releases the card instance,
    we need to clear drvdata here as well, so that it won't be released
    doubly in the remove callback.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

29 Apr, 2013

2 commits