09 Feb, 2022

1 commit

  • commit 79c37ca73a6e9a33f7b2b7783ba6af07a448c8a9 upstream.

    Returning -1 does not indicate anything useful.

    Use a standard and meaningful error code instead.

    Fixes: a26c5fd7622d ("nl802154: add support for security layer")
    Signed-off-by: Miquel Raynal
    Acked-by: Alexander Aring
    Link: https://lore.kernel.org/r/20220125121426.848337-6-miquel.raynal@bootlin.com
    Signed-off-by: Stefan Schmidt
    Signed-off-by: Greg Kroah-Hartman

    Miquel Raynal
     

13 Aug, 2021

1 commit

  • Conflicts:

    drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
    9e26680733d5 ("bnxt_en: Update firmware call to retrieve TX PTP timestamp")
    9e518f25802c ("bnxt_en: 1PPS functions to configure TSIO pins")
    099fdeda659d ("bnxt_en: Event handler for PPS events")

    kernel/bpf/helpers.c
    include/linux/bpf-cgroup.h
    a2baf4e8bb0f ("bpf: Fix potentially incorrect results with bpf_get_local_storage()")
    c7603cfa04e7 ("bpf: Add ambient BPF runtime context stored in current")

    drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
    5957cc557dc5 ("net/mlx5: Set all field of mlx5_irq before inserting it to the xarray")
    2d0b41a37679 ("net/mlx5: Refcount mlx5_irq with integer")

    MAINTAINERS
    7b637cd52f02 ("MAINTAINERS: fix Microchip CAN BUS Analyzer Tool entry typo")
    7d901a1e878a ("net: phy: add Maxlinear GPY115/21x/24x driver")

    Signed-off-by: Jakub Kicinski

    Jakub Kicinski
     

10 Aug, 2021

1 commit

  • If IEEE-802.15.4-RAW is closed before receive skb, skb is leaked.
    Fix this, by freeing sk_receive_queue in sk->sk_destruct().

    syzbot report:
    BUG: memory leak
    unreferenced object 0xffff88810f644600 (size 232):
    comm "softirq", pid 0, jiffies 4294967032 (age 81.270s)
    hex dump (first 32 bytes):
    10 7d 4b 12 81 88 ff ff 10 7d 4b 12 81 88 ff ff .}K......}K.....
    00 00 00 00 00 00 00 00 40 7c 4b 12 81 88 ff ff ........@|K.....
    backtrace:
    [] skb_clone+0xaa/0x2b0 net/core/skbuff.c:1496
    [] ieee802154_raw_deliver net/ieee802154/socket.c:369 [inline]
    [] ieee802154_rcv+0x100/0x340 net/ieee802154/socket.c:1070
    [] __netif_receive_skb_one_core+0x6a/0xa0 net/core/dev.c:5384
    [] __netif_receive_skb+0x27/0xa0 net/core/dev.c:5498
    [] netif_receive_skb_internal net/core/dev.c:5603 [inline]
    [] netif_receive_skb+0x59/0x260 net/core/dev.c:5662
    [] ieee802154_deliver_skb net/mac802154/rx.c:29 [inline]
    [] ieee802154_subif_frame net/mac802154/rx.c:102 [inline]
    [] __ieee802154_rx_handle_packet net/mac802154/rx.c:212 [inline]
    [] ieee802154_rx+0x612/0x620 net/mac802154/rx.c:284
    [] ieee802154_tasklet_handler+0x86/0xa0 net/mac802154/main.c:35
    [] tasklet_action_common.constprop.0+0x5b/0x100 kernel/softirq.c:557
    [] __do_softirq+0xbf/0x2ab kernel/softirq.c:345
    [] do_softirq kernel/softirq.c:248 [inline]
    [] do_softirq+0x5c/0x80 kernel/softirq.c:235
    [] __local_bh_enable_ip+0x51/0x60 kernel/softirq.c:198
    [] local_bh_enable include/linux/bottom_half.h:32 [inline]
    [] rcu_read_unlock_bh include/linux/rcupdate.h:745 [inline]
    [] __dev_queue_xmit+0x7f4/0xf60 net/core/dev.c:4221
    [] raw_sendmsg+0x1f4/0x2b0 net/ieee802154/socket.c:295
    [] sock_sendmsg_nosec net/socket.c:654 [inline]
    [] sock_sendmsg+0x56/0x80 net/socket.c:674
    [] __sys_sendto+0x15c/0x200 net/socket.c:1977
    [] __do_sys_sendto net/socket.c:1989 [inline]
    [] __se_sys_sendto net/socket.c:1985 [inline]
    [] __x64_sys_sendto+0x26/0x30 net/socket.c:1985

    Fixes: 9ec767160357 ("net: add IEEE 802.15.4 socket family implementation")
    Reported-and-tested-by: syzbot+1f68113fa907bf0695a8@syzkaller.appspotmail.com
    Signed-off-by: Takeshi Misawa
    Acked-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210805075414.GA15796@DESKTOP
    Signed-off-by: Stefan Schmidt

    Takeshi Misawa
     

