17 Oct, 2016

1 commit

  • Some crypto implementations (such as the generic CCM wrapper in crypto/)
    use scatterlists to map fields of private data in their struct aead_req.
    This means these data structures cannot live in the vmalloc area, which
    means that they cannot live on the stack (with CONFIG_VMAP_STACK.)

    This currently occurs only with the generic software implementation, but
    the private data and usage is implementation specific, so move the whole
    data structures off the stack into heap by allocating every time we need
    to use them.

    In addition, take care not to put any of our own stack allocations into
    scatterlists. This involves reserving some extra room when allocating the
    aead_request structures, and referring to those allocations in the scatter-
    lists (while copying the data from the stack before the crypto operation)

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Johannes Berg

    Ard Biesheuvel
     

28 May, 2015

1 commit


23 Apr, 2015

1 commit


30 Mar, 2015

1 commit

  • This code is written using an anti-pattern called "success handling"
    which makes it hard to read, especially if you are used to normal kernel
    style. It should instead be written as a list of directives in a row
    with branches for error handling.

    Signed-off-by: Dan Carpenter
    Acked-by: Ard Biesheuvel
    Signed-off-by: Johannes Berg

    Dan Carpenter
     

27 Jan, 2015

1 commit

  • This allows mac80211 to configure CCMP-256 to the driver and also use
    software-implementation within mac80211 when the driver does not support
    this with hardware accelaration.

    Signed-off-by: Jouni Malinen
    [squash ccmp256 -> mic_len argument change]
    Signed-off-by: Johannes Berg

    Jouni Malinen
     

06 Nov, 2014

