10 Jan, 2020

1 commit

  • The page pool keeps track of the number of pages in flight, and
    it isn't safe to remove the pool until all pages are returned.

    Disallow removing the pool until all pages are back, so the pool
    is always available for page producers.

    Make the page pool responsible for its own delayed destruction
    instead of relying on XDP, so the page pool can be used without
    the xdp memory model.

    When all pages are returned, free the pool and notify xdp if the
    pool is registered with the xdp memory system. Have the callback
    perform a table walk since some drivers (cpsw) may share the pool
    among multiple xdp_rxq_info.

    Note that the increment of pages_state_release_cnt may result in
    inflight == 0, resulting in the pool being released.

    Fixes: d956a048cd3f ("xdp: force mem allocator removal and periodic warning")
    Signed-off-by: Jonathan Lemon
    Acked-by: Jesper Dangaard Brouer
    Acked-by: Ilias Apalodimas
    Signed-off-by: David S. Miller

    Jonathan Lemon
     

16 Dec, 2019

1 commit

  • This is the 5.4.3 stable release

    Conflicts:
    drivers/cpufreq/imx-cpufreq-dt.c
    drivers/spi/spi-fsl-qspi.c

    The conflict is very minor, fixed it when do the merge. The imx-cpufreq-dt.c
    is just one line code-style change, using upstream one, no any function change.

    The spi-fsl-qspi.c has minor conflicts when merge upstream fixes: c69b17da53b2
    spi: spi-fsl-qspi: Clear TDH bits in FLSHCR register

    After merge, basic boot sanity test and basic qspi test been done on i.mx

    Signed-off-by: Jason Liu

    Jason Liu
     

13 Dec, 2019

2 commits

  • commit 8670b2b8b029a6650d133486be9d2ace146fd29a upstream.

    udev has a feature of creating /dev/ device-nodes if it finds
    a devnode: modalias. This allows for auto-loading of modules that
    provide the node. This requires to use a statically allocated minor
    number for misc character devices.

    However, rfkill uses dynamic minor numbers and prevents auto-loading
    of the module. So allocate the next static misc minor number and use
    it for rfkill.

    Signed-off-by: Marcel Holtmann
    Link: https://lore.kernel.org/r/20191024174042.19851-1-marcel@holtmann.org
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Marcel Holtmann
     
  • commit 66eb3add452aa1be65ad536da99fac4b8f620b74 upstream.

    Jon Hunter: "I have been tracking down another suspend/NFS related
    issue where again I am seeing random delays exiting suspend. The delays
    can be up to a couple minutes in the worst case and this is causing a
    suspend test we have to fail."

    Change the use of a deferrable work to a standard delayed one.

    Reported-by: Jon Hunter
    Tested-by: Jon Hunter
    Fixes: 7e0a0e38fcfea ("SUNRPC: Replace the queue timer with a delayed work function")
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    Trond Myklebust
     

05 Dec, 2019