05 Aug, 2021

1 commit


23 Jul, 2021

1 commit

  • compat_ifreq_ioctl() is one of the last users of copy_in_user() and
    compat_alloc_user_space(), as it attempts to convert the 'struct ifreq'
    arguments from 32-bit to 64-bit format as used by dev_ioctl() and a
    couple of socket family specific interpretations.

    The current implementation works correctly when calling dev_ioctl(),
    inet_ioctl(), ieee802154_sock_ioctl(), atalk_ioctl(), qrtr_ioctl()
    and packet_ioctl(). The ioctl handlers for x25, netrom, rose and x25 do
    not interpret the arguments and only block the corresponding commands,
    so they do not care.

    For af_inet6 and af_decnet however, the compat conversion is slightly
    incorrect, as it will copy more data than the native handler accesses,
    both of them use a structure that is shorter than ifreq.

    Replace the copy_in_user() conversion with a pair of accessor functions
    to read and write the ifreq data in place with the correct length where
    needed, while leaving the other ones to copy the (already compatible)
    structures directly.

    Signed-off-by: Arnd Bergmann
    Reviewed-by: Christoph Hellwig
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

03 Jun, 2021

3 commits

  • Fix to return negative error code -ENOBUFS from the error handling
    case instead of 0, as done elsewhere in this function.

    Fixes: 3e9c156e2c21 ("ieee802154: add netlink interfaces for llsec")
    Reported-by: Hulk Robot
    Signed-off-by: Wei Yongjun
    Link: https://lore.kernel.org/r/20210519141614.3040055-1-weiyongjun1@huawei.com
    Signed-off-by: Stefan Schmidt

    Wei Yongjun
     
  • Fix to return a negative error code from the error handling
    case instead of 0, as done elsewhere in this function.

    Fixes: be51da0f3e34 ("ieee802154: Stop using NLA_PUT*().")
    Reported-by: Hulk Robot
    Signed-off-by: Zhen Lei
    Link: https://lore.kernel.org/r/20210508062517.2574-1-thunder.leizhen@huawei.com
    Signed-off-by: Stefan Schmidt

    Zhen Lei
     
  • In order to keep the code style consistency of the whole file,
    redundant return value ‘rc’ and its assignments should be deleted

    The clang_analyzer complains as follows:
    net/ieee802154/nl-mac.c:1203:12: warning: Although the value stored to
    'rc' is used in the enclosing expression, the value is never actually
    read from 'rc'

    No functional change, only more efficient.

    Reported-by: Abaci Robot
    Signed-off-by: Yang Li
    Link: https://lore.kernel.org/r/1619346299-40237-1-git-send-email-yang.lee@linux.alibaba.com
    Signed-off-by: Stefan Schmidt

    Yang Li
     

23 Apr, 2021

1 commit


07 Apr, 2021

14 commits

  • This patch stops dumping llsec params for monitors which we don't support
    yet. Otherwise we will access llsec mib which isn't initialized for
    monitors.

    Reported-by: syzbot+cde43a581a8e5f317bc2@syzkaller.appspotmail.com
    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-16-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch forbids to del llsec seclevel for monitor interfaces which we
    don't support yet. Otherwise we will access llsec mib which isn't
    initialized for monitors.

    Reported-by: syzbot+fbf4fc11a819824e027b@syzkaller.appspotmail.com
    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-15-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch forbids to add llsec seclevel for monitor interfaces which we
    don't support yet. Otherwise we will access llsec mib which isn't
    initialized for monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-14-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch stops dumping llsec seclevels for monitors which we don't
    support yet. Otherwise we will access llsec mib which isn't initialized
    for monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-13-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch forbids to del llsec devkey for monitor interfaces which we
    don't support yet. Otherwise we will access llsec mib which isn't
    initialized for monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-12-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch forbids to add llsec devkey for monitor interfaces which we
    don't support yet. Otherwise we will access llsec mib which isn't
    initialized for monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-11-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch stops dumping llsec devkeys for monitors which we don't support
    yet. Otherwise we will access llsec mib which isn't initialized for
    monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-10-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch forbids to del llsec dev for monitor interfaces which we
    don't support yet. Otherwise we will access llsec mib which isn't
    initialized for monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-9-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch forbids to add llsec dev for monitor interfaces which we
    don't support yet. Otherwise we will access llsec mib which isn't
    initialized for monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-8-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch stops dumping llsec devs for monitors which we don't support
    yet. Otherwise we will access llsec mib which isn't initialized for
    monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-7-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch forbids to del llsec key for monitor interfaces which we
    don't support yet. Otherwise we will access llsec mib which isn't
    initialized for monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-6-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch forbids to add llsec key for monitor interfaces which we
    don't support yet. Otherwise we will access llsec mib which isn't
    initialized for monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-5-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch stops dumping llsec keys for monitors which we don't support
    yet. Otherwise we will access llsec mib which isn't initialized for
    monitors.

    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-4-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch forbids to set llsec params for monitor interfaces which we
    don't support yet.

    Reported-by: syzbot+8b6719da8a04beeafcc3@syzkaller.appspotmail.com
    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210405003054.256017-3-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     