1 commit

  • Commit 7ec7c4a9a686c608315739ab6a2b0527a240883c (mac80211: port CCMP to
    cryptoapi's CCM driver) introduced a regression when decrypting empty
    packets (data_len == 0). This will lead to backtraces like:

    (scatterwalk_start) from [] (scatterwalk_map_and_copy+0x2c/0xa8)
    (scatterwalk_map_and_copy) from [] (crypto_ccm_decrypt+0x7c/0x25c)
    (crypto_ccm_decrypt) from [] (ieee80211_aes_ccm_decrypt+0x160/0x170)
    (ieee80211_aes_ccm_decrypt) from [] (ieee80211_crypto_ccmp_decrypt+0x1ac/0x238)
    (ieee80211_crypto_ccmp_decrypt) from [] (ieee80211_rx_handlers+0x870/0x1d24)
    (ieee80211_rx_handlers) from [] (ieee80211_prepare_and_rx_handle+0x8a0/0x91c)
    (ieee80211_prepare_and_rx_handle) from [] (ieee80211_rx+0x568/0x730)
    (ieee80211_rx) from [] (__carl9170_rx+0x94c/0xa20)
    (__carl9170_rx) from [] (carl9170_rx_stream+0x1fc/0x320)
    (carl9170_rx_stream) from [] (carl9170_usb_tasklet+0x80/0xc8)
    (carl9170_usb_tasklet) from [] (tasklet_hi_action+0x88/0xcc)
    (tasklet_hi_action) from [] (__do_softirq+0xcc/0x200)
    (__do_softirq) from [] (irq_exit+0x80/0xe0)
    (irq_exit) from [] (handle_IRQ+0x64/0x80)
    (handle_IRQ) from [] (__irq_svc+0x40/0x4c)
    (__irq_svc) from [] (arch_cpu_idle+0x2c/0x34)

    Such packets can appear for example when using the carl9170 wireless driver
    because hardware sometimes generates garbage when the internal FIFO overruns.

    This patch adds an additional length check.

    Cc: stable@vger.kernel.org
    Fixes: 7ec7c4a9a686 ("mac80211: port CCMP to cryptoapi's CCM driver")
    Acked-by: Ard Biesheuvel
    Signed-off-by: Ronald Wahl
    Signed-off-by: Johannes Berg

    Ronald Wahl
     

09 Apr, 2014

1 commit

  • Replaced the use of a Variable Length Array In Struct (VLAIS) with a
    C99 compliant equivalent. This is the original VLAIS struct.

    struct {
    struct aead_request req;
    u8 priv[crypto_aead_reqsize(tfm)];
    } aead_req;

    This patch instead allocates the appropriate amount of memory using a
    char array.

    The new code can be compiled with both gcc and clang.

    Signed-off-by: Jan-Simon Möller
    Signed-off-by: Behan Webster
    [small style cleanups]
    Signed-off-by: Johannes Berg

    Jan-Simon Möller
     

11 Oct, 2013

1 commit

  • Use the generic CCM aead chaining mode driver rather than a local
    implementation that sits right on top of the core AES cipher.

    This allows the use of accelerated implementations of either
    CCM as a whole or the CTR mode which it encapsulates.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Johannes Berg

    Ard Biesheuvel
     

17 May, 2013

1 commit


08 Jul, 2011

1 commit


27 Apr, 2011

1 commit

  • These warnings are exposed by gcc 4.6.
    net/mac80211/sta_info.c: In function 'sta_info_cleanup_expire_buffered':
    net/mac80211/sta_info.c:590:32: warning: variable 'sdata' set but not used
    net/mac80211/ibss.c: In function 'ieee80211_rx_mgmt_auth_ibss':
    net/mac80211/ibss.c:43:34: warning: variable 'status_code' set but not used
    net/mac80211/work.c: In function 'ieee80211_send_assoc':
    net/mac80211/work.c:203:9: warning: variable 'len' set but not used
    net/mac80211/tx.c: In function '__ieee80211_parse_tx_radiotap':
    net/mac80211/tx.c:1039:35: warning: variable 'sband' set but not used
    net/mac80211/mesh.c: In function 'ieee80211_mesh_rx_queued_mgmt':
    net/mac80211/mesh.c:616:28: warning: variable 'ifmsh' set but not used
    ...

    Signed-off-by: Rajkumar Manoharan
    Signed-off-by: John W. Linville

    Rajkumar Manoharan
     

16 Nov, 2010

1 commit

  • crypto_free_cipher() is a wrapper around crypto_free_tfm() which is a
    wrapper around crypto_destroy_tfm() and the latter can handle being passed
    a NULL pointer, so checking for NULL in the
    ieee80211_aes_key_free()/ieee80211_aes_cmac_key_free() wrappers around
    crypto_free_cipher() is pointless and just increase object code size
    needlesly and makes us execute extra test/branch instructions that we
    don't need.
    Btw; don't we have to many wrappers around wrappers ad nauseam here?
    Anyway, this patch removes the redundant conditionals.

    Signed-off-by: Jesper Juhl
    Signed-off-by: John W. Linville

    Jesper Juhl
     

17 Aug, 2010

1 commit

  • ieee80211_add_key() currently returns -ENOMEM in case of any error,
    including a missing crypto algorithm. Change ieee80211_key_alloc()
    and ieee80211_aes_{key_setup_encrypt,cmac_key_setup}() to encode
    errors with ERR_PTR() rather than returning NULL, and change
    ieee80211_add_key() accordingly.

    Compile-tested only.

    Reported-by: Marcin Owsiany
    Signed-off-by: Ben Hutchings
    Acked-by: Johannes Berg
    Signed-off-by: John W. Linville

    Ben Hutchings
     

09 Jul, 2008

2 commits


08 May, 2008

1 commit


09 Apr, 2008

1 commit


02 Nov, 2007

1 commit


11 Oct, 2007

1 commit

  • Hopefully captured all single statement cases under net/. I'm
    not too sure if there is some policy about #includes that are
    "guaranteed" (ie., in the current tree) to be available through
    some other #included header, so I just added linux/kernel.h to
    each changed file that didn't #include it previously.

    Signed-off-by: Ilpo Järvinen
    Signed-off-by: David S. Miller

    Ilpo Järvinen
     

06 May, 2007

1 commit