15 commits

  • [ Upstream commit fd567ac20cb0377ff466d3337e6e9ac5d0cb15e4 ]

    In commit 4f07b80c9733 ("tipc: check msg->req data len in
    tipc_nl_compat_bearer_disable") the same patch code was copied into
    routines: tipc_nl_compat_bearer_disable(),
    tipc_nl_compat_link_stat_dump() and tipc_nl_compat_link_reset_stats().
    The two link routine occurrences should have been modified to check
    the maximum link name length and not bearer name length.

    Fixes: 4f07b80c9733 ("tipc: check msg->reg data len in tipc_nl_compat_bearer_disable")
    Signed-off-by: John Rutherford
    Acked-by: Jon Maloy
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    John Rutherford
     
  • [ Upstream commit c5daa6cccdc2f94aca2c9b3fa5f94e4469997293 ]

    Partially sent record cleanup path increments an SG entry
    directly instead of using sg_next(). This should not be a
    problem today, as encrypted messages should be always
    allocated as arrays. But given this is a cleanup path it's
    easy to miss was this ever to change. Use sg_next(), and
    simplify the code.

    Signed-off-by: Jakub Kicinski
    Reviewed-by: Simon Horman
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Jakub Kicinski
     
  • [ Upstream commit 9e5ffed37df68d0ccfb2fdc528609e23a1e70ebe ]

    Looks like when BPF support was added by commit d3b18ad31f93
    ("tls: add bpf support to sk_msg handling") and
    commit d829e9c4112b ("tls: convert to generic sk_msg interface")
    it broke/removed the support for in-place crypto as added by
    commit 4e6d47206c32 ("tls: Add support for inplace records
    encryption").

    The inplace_crypto member of struct tls_rec is dead, inited
    to zero, and sometimes set to zero again. It used to be
    set to 1 when record was allocated, but the skmsg code doesn't
    seem to have been written with the idea of in-place crypto
    in mind.

    Since non trivial effort is required to bring the feature back
    and we don't really have the HW to measure the benefit just
    remove the left over support for now to avoid confusing readers.

    Signed-off-by: Jakub Kicinski
    Reviewed-by: Simon Horman
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Jakub Kicinski
     
  • [ Upstream commit 031097d9e079e40dce401031d1012e83d80eaf01 ]

    TLS 1.3 started using the entry at the end of the SG array
    for chaining-in the single byte content type entry. This mostly
    works:

    [ E E E E E E . . ]
    ^ ^
    start end

    E < content type
    /
    [ E E E E E E C . ]
    ^ ^
    start end

    (Where E denotes a populated SG entry; C denotes a chaining entry.)

    If the array is full, however, the end will point to the start:

    [ E E E E E E E E ]
    ^
    start
    end

    And we end up overwriting the start:

    E < content type
    /
    [ C E E E E E E E ]
    ^
    start
    end

    The sg array is supposed to be a circular buffer with start and
    end markers pointing anywhere. In case where start > end
    (i.e. the circular buffer has "wrapped") there is an extra entry
    reserved at the end to chain the two halves together.

    [ E E E E E E . . l ]

    (Where l is the reserved entry for "looping" back to front.

    As suggested by John, let's reserve another entry for chaining
    SG entries after the main circular buffer. Note that this entry
    has to be pointed to by the end entry so its position is not fixed.

    Examples of full messages:

    [ E E E E E E E E . l ]
    ^ ^
    start end


    Reviewed-by: Simon Horman
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Jakub Kicinski
     
  • [ Upstream commit d10523d0b3d78153ee58d19853ced26c9004c8c4 ]

    When tls_do_encryption() fails the SG lists are left with the
    SG_END and SG_CHAIN marks in place. One could hope that once
    encryption fails we will never see the record again, but that
    is in fact not true. Commit d3b18ad31f93 ("tls: add bpf support
    to sk_msg handling") added special handling to ENOMEM and ENOSPC
    errors which mean we may see the same record re-submitted.

    As suggested by John free the record, the BPF code is already
    doing just that.

    Reported-by: syzbot+df0d4ec12332661dd1f9@syzkaller.appspotmail.com
    Fixes: d3b18ad31f93 ("tls: add bpf support to sk_msg handling")
    Signed-off-by: Jakub Kicinski
    Reviewed-by: Simon Horman
    Acked-by: John Fastabend
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Jakub Kicinski
     
  • [ Upstream commit c329ef9684de9517d82af5b4758c9e1b64a8a11a ]

    bpf_exec_tx_verdict() may free the record if tls_push_record()
    fails, or if the entire record got consumed by BPF. Re-check
    ctx->open_rec before touching the data.

    Fixes: d3b18ad31f93 ("tls: add bpf support to sk_msg handling")
    Signed-off-by: Jakub Kicinski
    Reviewed-by: Simon Horman
    Acked-by: John Fastabend
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Jakub Kicinski
     
  • [ Upstream commit 8a574f86652a4540a2433946ba826ccb87f398cc ]

    If we can't build the flow del notification, we can simply delete
    the flow, no need to crash the kernel. Still keep a WARN_ON to
    preserve debuggability.

    Note: the BUG_ON() predates the Fixes tag, but this change
    can be applied only after the mentioned commit.

    v1 -> v2:
    - do not leak an skb on error

    Fixes: aed067783e50 ("openvswitch: Minimize ovs_flow_cmd_del critical section.")
    Signed-off-by: Paolo Abeni
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Paolo Abeni
     
  • [ Upstream commit 8ffeb03fbba3b599690b361467bfd2373e8c450f ]

    All the callers of ovs_flow_cmd_build_info() already deal with
    error return code correctly, so we can handle the error condition
    in a more gracefull way. Still dump a warning to preserve
    debuggability.

    v1 -> v2:
    - clarify the commit message
    - clean the skb and report the error (DaveM)

    Fixes: ccb1352e76cf ("net: Add Open vSwitch kernel components.")
    Signed-off-by: Paolo Abeni
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Paolo Abeni
     
  • [ Upstream commit 312434617cb16be5166316cf9d08ba760b1042a1 ]

    This patch is to fix a data-race reported by syzbot:

    BUG: KCSAN: data-race in sctp_assoc_migrate / sctp_hash_obj

    write to 0xffff8880b67c0020 of 8 bytes by task 18908 on cpu 1:
    sctp_assoc_migrate+0x1a6/0x290 net/sctp/associola.c:1091
    sctp_sock_migrate+0x8aa/0x9b0 net/sctp/socket.c:9465
    sctp_accept+0x3c8/0x470 net/sctp/socket.c:4916
    inet_accept+0x7f/0x360 net/ipv4/af_inet.c:734
    __sys_accept4+0x224/0x430 net/socket.c:1754
    __do_sys_accept net/socket.c:1795 [inline]
    __se_sys_accept net/socket.c:1792 [inline]
    __x64_sys_accept+0x4e/0x60 net/socket.c:1792
    do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    read to 0xffff8880b67c0020 of 8 bytes by task 12003 on cpu 0:
    sctp_hash_obj+0x4f/0x2d0 net/sctp/input.c:894
    rht_key_get_hash include/linux/rhashtable.h:133 [inline]
    rht_key_hashfn include/linux/rhashtable.h:159 [inline]
    rht_head_hashfn include/linux/rhashtable.h:174 [inline]
    head_hashfn lib/rhashtable.c:41 [inline]
    rhashtable_rehash_one lib/rhashtable.c:245 [inline]
    rhashtable_rehash_chain lib/rhashtable.c:276 [inline]
    rhashtable_rehash_table lib/rhashtable.c:316 [inline]
    rht_deferred_worker+0x468/0xab0 lib/rhashtable.c:420
    process_one_work+0x3d4/0x890 kernel/workqueue.c:2269
    worker_thread+0xa0/0x800 kernel/workqueue.c:2415
    kthread+0x1d4/0x200 drivers/block/aoe/aoecmd.c:1253
    ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352

    It was caused by rhashtable access asoc->base.sk when sctp_assoc_migrate
    is changing its value. However, what rhashtable wants is netns from asoc
    base.sk, and for an asoc, its netns won't change once set. So we can
    simply fix it by caching netns since created.

    Fixes: d6c0256a60e6 ("sctp: add the rhashtable apis for sctp global transport hashtable")
    Reported-by: syzbot+e3b35fe7918ff0ee474e@syzkaller.appspotmail.com
    Signed-off-by: Xin Long
    Acked-by: Marcelo Ricardo Leitner
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Xin Long
     
  • [ Upstream commit b6631c6031c746ed004c4221ec0616d7a520f441 ]

    In the implementation of sctp_sf_do_5_2_4_dupcook() the allocated
    new_asoc is leaked if security_sctp_assoc_request() fails. Release it
    via sctp_association_free().

    Fixes: 2277c7cd75e3 ("sctp: Add LSM hooks")
    Signed-off-by: Navid Emamdoost
    Acked-by: Marcelo Ricardo Leitner
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Navid Emamdoost
     
  • [ Upstream commit 4e81c0b3fa93d07653e2415fa71656b080a112fd ]

    When user-space sets the OVS_UFID_F_OMIT_* flags, and the relevant
    flow has no UFID, we can exceed the computed size, as
    ovs_nla_put_identifier() will always dump an OVS_FLOW_ATTR_KEY
    attribute.
    Take the above in account when computing the flow command message
    size.

    Fixes: 74ed7ab9264c ("openvswitch: Add support for unique flow IDs.")
    Reported-by: Qi Jun Ding
    Signed-off-by: Paolo Abeni
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Paolo Abeni
     
  • [ Upstream commit 14e54ab9143fa60794d13ea0a66c792a2046a8f3 ]

    When a classful qdisc's child qdisc has set the flag
    TCQ_F_CPUSTATS (pfifo_fast for example), the child qdisc's
    cpu_bstats should be passed to gnet_stats_copy_basic(),
    but many classful qdisc didn't do that. As a result,
    `tc -s class show dev DEV` always return 0 for bytes and
    packets in this case.

    Pass the child qdisc's cpu_bstats to gnet_stats_copy_basic()
    to fix this issue.

    The qstats also has this problem, but it has been fixed
    in 5dd431b6b9 ("net: sched: introduce and use qstats read...")
    and bstats still remains buggy.

    Fixes: 22e0f8b9322c ("net: sched: make bstats per cpu and estimator RCU safe")
    Signed-off-by: Dust Li
    Signed-off-by: Tony Lu
    Acked-by: Cong Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Dust Li
     
  • [ Upstream commit 7eb9d7675c08937cd11d32b0b40442d4d731c5ee ]

    We need to calculate the skb size correctly otherwise we risk triggering
    skb_over_panic[1]. The issue is that data_len is added to the skb in a
    nl attribute, but we don't account for its header size (nlattr 4 bytes)
    and alignment. We account for it when calculating the total size in
    the > PSAMPLE_MAX_PACKET_SIZE comparison correctly, but not when
    allocating after that. The fix is simple - use nla_total_size() for
    data_len when allocating.

    To reproduce:
    $ tc qdisc add dev eth1 clsact
    $ tc filter add dev eth1 egress matchall action sample rate 1 group 1 trunc 129
    $ mausezahn eth1 -b bcast -a rand -c 1 -p 129
    < skb_over_panic BUG(), tail is 4 bytes past skb->end >

    [1] Trace:
    [ 50.459526][ T3480] skbuff: skb_over_panic: text:(____ptrval____) len:196 put:136 head:(____ptrval____) data:(____ptrval____) tail:0xc4 end:0xc0 dev:
    [ 50.474339][ T3480] ------------[ cut here ]------------
    [ 50.481132][ T3480] kernel BUG at net/core/skbuff.c:108!
    [ 50.486059][ T3480] invalid opcode: 0000 [#1] PREEMPT SMP
    [ 50.489463][ T3480] CPU: 3 PID: 3480 Comm: mausezahn Not tainted 5.4.0-rc7 #108
    [ 50.492844][ T3480] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-2.fc30 04/01/2014
    [ 50.496551][ T3480] RIP: 0010:skb_panic+0x79/0x7b
    [ 50.498261][ T3480] Code: bc 00 00 00 41 57 4c 89 e6 48 c7 c7 90 29 9a 83 4c 8b 8b c0 00 00 00 50 8b 83 b8 00 00 00 50 ff b3 c8 00 00 00 e8 ae ef c0 fe 0b e8 2f df c8 fe 48 8b 55 08 44 89 f6 4c 89 e7 48 c7 c1 a0 22
    [ 50.504111][ T3480] RSP: 0018:ffffc90000447a10 EFLAGS: 00010282
    [ 50.505835][ T3480] RAX: 0000000000000087 RBX: ffff888039317d00 RCX: 0000000000000000
    [ 50.507900][ T3480] RDX: 0000000000000000 RSI: ffffffff812716e1 RDI: 00000000ffffffff
    [ 50.509820][ T3480] RBP: ffffc90000447a60 R08: 0000000000000001 R09: 0000000000000000
    [ 50.511735][ T3480] R10: ffffffff81d4f940 R11: 0000000000000000 R12: ffffffff834a22b0
    [ 50.513494][ T3480] R13: ffffffff82c10433 R14: 0000000000000088 R15: ffffffff838a8084
    [ 50.515222][ T3480] FS: 00007f3536462700(0000) GS:ffff88803eac0000(0000) knlGS:0000000000000000
    [ 50.517135][ T3480] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [ 50.518583][ T3480] CR2: 0000000000442008 CR3: 000000003b222000 CR4: 00000000000006e0
    [ 50.520723][ T3480] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 50.522709][ T3480] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    [ 50.524450][ T3480] Call Trace:
    [ 50.525214][ T3480] skb_put.cold+0x1b/0x1b
    [ 50.526171][ T3480] psample_sample_packet+0x1d3/0x340
    [ 50.527307][ T3480] tcf_sample_act+0x178/0x250
    [ 50.528339][ T3480] tcf_action_exec+0xb1/0x190
    [ 50.529354][ T3480] mall_classify+0x67/0x90
    [ 50.530332][ T3480] tcf_classify+0x72/0x160
    [ 50.531286][ T3480] __dev_queue_xmit+0x3db/0xd50
    [ 50.532327][ T3480] dev_queue_xmit+0x18/0x20
    [ 50.533299][ T3480] packet_sendmsg+0xee7/0x2090
    [ 50.534331][ T3480] sock_sendmsg+0x54/0x70
    [ 50.535271][ T3480] __sys_sendto+0x148/0x1f0
    [ 50.536252][ T3480] ? tomoyo_file_ioctl+0x23/0x30
    [ 50.537334][ T3480] ? ksys_ioctl+0x5e/0xb0
    [ 50.540068][ T3480] __x64_sys_sendto+0x2a/0x30
    [ 50.542810][ T3480] do_syscall_64+0x73/0x1f0
    [ 50.545383][ T3480] entry_SYSCALL_64_after_hwframe+0x44/0xa9
    [ 50.548477][ T3480] RIP: 0033:0x7f35357d6fb3
    [ 50.551020][ T3480] Code: 48 8b 0d 18 90 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d f9 d3 20 00 00 75 13 49 89 ca b8 2c 00 00 00 0f 05 3d 01 f0 ff ff 73 34 c3 48 83 ec 08 e8 eb f6 ff ff 48 89 04 24
    [ 50.558547][ T3480] RSP: 002b:00007ffe0c7212c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
    [ 50.561870][ T3480] RAX: ffffffffffffffda RBX: 0000000001dac010 RCX: 00007f35357d6fb3
    [ 50.565142][ T3480] RDX: 0000000000000082 RSI: 0000000001dac2a2 RDI: 0000000000000003
    [ 50.568469][ T3480] RBP: 00007ffe0c7212f0 R08: 00007ffe0c7212d0 R09: 0000000000000014
    [ 50.571731][ T3480] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000082
    [ 50.574961][ T3480] R13: 0000000001dac2a2 R14: 0000000000000001 R15: 0000000000000003
    [ 50.578170][ T3480] Modules linked in: sch_ingress virtio_net
    [ 50.580976][ T3480] ---[ end trace 61a515626a595af6 ]---

    CC: Yotam Gigi
    CC: Jiri Pirko
    CC: Jamal Hadi Salim
    CC: Simon Horman
    CC: Roopa Prabhu
    Fixes: 6ae0a6286171 ("net: Introduce psample, a new genetlink channel for packet sampling")
    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Nikolay Aleksandrov
     
  • [ Upstream commit d69e07793f891524c6bbf1e75b9ae69db4450953 ]

    Only io_uring uses (and added) these, and we want to disallow the
    use of sendmsg/recvmsg for anything but regular data transfers.
    Use the newly added prep helper to split the msghdr copy out from
    the core function, to check for msg_control and msg_controllen
    settings. If either is set, we return -EINVAL.

    Acked-by: David S. Miller
    Signed-off-by: Jens Axboe
    Signed-off-by: Sasha Levin

    Jens Axboe
     
  • [ Upstream commit 4257c8ca13b084550574b8c9a667d9c90ff746eb ]

    This is in preparation for enabling the io_uring helpers for sendmsg
    and recvmsg to first copy the header for validation before continuing
    with the operation.

    There should be no functional changes in this patch.

    Acked-by: David S. Miller
    Signed-off-by: Jens Axboe
    Signed-off-by: Sasha Levin

    Jens Axboe
     

02 Dec, 2019

7 commits

  • * wifi/next: (51 commits)
    MLK-22949 brcmfmac: add chip id check for clm_blob firmware load
    MLK-22948 brcmfmac: avoid to send mailbox interrupt twice for core version 0xb
    MLK-22946 brcmfmac: freeing wiphy after brcmf attach failed
    dt-bindings: add new property to enable board_type
    brcmfmac: let board_type is optional
    ...

    Dong Aisheng
     
  • This patch provids netlink method to configure the TSN protocols hardwares.
    TSN guaranteed packet transport with bounded low latency, low packet delay
    variation, and low packet loss by hardware and software methods.

    The three basic components of TSN are:

    1. Time synchronization: This was implement by 8021AS which base on the
    IEEE1588 precision Time Protocol. This is configured by the other way
    in kernel.
    8021AS not included in this patch.

    2. Scheduling and traffic shaping and per-stream filter policing:
    This patch support Qbv/Qci/Qbu/8021CB/Qav etc.

    3. Selection of communication paths:
    This patch not support the pure software only TSN protocols(like Qcc)
    but hardware related configuration.

    TSN Protocols supports by this patch: Qbv/Qci/Qbu/Credit-base Shaper(Qav).
    This patch verified on NXP ls1028ardb board.

    Signed-off-by: Po Liu

    Po Liu
     
  • Support tsn capabilities in DSA felix switch driver. This felix tsn
    driver is using tsn configuration of ocelot, and registered on each
    switch port through DSA port setup.

    Signed-off-by: Xiaoliang Yang

    Xiaoliang Yang
     
  • This patch is to reuse ocelot functions as possible to enable PTP
    clock and to support hardware timestamping on Felix.
    On TX path, timestamping works on packet which requires timestamp.
    The injection header will be configured accordingly, and skb clone
    requires timestamp will be added into a list. The TX timestamp
    is final handled in threaded interrupt handler when PTP timestamp
    FIFO is ready.
    On RX path, timestamping is always working. The RX timestamp could
    be got from extraction header.

    Signed-off-by: Yangbo Lu
    Signed-off-by: David S. Miller

    Yangbo Lu
     
  • While it is entirely possible that this tagger format is in fact more
    generic than just these 2 switch families, I don't have that knowledge.
    The Seville switch in NXP T1040 has a similar frame format, but there
    are enough differences (e.g. DEST field starts at bit 57 instead of 56)
    that calling this file tag_vitesse.c is a bit of a stretch at the
    moment. The frame format has been listed in a comment so that people who
    add support for further Vitesse switches can rework this tagger while
    keeping compatibility with Felix.

    The "ocelot" name was chosen instead of "felix" because even the Ocelot
    switch can act as a DSA device when it is used in NPI mode, and the Felix
    tagger format is almost identical. Currently it is only used for the
    Felix switch embedded in the NXP LS1028A chip.

    The ABI for this tagger should be considered "not stable" at the moment.
    The DSA tag is always placed before the Ethernet header and therefore,
    we are using the long prefix for RX tags to avoid putting the DSA master
    port in promiscuous mode. Once there will be an API in DSA for drivers
    to request DSA masters to be in promiscuous mode unconditionally, we
    will switch to the "no prefix" extraction frame header, which will save
    16 padding bytes for each RX frame.

    Signed-off-by: Vladimir Oltean
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • ethernet controller driver call .of_get_mac_address() to get
    the mac address from devictree tree, if these properties are
    not present, then try to read from nvmem.

    For example, read MAC address from nvmem:
    of_get_mac_address()
    of_get_mac_addr_nvmem()
    nvmem_get_mac_address()

    i.MX6x/7D/8MQ/8MM platforms ethernet MAC address read from
    nvmem ocotp eFuses, but it requires to swap the six bytes
    order.

    The patch add optional property "nvmem_macaddr_swap" to swap
    macaddr bytes order.

    Signed-off-by: Fugang Duan

    Fugang Duan
     
  • Update txq0's trans_start in order to prevent the netdev watchdog from
    triggering too quickly. Since we set the LLTX flag, the stack won't update
    the jiffies for other tx queues. Prevent the watchdog from checking the
    other tx queues by adding the NETIF_HW_ACCEL_MQ flag.

    Signed-off-by: Camelia Groza

    Camelia Groza
     

25 Nov, 2019

2 commits

  • Adding back skb_recycle() as it's used by the DPAA Ethernet driver.
    This was removed from the upstream kernel because it was lacking users.

    Signed-off-by: Madalin Bucur

    Madalin Bucur
     
  • Pulling the following commits and some general changes from custom
    v3.10 kernel for supporting qcacld2.0 on kernel v4.9.11.
    1. cfg80211: Using new wiphy flag WIPHY_FLAG_DFS_OFFLOAD
    When flag WIPHY_FLAG_DFS_OFFLOAD is defined, the driver would handle
    all the DFS related operations. Therefore the kernel needs to ignore
    the DFS state that it uses to block the userspace calls to the driver
    through cfg80211 APIs. Also it should treat the userspace calls to
    start radar detection as a no-op.

    Please note that changes in util.c is not picked up explicitly.
    Kernel v4.9.11 uses wrapper cfg80211_get_chans_dfs_required which takes
    care of this change.

    Change-Id: I9dd2076945581ca67e54dfc96dd3dbc526c6f0a2
    IRs-Fixed: 202686

    2. New db.txt from git/sforshee/wireless-regdb.git
    CONFIG_CFG80211_INTERNAL_REGDB is enabled in build. This causes
    kernel warn messages as db.txt is empty. A new db.txt is added
    from:
    git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git

    IRs-Fixed: 202686

    3. Picked up the declaration and definition of the function
    cfg80211_is_gratuitous_arp_unsolicited_na

    Change-Id: I1e4083a2327c121073226aa6b75bb6b5b97cec00
    CRs-fixed: 1079453

    Signed-off-by: Nakul Kachhwaha
    Signed-off-by: Fugang Duan
    (Vipul: Fixed merge conflicts)
    (TODO: checkpatch warnings)
    Signed-off-by: Vipul Kumar

    Sherry Sun
     

23 Nov, 2019

2 commits

  • Once udp stack has set the UDP_SKB_IS_STATELESS flag, later skb free
    assumes all skb head state has been dropped already.

    This will leak the extension memory in case the skb has extensions other
    than the ipsec secpath, e.g. bridge nf data.

    To fix this, set the UDP_SKB_IS_STATELESS flag only if we don't have
    extensions or if the extension space can be free'd.

    Fixes: 895b5c9f206eb7d25dc1360a ("netfilter: drop bridge nf reset from nf_reset")
    Cc: Paolo Abeni
    Reported-by: Byron Stanoszek
    Signed-off-by: Florian Westphal
    Acked-by: Paolo Abeni
    Signed-off-by: David S. Miller

    Florian Westphal
     
  • The "ivm->vf" variable is a u32, but the problem is that a number of
    drivers cast it to an int and then forget to check for negatives. An
    example of this is in the cxgb4 driver.

    drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
    2890 static int cxgb4_mgmt_get_vf_config(struct net_device *dev,
    2891 int vf, struct ifla_vf_info *ivi)
    ^^^^^^
    2892 {
    2893 struct port_info *pi = netdev_priv(dev);
    2894 struct adapter *adap = pi->adapter;
    2895 struct vf_info *vfinfo;
    2896
    2897 if (vf >= adap->num_vfs)
    ^^^^^^^^^^^^^^^^^^^
    2898 return -EINVAL;
    2899 vfinfo = &adap->vfinfo[vf];
    ^^^^^^^^^^^^^^^^^^^^^^^^^^

    There are 48 functions affected.

    drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c:8435 hclge_set_vf_vlan_filter() warn: can 'vfid' underflow 's32min-2147483646'
    drivers/net/ethernet/freescale/enetc/enetc_pf.c:377 enetc_pf_set_vf_mac() warn: can 'vf' underflow 's32min-2147483646'
    drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:2899 cxgb4_mgmt_get_vf_config() warn: can 'vf' underflow 's32min-254'
    drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:2960 cxgb4_mgmt_set_vf_rate() warn: can 'vf' underflow 's32min-254'
    drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:3019 cxgb4_mgmt_set_vf_rate() warn: can 'vf' underflow 's32min-254'
    drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:3038 cxgb4_mgmt_set_vf_vlan() warn: can 'vf' underflow 's32min-254'
    drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:3086 cxgb4_mgmt_set_vf_link_state() warn: can 'vf' underflow 's32min-254'
    drivers/net/ethernet/chelsio/cxgb/cxgb2.c:791 get_eeprom() warn: can 'i' underflow 's32min-(-4),0,4-s32max'
    drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:82 bnxt_set_vf_spoofchk() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:164 bnxt_set_vf_trust() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:186 bnxt_get_vf_config() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:228 bnxt_set_vf_mac() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:264 bnxt_set_vf_vlan() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:293 bnxt_set_vf_bw() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c:333 bnxt_set_vf_link_state() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:2595 bnx2x_vf_op_prep() warn: can 'vfidx' underflow 's32min-63'
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:2595 bnx2x_vf_op_prep() warn: can 'vfidx' underflow 's32min-63'
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c:2281 bnx2x_post_vf_bulletin() warn: can 'vf' underflow 's32min-63'
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c:2285 bnx2x_post_vf_bulletin() warn: can 'vf' underflow 's32min-63'
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c:2286 bnx2x_post_vf_bulletin() warn: can 'vf' underflow 's32min-63'
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c:2292 bnx2x_post_vf_bulletin() warn: can 'vf' underflow 's32min-63'
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c:2297 bnx2x_post_vf_bulletin() warn: can 'vf' underflow 's32min-63'
    drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:1832 qlcnic_sriov_set_vf_mac() warn: can 'vf' underflow 's32min-254'
    drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:1864 qlcnic_sriov_set_vf_tx_rate() warn: can 'vf' underflow 's32min-254'
    drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:1937 qlcnic_sriov_set_vf_vlan() warn: can 'vf' underflow 's32min-254'
    drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:2005 qlcnic_sriov_get_vf_config() warn: can 'vf' underflow 's32min-254'
    drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:2036 qlcnic_sriov_set_vf_spoofchk() warn: can 'vf' underflow 's32min-254'
    drivers/net/ethernet/emulex/benet/be_main.c:1914 be_get_vf_config() warn: can 'vf' underflow 's32min-65534'
    drivers/net/ethernet/emulex/benet/be_main.c:1915 be_get_vf_config() warn: can 'vf' underflow 's32min-65534'
    drivers/net/ethernet/emulex/benet/be_main.c:1922 be_set_vf_tvt() warn: can 'vf' underflow 's32min-65534'
    drivers/net/ethernet/emulex/benet/be_main.c:1951 be_clear_vf_tvt() warn: can 'vf' underflow 's32min-65534'
    drivers/net/ethernet/emulex/benet/be_main.c:2063 be_set_vf_tx_rate() warn: can 'vf' underflow 's32min-65534'
    drivers/net/ethernet/emulex/benet/be_main.c:2091 be_set_vf_link_state() warn: can 'vf' underflow 's32min-65534'
    drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:2609 ice_set_vf_port_vlan() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:3050 ice_get_vf_cfg() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:3103 ice_set_vf_spoofchk() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:3181 ice_set_vf_mac() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:3237 ice_set_vf_trust() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:3286 ice_set_vf_link_state() warn: can 'vf_id' underflow 's32min-65534'
    drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:3919 i40e_validate_vf() warn: can 'vf_id' underflow 's32min-2147483646'
    drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:3957 i40e_ndo_set_vf_mac() warn: can 'vf_id' underflow 's32min-2147483646'
    drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4104 i40e_ndo_set_vf_port_vlan() warn: can 'vf_id' underflow 's32min-2147483646'
    drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4263 i40e_ndo_set_vf_bw() warn: can 'vf_id' underflow 's32min-2147483646'
    drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4309 i40e_ndo_get_vf_config() warn: can 'vf_id' underflow 's32min-2147483646'
    drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4371 i40e_ndo_set_vf_link_state() warn: can 'vf_id' underflow 's32min-2147483646'
    drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4441 i40e_ndo_set_vf_spoofchk() warn: can 'vf_id' underflow 's32min-2147483646'
    drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4441 i40e_ndo_set_vf_spoofchk() warn: can 'vf_id' underflow 's32min-2147483646'
    drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:4504 i40e_ndo_set_vf_trust() warn: can 'vf_id' underflow 's32min-2147483646'

    Signed-off-by: Dan Carpenter
    Signed-off-by: David S. Miller

    Dan Carpenter
     

22 Nov, 2019

1 commit


21 Nov, 2019

3 commits

  • kobject_put() should only be called in error path.

    Fixes: b8eb718348b8 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject")
    Signed-off-by: Eric Dumazet
    Cc: Jouni Hogander
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Previously we will return directly if (!rt || !rt->fib6_nh.fib_nh_gw_family)
    in function rt6_probe(), but after commit cc3a86c802f0
    ("ipv6: Change rt6_probe to take a fib6_nh"), the logic changed to
    return if there is fib_nh_gw_family.

    Fixes: cc3a86c802f0 ("ipv6: Change rt6_probe to take a fib6_nh")
    Signed-off-by: Hangbin Liu
    Reviewed-by: David Ahern
    Signed-off-by: David S. Miller

    Hangbin Liu
     
  • kobject_init_and_add takes reference even when it fails. This has
    to be given up by the caller in error handling. Otherwise memory
    allocated by kobject_init_and_add is never freed. Originally found
    by Syzkaller:

    BUG: memory leak
    unreferenced object 0xffff8880679f8b08 (size 8):
    comm "netdev_register", pid 269, jiffies 4294693094 (age 12.132s)
    hex dump (first 8 bytes):
    72 78 2d 30 00 36 20 d4 rx-0.6 .
    backtrace:
    [] __kmalloc_track_caller+0x16e/0x290
    [] kvasprintf+0xb1/0x140
    [] kvasprintf_const+0x56/0x160
    [] kobject_set_name_vargs+0x5b/0x140
    [] kobject_init_and_add+0xd8/0x170
    [] net_rx_queue_update_kobjects+0x152/0x560
    [] netdev_register_kobject+0x210/0x380
    [] register_netdevice+0xa1b/0xf00
    [] __tun_chr_ioctl+0x20d5/0x3dd0
    [] tun_chr_ioctl+0x2f/0x40
    [] do_vfs_ioctl+0x1c7/0x1510
    [] ksys_ioctl+0x99/0xb0
    [] __x64_sys_ioctl+0x78/0xb0
    [] do_syscall_64+0x16f/0x580
    [] entry_SYSCALL_64_after_hwframe+0x44/0xa9
    [] 0xffffffffffffffff

    Cc: David Miller
    Cc: Lukas Bulwahn
    Signed-off-by: Jouni Hogander
    Signed-off-by: David S. Miller

    Jouni Hogander
     

20 Nov, 2019

3 commits

  • when configuring act_pedit rules, the number of keys is validated only on
    addition of a new entry. This is not sufficient to avoid hitting a WARN()
    in the traffic path: for example, it is possible to replace a valid entry
    with a new one having 0 extended keys, thus causing splats in dmesg like:

    pedit BUG: index 42
    WARNING: CPU: 2 PID: 4054 at net/sched/act_pedit.c:410 tcf_pedit_act+0xc84/0x1200 [act_pedit]
    [...]
    RIP: 0010:tcf_pedit_act+0xc84/0x1200 [act_pedit]
    Code: 89 fa 48 c1 ea 03 0f b6 04 02 84 c0 74 08 3c 03 0f 8e ac 00 00 00 48 8b 44 24 10 48 c7 c7 a0 c4 e4 c0 8b 70 18 e8 1c 30 95 ea 0b e9 a0 fa ff ff e8 00 03 f5 ea e9 14 f4 ff ff 48 89 58 40 e9
    RSP: 0018:ffff888077c9f320 EFLAGS: 00010286
    RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffffac2983a2
    RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff888053927bec
    RBP: dffffc0000000000 R08: ffffed100a726209 R09: ffffed100a726209
    R10: 0000000000000001 R11: ffffed100a726208 R12: ffff88804beea780
    R13: ffff888079a77400 R14: ffff88804beea780 R15: ffff888027ab2000
    FS: 00007fdeec9bd740(0000) GS:ffff888053900000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007ffdb3dfd000 CR3: 000000004adb4006 CR4: 00000000001606e0
    Call Trace:
    tcf_action_exec+0x105/0x3f0
    tcf_classify+0xf2/0x410
    __dev_queue_xmit+0xcbf/0x2ae0
    ip_finish_output2+0x711/0x1fb0
    ip_output+0x1bf/0x4b0
    ip_send_skb+0x37/0xa0
    raw_sendmsg+0x180c/0x2430
    sock_sendmsg+0xdb/0x110
    __sys_sendto+0x257/0x2b0
    __x64_sys_sendto+0xdd/0x1b0
    do_syscall_64+0xa5/0x4e0
    entry_SYSCALL_64_after_hwframe+0x49/0xbe
    RIP: 0033:0x7fdeeb72e993
    Code: 48 8b 0d e0 74 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 0d d6 2c 00 00 75 13 49 89 ca b8 2c 00 00 00 0f 05 3d 01 f0 ff ff 73 34 c3 48 83 ec 08 e8 4b cc 00 00 48 89 04 24
    RSP: 002b:00007ffdb3de8a18 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
    RAX: ffffffffffffffda RBX: 000055c81972b700 RCX: 00007fdeeb72e993
    RDX: 0000000000000040 RSI: 000055c81972b700 RDI: 0000000000000003
    RBP: 00007ffdb3dea130 R08: 000055c819728510 R09: 0000000000000010
    R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000040
    R13: 000055c81972b6c0 R14: 000055c81972969c R15: 0000000000000080

    Fix this moving the check on 'nkeys' earlier in tcf_pedit_init(), so that
    attempts to install rules having 0 keys are always rejected with -EINVAL.

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Davide Caratti
    Signed-off-by: David S. Miller

    Davide Caratti
     
  • The taprio qdisc allows to set mqprio setting but only once. In case
    if mqprio settings are provided next time the error is returned as
    it's not allowed to change traffic class mapping in-flignt and that
    is normal. But if configuration is absolutely the same - no need to
    return error. It allows to provide same command couple times,
    changing only base time for instance, or changing only scheds maps,
    but leaving mqprio setting w/o modification. It more corresponds the
    message: "Changing the traffic mapping of a running schedule is not
    supported", so reject mqprio if it's really changed.

    Also corrected TC_BITMASK + 1 for consistency, as proposed.

    Fixes: a3d43c0d56f1 ("taprio: Add support adding an admin schedule")
    Reviewed-by: Vladimir Oltean
    Tested-by: Vladimir Oltean
    Acked-by: Vinicius Costa Gomes
    Signed-off-by: Ivan Khoronzhuk
    Signed-off-by: David S. Miller

    Ivan Khoronzhuk
     
  • Bring back tls_sw_sendpage_locked. sk_msg redirection into a socket
    with TLS_TX takes the following path:

    tcp_bpf_sendmsg_redir
    tcp_bpf_push_locked
    tcp_bpf_push
    kernel_sendpage_locked
    sock->ops->sendpage_locked

    Also update the flags test in tls_sw_sendpage_locked to allow flag
    MSG_NO_SHARED_FRAGS. bpf_tcp_sendmsg sets this.

    Link: https://lore.kernel.org/netdev/CA+FuTSdaAawmZ2N8nfDDKu3XLpXBbMtcCT0q4FntDD2gn8ASUw@mail.gmail.com/T/#t
    Link: https://github.com/wdebruij/kerneltools/commits/icept.2
    Fixes: 0608c69c9a80 ("bpf: sk_msg, sock{map|hash} redirect through ULP")
    Fixes: f3de19af0f5b ("Revert \"net/tls: remove unused function tls_sw_sendpage_locked\"")
    Signed-off-by: Willem de Bruijn
    Acked-by: John Fastabend
    Signed-off-by: David S. Miller

    Willem de Bruijn
     

19 Nov, 2019

3 commits

  • Commit eec4844fae7c ("proc/sysctl: add shared variables for range
    check") did:
    - .extra2 = &two,
    + .extra2 = SYSCTL_ONE,
    here, which doesn't seem to be intentional, given the changelog.
    This patch restores it to the previous, as the value of 2 still makes
    sense (used in fib_multipath_hash()).

    Fixes: eec4844fae7c ("proc/sysctl: add shared variables for range check")
    Cc: Matteo Croce
    Signed-off-by: Marcelo Ricardo Leitner
    Acked-by: Matteo Croce
    Signed-off-by: David S. Miller

    Marcelo Ricardo Leitner
     
  • info->options_len is 'u8' type, and when opts_len with a value >
    IP_TUNNEL_OPTS_MAX, 'info->options_len = opts_len' will cast int
    to u8 and set a wrong value to info->options_len.

    Kernel crashed in my test when doing:

    # opts="0102:80:00800022"
    # for i in {1..99}; do opts="$opts,0102:80:00800022"; done
    # ip link add name geneve0 type geneve dstport 0 external
    # tc qdisc add dev eth0 ingress
    # tc filter add dev eth0 protocol ip parent ffff: \
    flower indev eth0 ip_proto udp action tunnel_key \
    set src_ip 10.0.99.192 dst_ip 10.0.99.193 \
    dst_port 6081 id 11 geneve_opts $opts \
    action mirred egress redirect dev geneve0

    So we should do the similar check as cls_flower does, return error
    when opts_len > IP_TUNNEL_OPTS_MAX in tunnel_key_copy_opts().

    Fixes: 0ed5269f9e41 ("net/sched: add tunnel option support to act_tunnel_key")
    Signed-off-by: Xin Long
    Reviewed-by: Simon Horman
    Signed-off-by: David S. Miller

    Xin Long
     
  • In case of errors in unlink_clip_vcc, the logging level is set to
    pr_crit but failures in clip_setentry are handled by pr_err().
    The patch changes the severity consistent across invocations.

    Signed-off-by: Aditya Pakki
    Signed-off-by: David S. Miller

    Aditya Pakki