03 Mar, 2021

1 commit

  • This patch fixes a null pointer derefence for panid handle by move the
    check for the netlink variable directly before accessing them.

    Reported-by: syzbot+d4c07de0144f6f63be3a@syzkaller.appspotmail.com
    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210228151817.95700-4-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     

24 Feb, 2021

5 commits

  • This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_DEVKEY is
    not set by the user. If this is the case nl802154 will return -EINVAL.

    Reported-by: syzbot+368672e0da240db53b5f@syzkaller.appspotmail.com
    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210221174321.14210-4-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_KEY is
    not set by the user. If this is the case nl802154 will return -EINVAL.

    Reported-by: syzbot+ce4e062c2d51977ddc50@syzkaller.appspotmail.com
    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210221174321.14210-3-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_DEVICE is
    not set by the user. If this is the case nl802154 will return -EINVAL.

    Reported-by: syzbot+d946223c2e751d136c94@syzkaller.appspotmail.com
    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210221174321.14210-2-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_KEY is
    not set by the user. If this is the case nl802154 will return -EINVAL.

    Reported-by: syzbot+ac5c11d2959a8b3c4806@syzkaller.appspotmail.com
    Signed-off-by: Alexander Aring
    Link: https://lore.kernel.org/r/20210221174321.14210-1-aahringo@redhat.com
    Signed-off-by: Stefan Schmidt

    Alexander Aring
     
  • Stefan Schmidt
     

17 Nov, 2020

1 commit


06 Nov, 2020

1 commit

  • Signed-off-by: Alex Shi
    Cc: Alexander Aring
    Cc: Stefan Schmidt
    Cc: "David S. Miller"
    Cc: Jakub Kicinski
    Cc: linux-wpan@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Link: https://lore.kernel.org/r/1604650237-22192-1-git-send-email-alex.shi@linux.alibaba.com
    Signed-off-by: Stefan Schmidt

    Alex Shi
     

03 Oct, 2020

1 commit


24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

25 Jul, 2020

1 commit

  • Rework the remaining setsockopt code to pass a sockptr_t instead of a
    plain user pointer. This removes the last remaining set_fs(KERNEL_DS)
    outside of architecture specific code.

    Signed-off-by: Christoph Hellwig
    Acked-by: Stefan Schmidt [ieee802154]
    Acked-by: Matthieu Baerts
    Signed-off-by: David S. Miller

    Christoph Hellwig
     

20 Jul, 2020

1 commit

  • Add the compat handling to sock_common_{get,set}sockopt instead,
    keyed of in_compat_syscall(). This allow to remove the now unused
    ->compat_{get,set}sockopt methods from struct proto_ops.

    Signed-off-by: Christoph Hellwig
    Acked-by: Matthieu Baerts
    Acked-by: Stefan Schmidt
    Signed-off-by: David S. Miller

    Christoph Hellwig
     

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
     

09 May, 2020

1 commit


05 May, 2020

1 commit

  • This patch reverts the folowing commits:

    commit 064ff66e2bef84f1153087612032b5b9eab005bd
    "bonding: add missing netdev_update_lockdep_key()"

    commit 53d374979ef147ab51f5d632dfe20b14aebeccd0
    "net: avoid updating qdisc_xmit_lock_key in netdev_update_lockdep_key()"

    commit 1f26c0d3d24125992ab0026b0dab16c08df947c7
    "net: fix kernel-doc warning in "

    commit ab92d68fc22f9afab480153bd82a20f6e2533769
    "net: core: add generic lockdep keys"

    but keeps the addr_list_lock_key because we still lock
    addr_list_lock nestedly on stack devices, unlikely xmit_lock
    this is safe because we don't take addr_list_lock on any fast
    path.

    Reported-and-tested-by: syzbot+aaa6fa4949cc5d9b7b25@syzkaller.appspotmail.com
    Cc: Dmitry Vyukov
    Cc: Taehee Yoo
    Signed-off-by: Cong Wang
    Acked-by: Taehee Yoo
    Signed-off-by: David S. Miller

    Cong Wang
     

04 Mar, 2020

2 commits