09 Sep, 2020

1 commit

  • …x/kernel/git/sschmidt/wpan

    Stefan Schmidt says:

    ====================
    pull-request: ieee802154 for net 2020-09-08

    An update from ieee802154 for your *net* tree.

    A potential memory leak fix for ca8210 from Liu Jian,
    a check on the return for a register read in adf7242
    and finally a user after free fix in the softmac tx
    function from Eric found by syzkaller.
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     

08 Sep, 2020

1 commit

  • syzbot reported a bug in ieee802154_tx() [1]

    A similar issue in ieee802154_xmit_worker() is also fixed in this patch.

    [1]
    BUG: KASAN: use-after-free in ieee802154_tx+0x3d2/0x480 net/mac802154/tx.c:88
    Read of size 4 at addr ffff8880251a8c70 by task syz-executor.3/928

    CPU: 0 PID: 928 Comm: syz-executor.3 Not tainted 5.9.0-rc3-syzkaller #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:
    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x198/0x1fd lib/dump_stack.c:118
    print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383
    __kasan_report mm/kasan/report.c:513 [inline]
    kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
    ieee802154_tx+0x3d2/0x480 net/mac802154/tx.c:88
    ieee802154_subif_start_xmit+0xbe/0xe4 net/mac802154/tx.c:130
    __netdev_start_xmit include/linux/netdevice.h:4634 [inline]
    netdev_start_xmit include/linux/netdevice.h:4648 [inline]
    dev_direct_xmit+0x4e9/0x6e0 net/core/dev.c:4203
    packet_snd net/packet/af_packet.c:2989 [inline]
    packet_sendmsg+0x2413/0x5290 net/packet/af_packet.c:3014
    sock_sendmsg_nosec net/socket.c:651 [inline]
    sock_sendmsg+0xcf/0x120 net/socket.c:671
    ____sys_sendmsg+0x6e8/0x810 net/socket.c:2353
    ___sys_sendmsg+0xf3/0x170 net/socket.c:2407
    __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440
    do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    entry_SYSCALL_64_after_hwframe+0x44/0xa9
    RIP: 0033:0x45d5b9
    Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 3d 01 f0 ff ff 0f 83 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
    RSP: 002b:00007fc98e749c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
    RAX: ffffffffffffffda RBX: 000000000002ccc0 RCX: 000000000045d5b9
    RDX: 0000000000000000 RSI: 0000000020007780 RDI: 000000000000000b
    RBP: 000000000118d020 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cfec
    R13: 00007fff690c720f R14: 00007fc98e74a9c0 R15: 000000000118cfec

    Allocated by task 928:
    kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
    kasan_set_track mm/kasan/common.c:56 [inline]
    __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461
    slab_post_alloc_hook mm/slab.h:518 [inline]
    slab_alloc_node mm/slab.c:3254 [inline]
    kmem_cache_alloc_node+0x136/0x3e0 mm/slab.c:3574
    __alloc_skb+0x71/0x550 net/core/skbuff.c:198
    alloc_skb include/linux/skbuff.h:1094 [inline]
    alloc_skb_with_frags+0x92/0x570 net/core/skbuff.c:5771
    sock_alloc_send_pskb+0x72a/0x880 net/core/sock.c:2348
    packet_alloc_skb net/packet/af_packet.c:2837 [inline]
    packet_snd net/packet/af_packet.c:2932 [inline]
    packet_sendmsg+0x19fb/0x5290 net/packet/af_packet.c:3014
    sock_sendmsg_nosec net/socket.c:651 [inline]
    sock_sendmsg+0xcf/0x120 net/socket.c:671
    ____sys_sendmsg+0x6e8/0x810 net/socket.c:2353
    ___sys_sendmsg+0xf3/0x170 net/socket.c:2407
    __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440
    do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    Freed by task 928:
    kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
    kasan_set_track+0x1c/0x30 mm/kasan/common.c:56
    kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355
    __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422
    __cache_free mm/slab.c:3418 [inline]
    kmem_cache_free.part.0+0x74/0x1e0 mm/slab.c:3693
    kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:622
    __kfree_skb net/core/skbuff.c:679 [inline]
    consume_skb net/core/skbuff.c:838 [inline]
    consume_skb+0xcf/0x160 net/core/skbuff.c:832
    __dev_kfree_skb_any+0x9c/0xc0 net/core/dev.c:3107
    fakelb_hw_xmit+0x20e/0x2a0 drivers/net/ieee802154/fakelb.c:81
    drv_xmit_async net/mac802154/driver-ops.h:16 [inline]
    ieee802154_tx+0x282/0x480 net/mac802154/tx.c:81
    ieee802154_subif_start_xmit+0xbe/0xe4 net/mac802154/tx.c:130
    __netdev_start_xmit include/linux/netdevice.h:4634 [inline]
    netdev_start_xmit include/linux/netdevice.h:4648 [inline]
    dev_direct_xmit+0x4e9/0x6e0 net/core/dev.c:4203
    packet_snd net/packet/af_packet.c:2989 [inline]
    packet_sendmsg+0x2413/0x5290 net/packet/af_packet.c:3014
    sock_sendmsg_nosec net/socket.c:651 [inline]
    sock_sendmsg+0xcf/0x120 net/socket.c:671
    ____sys_sendmsg+0x6e8/0x810 net/socket.c:2353
    ___sys_sendmsg+0xf3/0x170 net/socket.c:2407
    __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440
    do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    The buggy address belongs to the object at ffff8880251a8c00
    which belongs to the cache skbuff_head_cache of size 224
    The buggy address is located 112 bytes inside of
    224-byte region [ffff8880251a8c00, ffff8880251a8ce0)
    The buggy address belongs to the page:
    page:0000000062b6a4f1 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x251a8
    flags: 0xfffe0000000200(slab)
    raw: 00fffe0000000200 ffffea0000435c88 ffffea00028b6c08 ffff8880a9055d00
    raw: 0000000000000000 ffff8880251a80c0 000000010000000c 0000000000000000
    page dumped because: kasan: bad access detected

    Memory state around the buggy address:
    ffff8880251a8b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    ffff8880251a8b80: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
    >ffff8880251a8c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    ^
    ffff8880251a8c80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
    ffff8880251a8d00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb

    Fixes: 409c3b0c5f03 ("mac802154: tx: move stats tx increment")
    Signed-off-by: Eric Dumazet
    Reported-by: syzbot
    Cc: Alexander Aring
    Cc: Stefan Schmidt
    Cc: linux-wpan@vger.kernel.org
    Link: https://lore.kernel.org/r/20200908104025.4009085-1-edumazet@google.com
    Signed-off-by: Stefan Schmidt

    Eric Dumazet
     

08 Aug, 2020

1 commit

  • As said by Linus:

    A symmetric naming is only helpful if it implies symmetries in use.
    Otherwise it's actively misleading.

    In "kzalloc()", the z is meaningful and an important part of what the
    caller wants.

    In "kzfree()", the z is actively detrimental, because maybe in the
    future we really _might_ want to use that "memfill(0xdeadbeef)" or
    something. The "zero" part of the interface isn't even _relevant_.

    The main reason that kzfree() exists is to clear sensitive information
    that should not be leaked to other future users of the same memory
    objects.

    Rename kzfree() to kfree_sensitive() to follow the example of the recently
    added kvfree_sensitive() and make the intention of the API more explicit.
    In addition, memzero_explicit() is used to clear the memory to make sure
    that it won't get optimized away by the compiler.

    The renaming is done by using the command sequence:

    git grep -w --name-only kzfree |\
    xargs sed -i 's/kzfree/kfree_sensitive/'

    followed by some editing of the kfree_sensitive() kerneldoc and adding
    a kzfree backward compatibility macro in slab.h.

    [akpm@linux-foundation.org: fs/crypto/inline_crypt.c needs linux/slab.h]
    [akpm@linux-foundation.org: fix fs/crypto/inline_crypt.c some more]

    Suggested-by: Joe Perches
    Signed-off-by: Waiman Long
    Signed-off-by: Andrew Morton
    Acked-by: David Howells
    Acked-by: Michal Hocko
    Acked-by: Johannes Weiner
    Cc: Jarkko Sakkinen
    Cc: James Morris
    Cc: "Serge E. Hallyn"
    Cc: Joe Perches
    Cc: Matthew Wilcox
    Cc: David Rientjes
    Cc: Dan Carpenter
    Cc: "Jason A . Donenfeld"
    Link: http://lkml.kernel.org/r/20200616154311.12314-3-longman@redhat.com
    Signed-off-by: Linus Torvalds

    Waiman Long
     

14 Jun, 2020

1 commit

  • Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over
    '---help---'"), the number of '---help---' has been gradually
    decreasing, but there are still more than 2400 instances.

    This commit finishes the conversion. While I touched the lines,
    I also fixed the indentation.

    There are a variety of indentation styles found.

    a) 4 spaces + '---help---'
    b) 7 spaces + '---help---'
    c) 8 spaces + '---help---'
    d) 1 space + 1 tab + '---help---'
    e) 1 tab + '---help---' (correct indentation)
    f) 1 tab + 1 space + '---help---'
    g) 1 tab + 2 spaces + '---help---'

    In order to convert all of them to 1 tab + 'help', I ran the
    following commend:

    $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

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 version 2 as
    published by the free software foundation 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

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

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

    Thomas Gleixner
     

21 May, 2019

1 commit


28 Sep, 2018

1 commit

  • In the quest to remove all stack VLA usage from the kernel[1], this
    replaces struct crypto_skcipher and SKCIPHER_REQUEST_ON_STACK() usage
    with struct crypto_sync_skcipher and SYNC_SKCIPHER_REQUEST_ON_STACK(),
    which uses a fixed stack size.

    [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

    Cc: Alexander Aring
    Cc: Stefan Schmidt
    Cc: linux-wpan@vger.kernel.org
    Signed-off-by: Kees Cook
    Signed-off-by: Herbert Xu

    Kees Cook
     

06 Aug, 2018

1 commit


29 Mar, 2018

1 commit


04 Nov, 2017

1 commit


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

2 commits

  • According to 802.15.4-2003/2006/2015 specifications the MAC frame is
    composed of MHR, MAC payload and MFR and just the outgoing MAC payload
    must be encrypted.

    If communication is secure,sender build Auxiliary Security Header(ASH),
    insert it next to the standard MHR header with security enabled bit ON,
    and secure frames before transmitting them. According to the information
    carried within the ASH, recipient retrieves the right cryptographic key
    and correctly un-secure MAC frames.

    The error scenario occurs on Linux using IEEE802154_SCF_SECLEVEL_ENC(4)
    security level when llsec_do_encrypt_unauth() function builds theses MAC
    frames incorrectly. On recipients these MAC frames are discarded,logging
    "got invalid frame" messages.

    Signed-off-by: Diogenes Pereira
    Signed-off-by: Stefan Schmidt

    Diogenes Pereira
     
  • Use IEEE802154_SCF_SECLEVEL_NONE macro defined at ieee802154.h file.

    Signed-off-by: Diogenes Pereira
    Signed-off-by: Stefan Schmidt

    Diogenes Pereira
     

08 Jun, 2017

1 commit

  • Network devices can allocate reasources and private memory using
    netdev_ops->ndo_init(). However, the release of these resources
    can occur in one of two different places.

    Either netdev_ops->ndo_uninit() or netdev->destructor().

    The decision of which operation frees the resources depends upon
    whether it is necessary for all netdev refs to be released before it
    is safe to perform the freeing.

    netdev_ops->ndo_uninit() presumably can occur right after the
    NETDEV_UNREGISTER notifier completes and the unicast and multicast
    address lists are flushed.

    netdev->destructor(), on the other hand, does not run until the
    netdev references all go away.

    Further complicating the situation is that netdev->destructor()
    almost universally does also a free_netdev().

    This creates a problem for the logic in register_netdevice().
    Because all callers of register_netdevice() manage the freeing
    of the netdev, and invoke free_netdev(dev) if register_netdevice()
    fails.

    If netdev_ops->ndo_init() succeeds, but something else fails inside
    of register_netdevice(), it does call ndo_ops->ndo_uninit(). But
    it is not able to invoke netdev->destructor().

    This is because netdev->destructor() will do a free_netdev() and
    then the caller of register_netdevice() will do the same.

    However, this means that the resources that would normally be released
    by netdev->destructor() will not be.

    Over the years drivers have added local hacks to deal with this, by
    invoking their destructor parts by hand when register_netdevice()
    fails.

    Many drivers do not try to deal with this, and instead we have leaks.

    Let's close this hole by formalizing the distinction between what
    private things need to be freed up by netdev->destructor() and whether
    the driver needs unregister_netdevice() to perform the free_netdev().

    netdev->priv_destructor() performs all actions to free up the private
    resources that used to be freed by netdev->destructor(), except for
    free_netdev().

    netdev->needs_free_netdev is a boolean that indicates whether
    free_netdev() should be done at the end of unregister_netdevice().

    Now, register_netdevice() can sanely release all resources after
    ndo_ops->ndo_init() succeeds, by invoking both ndo_ops->ndo_uninit()
    and netdev->priv_destructor().

    And at the end of unregister_netdevice(), we invoke
    netdev->priv_destructor() and optionally call free_netdev().

    Signed-off-by: David S. Miller

    David S. Miller
     

31 Mar, 2017

1 commit

  • These files all use functions declared in interrupt.h, but currently rely
    on implicit inclusion of this file (via netns/xfrm.h).

    That won't work anymore when the flow cache is removed so include that
    header where needed.

    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     

02 Mar, 2017

1 commit


26 Dec, 2016

1 commit

  • ktime_set(S,N) was required for the timespec storage type and is still
    useful for situations where a Seconds and Nanoseconds part of a time value
    needs to be converted. For anything where the Seconds argument is 0, this
    is pointless and can be replaced with a simple assignment.

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra

    Thomas Gleixner
     

16 Dec, 2016

1 commit


20 Sep, 2016

3 commits


20 Mar, 2016

1 commit

  • Pull networking updates from David Miller:
    "Highlights:

    1) Support more Realtek wireless chips, from Jes Sorenson.

    2) New BPF types for per-cpu hash and arrap maps, from Alexei
    Starovoitov.

    3) Make several TCP sysctls per-namespace, from Nikolay Borisov.

    4) Allow the use of SO_REUSEPORT in order to do per-thread processing
    of incoming TCP/UDP connections. The muxing can be done using a
    BPF program which hashes the incoming packet. From Craig Gallek.

    5) Add a multiplexer for TCP streams, to provide a messaged based
    interface. BPF programs can be used to determine the message
    boundaries. From Tom Herbert.

    6) Add 802.1AE MACSEC support, from Sabrina Dubroca.

    7) Avoid factorial complexity when taking down an inetdev interface
    with lots of configured addresses. We were doing things like
    traversing the entire address less for each address removed, and
    flushing the entire netfilter conntrack table for every address as
    well.

    8) Add and use SKB bulk free infrastructure, from Jesper Brouer.

    9) Allow offloading u32 classifiers to hardware, and implement for
    ixgbe, from John Fastabend.

    10) Allow configuring IRQ coalescing parameters on a per-queue basis,
    from Kan Liang.

    11) Extend ethtool so that larger link mode masks can be supported.
    From David Decotigny.

    12) Introduce devlink, which can be used to configure port link types
    (ethernet vs Infiniband, etc.), port splitting, and switch device
    level attributes as a whole. From Jiri Pirko.

    13) Hardware offload support for flower classifiers, from Amir Vadai.

    14) Add "Local Checksum Offload". Basically, for a tunneled packet
    the checksum of the outer header is 'constant' (because with the
    checksum field filled into the inner protocol header, the payload
    of the outer frame checksums to 'zero'), and we can take advantage
    of that in various ways. From Edward Cree"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1548 commits)
    bonding: fix bond_get_stats()
    net: bcmgenet: fix dma api length mismatch
    net/mlx4_core: Fix backward compatibility on VFs
    phy: mdio-thunder: Fix some Kconfig typos
    lan78xx: add ndo_get_stats64
    lan78xx: handle statistics counter rollover
    RDS: TCP: Remove unused constant
    RDS: TCP: Add sysctl tunables for sndbuf/rcvbuf on rds-tcp socket
    net: smc911x: convert pxa dma to dmaengine
    team: remove duplicate set of flag IFF_MULTICAST
    bonding: remove duplicate set of flag IFF_MULTICAST
    net: fix a comment typo
    ethernet: micrel: fix some error codes
    ip_tunnels, bpf: define IP_TUNNEL_OPTS_MAX and use it
    bpf, dst: add and use dst_tclassid helper
    bpf: make skb->tc_classid also readable
    net: mvneta: bm: clarify dependencies
    cls_bpf: reset class and reuse major in da
    ldmvsw: Checkpatch sunvnet.c and sunvnet_common.c
    ldmvsw: Add ldmvsw.c driver code
    ...

    Linus Torvalds
     

24 Feb, 2016

1 commit


27 Jan, 2016

1 commit


05 Jan, 2016

1 commit


11 Dec, 2015

1 commit

  • This patch reverts 6001d52 ("mac802154: tx: don't allow if down while
    sync tx"). This has side effects with stop callback which flush the
    transmit workqueue. The stop callback will wait until the workqueue is
    flushed and holding the rtnl lock. That means it can happen that the stop
    callback waits forever because it try to lock the rtnl mutex which is
    already hold by stop callback.

    Cc: Michael Hennerich
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

20 Nov, 2015

1 commit


21 Oct, 2015

1 commit


30 Sep, 2015

3 commits

  • This patch changes the mtu size of 802.15.4 interfaces. The current
    setting is the meaning of the maximum transport unit with mac header,
    which is 127 bytes according 802.15.4. The linux meaning of the mtu size
    field is the maximum payload of a mac frame. Like in ethernet, which is
    1500 bytes.

    We have dynamic length of mac frames in 802.15.4, this is why we assume
    the minimum header length which is hard_header_len. This contains fc and
    sequence fields. These can evaluated by driver layer without additional
    checks. We currently don't support to set the FCS from userspace, so we
    need to subtract this from mtu size as well.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • While doing a little test with the llsec implementation I saw these
    issues. We should move decryption and encruption somewhere else,
    otherwise while capturing with wireshark the mac header shows secuirty
    fields but the payload is plaintext.

    A complete other issue is what doing with HardMAC drivers where the
    payload is always plaintext. I think we need a special handling then in
    userspace. We currently doesn't support any HardMAC transceivers, so we
    should fix the first issue for SoftMAC transceivers.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch adds support for accessing mac802154 llsec implementation
    over nl802154. I added for a new Kconfig entry to provide this
    functionality CONFIG_IEEE802154_NL802154_EXPERIMENTAL. This interface is
    still in development. It provides to change security parameters and
    add/del/dump entries of security tables. Later we can add also a get to
    get an entry by unique identifier.

    Cc: Phoebe Buckheister
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

25 Sep, 2015

1 commit

  • The callback "create" and "parse" from header_ops are called from
    netdev core upper-layer functionality, like af_packet. These callbacks
    assumes big endian for addresses and we should not introduce a special
    byteordering handling for ieee802154 over af_packet in userspace.

    We have an identical issue with setting the mac address which also
    assumes big endian byteordering.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

22 Sep, 2015

4 commits

  • Sending over AF_PACKET RAW sockets we can sending frames which exceeds
    MTU size. To handling it correct we need to change things in AF_PACKET
    which knows on RAW sockets an additional FCS is set by hardware or
    mac802154 transmit functionality.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch cleanups needed_headroom, needed_tailroom and hard_header_len
    fields for wpan and lowpan interfaces.

    For wpan interfaces the worst case mac header len should be part of
    needed_headroom, currently this is set as hard_header_len, but
    hard_header_len should be set to the minimum header length which xmit
    call assumes and this is the minimum frame length of 802.15.4.
    The hard_header_len value will check inside send callbacl of AF_PACKET
    raw sockets.

    For lowpan interfaces, if fragmentation isn't needed the skb will
    call dev_hard_header for 802154 layer and queue it afterwards. This
    happens without new skb allocation, so we need the same headroom and
    tailroom lengths like 802154 inside 802154 6lowpan layer. At least we
    assume as minimum header length an ipv6 header size.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • The current header_ops callback structure of net device are used mostly
    from 802.15.4 upper-layers. Because this callback structure is a very
    generic one, which is also used by e.g. DGRAM AF_PACKET sockets, we
    can't make this callback structure 802.15.4 specific which is currently
    is.

    I saw the smallest "constraint" for calling this callback with
    dev_hard_header/dev_parse_header by AF_PACKET which assign a 8 byte
    array for address void pointers. Currently 802.15.4 specific protocols
    like af802154 and 6LoWPAN will assign the "struct ieee802154_addr" as
    these parameters which is greater than 8 bytes. The current callback
    implementation for header_ops.create assumes always a complete
    "struct ieee802154_addr" which AF_PACKET can't never handled and is
    greater than 8 bytes.

    For that reason we introduce now a "generic" create/parse header_ops
    callback which allows handling with intra-pan extended addresses only.
    This allows a small use-case with AF_PACKET to send "somehow" a valid
    dataframe over DGRAM.

    To keeping the current dev_hard_header behaviour we introduce a similar
    callback structure "wpan_dev_header_ops" which contains 802.15.4 specific
    upper-layer header creation functionality, which can be called by
    wpan_dev_hard_header.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch adds a missing list_del when a device description will be
    deleted.

    Cc: Phoebe Buckheister
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

11 Aug, 2015

4 commits

  • This patch introduce a new mib entry which isn't part of 802.15.4 but
    useful as default behaviour to set the ack request bit or not if we
    don't know if the ack request bit should set. This is currently used for
    stacks like IEEE 802.15.4 6LoWPAN.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch changes the default minimum value of frame_retries to 0 and
    changes the frame_retries default value to 3 which is also 802.15.4
    default.

    We don't use the frame_retries "-1" value as indicator for no-aret mode
    anymore, instead we checking on the ack request bit inside the 802.15.4
    frame control field. This allows a acknowledge handling per frame. This
    checking is done by transceiver or inside xmit callback of driver layer.

    If a transceiver doesn't support ARET handling the transmit
    functionality ignores ack frames then, which isn't well but should not
    effect anything of current functionality.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch removes several checks if a value is really changed. This
    makes only sense if we have another layer call e.g. calling the
    driver_ops which is done by callbacks like "set_channel".

    For MAC settings which need to be set by phy registers (if the phy
    supports that handling) this is set by doing an interface up currently
    and are not direct driver_ops calls, so we remove the checks from these
    configuration callbacks.

    Reviewed-by: Stefan Schmidt
    Suggested-by: Phoebe Buckheister
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • If we currently change the mac address inside the wpan interface while
    we have a lowpan interface on top of the wpan interface, the mac address
    setting doesn't reach the lowpan interface. The effect would be that the
    IPv6 lowpan interface has the old SLAAC address and isn't working
    anymore because the lowpan interface use in internal mechanism sometimes
    dev->addr which is the old mac address of the wpan interface.

    This patch checks if a wpan interface belongs to lowpan interface, if
    yes then we need to check if the lowpan interface is down and change the
    mac address also at the lowpan interface. When the lowpan interface will
    be set up afterwards, it will use the correct SLAAC address which based
    on the updated mac address setting.

    Reviewed-by: Stefan Schmidt
    Tested-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring