aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-11-02liquidio: remove redundant setting of inst_processed to zeroColin Ian King1-2/+0
The zero value assigned to inst_processed at the end of each iteration of the do-while loop is overwritten on the next iteration and hence it is a redundant assignment and can be removed. Cleans up clang warning: drivers/net/ethernet/cavium/liquidio/request_manager.c:480:3: warning: Value stored to 'inst_processed' is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02net: dl2k: remove redundant re-assignment to npColin Ian King1-1/+1
The pointer np is initialized and then re-assigned the same value a few lines later. Remove the redundant duplicated assignment. Cleans up clang warning: drivers/net/ethernet/dlink/dl2k.c:314:25: warning: Value stored to 'np' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02wan: wanxl: remove redundant assignment to statColin Ian King1-1/+0
stat set to zero and the value is never read, instead stat is set again in the do-loop. Hence the setting to zero is redundant and can be removed. Cleans up clang warning: drivers/net/wan/wanxl.c:737:2: warning: Value stored to 'stat' is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller47-169/+284
Smooth Cong Wang's bug fix into 'net-next'. Basically put the bulk of the tcf_block_put() logic from 'net' into tcf_block_put_ext(), but after the offload unbind. Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02Merge branch 'samples-pktgen-updates'David S. Miller6-193/+141
Jesper Dangaard Brouer says: ==================== Updates for samples/pktgen This patchset updates samples/pktgen and synchronize with changes maintained in https://github.com/netoptimizer/network-testing/ Features wise Robert Hoo <robert.hu@intel.com> added support for detecting and determining dev NUMA node IRQs, and added a new script named pktgen_sample06_numa_awared_queue_irq_affinity.sh that use these features. Cleanup remove last of the old sample files, as IPv6 is covered by existing sample code. ==================== Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02samples/pktgen: remove remaining old pktgen sample scriptsJesper Dangaard Brouer3-192/+0
Since commit 0f06a6787e05 ("samples: Add an IPv6 '-6' option to the pktgen scripts") the newer pktgen_sampleXX script does show howto use IPv6 with pktgen. Thus, there is no longer a reason to keep the older sample scripts around. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02samples/pktgen: update sample03, no need for clones when burstingJesper Dangaard Brouer1-1/+1
Like sample05, don't use pktgen clone_skb feature when using 'burst' feature, it is not really needed. This brings the burst users in sync. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02samples/pktgen: add script pktgen_sample06_numa_awared_queue_irq_affinity.shRobert Hoo1-0/+97
This script simply does: * Detect $DEV's NUMA node belonging. * Bind each thread (processor of NUMA locality) with each $DEV queue's irq affinity, 1:1 mapping. * How many '-t' threads input determines how many queues will be utilized. If '-f' designates first cpu id, then offset in the NUMA node's cpu list. (Changes by Jesper: allow changing count from cmdline via '-n') Signed-off-by: Robert Hoo <robert.hu@intel.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02samples/pktgen: Add some helper functionsRobert Hoo1-0/+43
1. given a device, get its NUMA belongings 2. given a device, get its queues' irq numbers. 3. given a NUMA node, get its cpu id list. Signed-off-by: Robert Hoo <robert.hu@intel.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02Merge branch 'enic-Additional-ethtool-support'David S. Miller4-16/+81
Parvi Kaustubhi says: ==================== enic: Additional ethtool support This patch set allows the user to show or modify rx/tx ring sizes using ethtool. v2: - remove unused variable to fix build warning. - update list of maintainers for cisco vic ethernet nic driver. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02MAINTAINERS: update MAINTAINERS for cisco vicParvi Kaustubhi1-1/+1
Add myself to list of maintainers for cisco vic ethernet nic driver. Remove Neel as he left. Signed-off-by: Parvi Kaustubhi <pkaustub@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02enic: Add support for 'ethtool -g/-G'Parvi Kaustubhi2-1/+78
Add support for displaying and modifying rx and tx ring sizes using ethtool. Also, increasing version to 2.3.0.45 Signed-off-by: Parvi Kaustubhi <pkaustub@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-02enic: reset fetch indexParvi Kaustubhi1-14/+2
Since we are allowing rx ring size modification, reset fetch index everytime. Otherwise it could have a stale value that can lead to a null pointer dereference. Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com> Signed-off-by: Parvi Kaustubhi <pkaustub@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespaceLinus Torvalds1-1/+1
Pull signal bugfix from Eric Biederman: "When making the generic support for SIGEMT conditional on the presence of SIGEMT I made a typo that causes it to fail to activate. It was noticed comparatively quickly but the bug report just made it to me today" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: signal: Fix name of SIGEMT in #if defined() check
2017-11-01signal: Fix name of SIGEMT in #if defined() checkAndrew Clayton1-1/+1
Commit cc731525f26a ("signal: Remove kernel interal si_code magic") added a check for SIGMET and NSIGEMT being defined. That SIGMET should in fact be SIGEMT, with SIGEMT being defined in arch/{alpha,mips,sparc}/include/uapi/asm/signal.h This was actually pointed out by BenHutchings in a lwn.net comment here https://lwn.net/Comments/734608/ Fixes: cc731525f26a ("signal: Remove kernel interal si_code magic") Signed-off-by: Andrew Clayton <andrew@digital-domain.net> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2017-11-01Merge branch 'for-linus' of git://git.kernel.dk/linux-blockLinus Torvalds4-4/+21
Pull block fixes from Jens Axboe: "A few fixes that should go into this series: - Regression fix for ide-cd, ensuring that a request is fully initialized. From Hongxu. - Ditto fix for virtio_blk, from Bart. - NVMe fix from Keith, ensuring that we set the right block size on revalidation. If the block size changed, we'd be in trouble without it. - NVMe rdma fix from Sagi, fixing a potential hang while the controller is being removed" * 'for-linus' of git://git.kernel.dk/linux-block: ide:ide-cd: fix kernel panic resulting from missing scsi_req_init nvme: Fix setting logical block format when revalidating virtio_blk: Fix an SG_IO regression nvme-rdma: fix possible hang when issuing commands during ctrl removal
2017-11-01Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netLinus Torvalds26-86/+182
Pull networking fixes from David Miller: 1) Fix refcounting in xfrm_bundle_lookup() when using a dummy bundle, from Steffen Klassert. 2) Fix crypto header handling in rx data frames in ath10k driver, from Vasanthakumar Thiagarajan. 3) Fix use after free of qdisc when we defer tcp_chain_flush() to a workqueue. From Cong Wang. 4) Fix double free in lapbether driver, from Pan Bian. 5) Sanitize TUNSETSNDBUF values, from Craig Gallek. 6) Fix refcounting when addrconf_permanent_addr() calls ipv6_del_addr(). From Eric Dumazet. 7) Fix MTU probing bug in TCP that goes back to 2007, from Eric Dumazet. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: tcp: fix tcp_mtu_probe() vs highest_sack ipv6: addrconf: increment ifp refcount before ipv6_del_addr() tun/tap: sanitize TUNSETSNDBUF input mlxsw: i2c: Fix buffer increment counter for write transaction mlxsw: reg: Add high and low temperature thresholds MAINTAINERS: Remove Yotam from mlxfw MAINTAINERS: Update Yotam's E-mail net: hns: set correct return value net: lapbether: fix double free bpf: remove SK_REDIRECT from UAPI net: phy: marvell: Only configure RGMII delays when using RGMII xfrm: Fix GSO for IPsec with GRE tunnel. tc-testing: fix arg to ip command: -s -> -n net_sched: remove tcf_block_put_deferred() l2tp: hold tunnel in pppol2tp_connect() Revert "ath10k: fix napi_poll budget overflow" ath10k: rebuild crypto header in rx data frames wcn36xx: Remove unnecessary rcu_read_unlock in wcn36xx_bss_info_changed xfrm: Clear sk_dst_cache when applying per-socket policy. xfrm: Fix xfrm_dst_cache memleak
2017-11-01x86/mm: fix use-after-free of vma during userfaultfd faultVlastimil Babka1-1/+10
Syzkaller with KASAN has reported a use-after-free of vma->vm_flags in __do_page_fault() with the following reproducer: mmap(&(0x7f0000000000/0xfff000)=nil, 0xfff000, 0x3, 0x32, 0xffffffffffffffff, 0x0) mmap(&(0x7f0000011000/0x3000)=nil, 0x3000, 0x1, 0x32, 0xffffffffffffffff, 0x0) r0 = userfaultfd(0x0) ioctl$UFFDIO_API(r0, 0xc018aa3f, &(0x7f0000002000-0x18)={0xaa, 0x0, 0x0}) ioctl$UFFDIO_REGISTER(r0, 0xc020aa00, &(0x7f0000019000)={{&(0x7f0000012000/0x2000)=nil, 0x2000}, 0x1, 0x0}) r1 = gettid() syz_open_dev$evdev(&(0x7f0000013000-0x12)="2f6465762f696e7075742f6576656e742300", 0x0, 0x0) tkill(r1, 0x7) The vma should be pinned by mmap_sem, but handle_userfault() might (in a return to userspace scenario) release it and then acquire again, so when we return to __do_page_fault() (with other result than VM_FAULT_RETRY), the vma might be gone. Specifically, per Andrea the scenario is "A return to userland to repeat the page fault later with a VM_FAULT_NOPAGE retval (potentially after handling any pending signal during the return to userland). The return to userland is identified whenever FAULT_FLAG_USER|FAULT_FLAG_KILLABLE are both set in vmf->flags" However, since commit a3c4fb7c9c2e ("x86/mm: Fix fault error path using unsafe vma pointer") there is a vma_pkey() read of vma->vm_flags after that point, which can thus become use-after-free. Fix this by moving the read before calling handle_mm_fault(). Reported-by: syzbot <bot+6a5269ce759a7bb12754ed9622076dc93f65a1f6@syzkaller.appspotmail.com> Reported-by: Dmitry Vyukov <dvyukov@google.com> Suggested-by: Kirill A. Shutemov <kirill@shutemov.name> Fixes: 3c4fb7c9c2e ("x86/mm: Fix fault error path using unsafe vma pointer") Reviewed-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-11-01Merge tag 'smb3-file-name-too-long-fix' of git://git.samba.org/sfrench/cifs-2.6Linus Torvalds1-2/+3
Pull cifs fix from Steve French: "smb3 file name too long fix" * tag 'smb3-file-name-too-long-fix' of git://git.samba.org/sfrench/cifs-2.6: cifs: check MaxPathNameComponentLength != 0 before using it
2017-11-01ide:ide-cd: fix kernel panic resulting from missing scsi_req_initHongxu Jia1-0/+1
Since we split the scsi_request out of struct request, while the standard prep_rq_fn builds 10 byte cmds, it missed to invoke scsi_req_init() to initialize certain fields of a scsi_request structure (.__cmd[], .cmd, .cmd_len and .sense_len but no other members of struct scsi_request). An example panic on virtual machines (qemu/virtualbox) to boot from IDE cdrom: ... [ 8.754381] Call Trace: [ 8.755419] blk_peek_request+0x182/0x2e0 [ 8.755863] blk_fetch_request+0x1c/0x40 [ 8.756148] ? ktime_get+0x40/0xa0 [ 8.756385] do_ide_request+0x37d/0x660 [ 8.756704] ? cfq_group_service_tree_add+0x98/0xc0 [ 8.757011] ? cfq_service_tree_add+0x1e5/0x2c0 [ 8.757313] ? ktime_get+0x40/0xa0 [ 8.757544] __blk_run_queue+0x3d/0x60 [ 8.757837] queue_unplugged+0x2f/0xc0 [ 8.758088] blk_flush_plug_list+0x1f4/0x240 [ 8.758362] blk_finish_plug+0x2c/0x40 ... [ 8.770906] RIP: ide_cdrom_prep_fn+0x63/0x180 RSP: ffff92aec018bae8 [ 8.772329] ---[ end trace 6408481e551a85c9 ]--- ... Fixes: 82ed4db499b8 ("block: split scsi_request out of struct request") Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-11-01Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-nextDavid S. Miller26-332/+407
Johan Hedberg says: ==================== pull request: bluetooth-next 2017-11-01 Here's one more bluetooth-next pull request for the 4.15 kernel. - New NFA344A device entry for btusb drvier - Fix race conditions in hci_ldisc - Fix for isochronous interface assignments in btusb driver - A few other smaller fixes & improvements Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01bpf: fix verifier memory leaksAlexei Starovoitov1-9/+18
fix verifier memory leaks Fixes: 638f5b90d460 ("bpf: reduce verifier memory consumption") Signed-off-by: Alexei Starovoitov <ast@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01Merge branch 'cxgb4-add-hash-filter-support-to-tc-flower-offload'David S. Miller13-115/+1082
Rahul Lakkireddy says: ==================== cxgb4: add hash-filter support to tc-flower offload This series of patches add support to create hash-filters; a.k.a exact-match filters, to tc-flower offload. T6 supports creating ~500K hash-filters in hw and can theoretically be expanded up to ~1 million. Patch 1 fetches and saves the configured hw filter tuple field shifts and filter mask. Patch 2 initializes the driver to use hash-filter configuration. Patch 3 adds support to create hash filters in hw. Patch 4 adds support to delete hash filters in hw. Patch 5 adds support to retrieve filter stats for hash filters. Patch 6 converts the flower table to use rhashtable instead of static hlist. Patch 7 finally adds support to create hash filters via tc-flower offload. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01cxgb4: add support to create hash-filters via tc-flower offloadKumar Sanghvi3-5/+161
Determine whether the flow classifies as exact-match with respect to 4-tuple and configured tuple mask in hw. If successfully classified as exact-match, offload the flow as hash-filter in hw. Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01cxgb4: convert flower table to use rhashtableKumar Sanghvi4-36/+82
T6 supports ~500K hash filters and can theoretically climb up to ~1 million hash filters. Preallocated hash table is not efficient in terms of memory usage. So, use rhashtable instead which gives the flexibility to grow based on usage. Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01cxgb4: add support to retrieve stats for hash filtersKumar Sanghvi3-13/+25
Add support to retrieve packet-count and byte-count for hash-filters by retrieving filter-entry appropriately based on whether the request is for hash-filter or not. Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01cxgb4: add support to delete hash filterKumar Sanghvi7-7/+173
Use a combined ulptx work-request to send hash filter deletion request to hw. Hash filter deletion reply is processed on getting cpl_abort_rpl_rss. Release any L2T/SMT/CLIP entries on filter deletion. Also, free up the corresponding filter entry. Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01cxgb4: add support to create hash filtersKumar Sanghvi6-50/+562
Add support to create hash (exact-match) filters based on the value of 'hash' field in ch_filter_specification. Allocate SMT/L2T entries if DMAC-rewrite/SMAC-rewrite is requested. Allocate CLIP entry in case of IPv6 filter. Use cpl_act_open_req[6] to send hash filter create request to hw. Also, the filter tuple is calculated as part of sending this request. Hash-filter reply is processed on getting cpl_act_open_rpl. In case of success, various bits/fields in filter-tcb are set per filter requirement, such as enabling filter hitcnts, and/or various header rewrite operations, such as VLAN-rewrite, NAT or (L3/L4)-rewrite, and SMAC/DMAC-rewrite. In case of failure, clear the filter entry and release any hw resources occupied by it. The patch also moves the functions set_tcb_field, set_tcb_tflag and configure_filter_smac towards beginning of file. Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01cxgb4: initialize hash-filter configurationKumar Sanghvi6-4/+54
Add support for hash-filter configuration on T6. Also, do basic checks for the related initialization. Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01cxgb4: save additional filter tuple field shifts in tp_paramsKumar Sanghvi3-4/+29
Save additional filter tuple field shifts in tp_params based on configured filter tuple fields. Also, save the combined filter tuple mask based on configured filter tuple fields. Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01Merge branch 'lan9303-Fix-STP-and-flooding-issues'David S. Miller3-3/+8
Egil Hjelmeland says: ==================== net: dsa: lan9303: Fix STP and flooding issues This patch set finishes the STP support, and fixes flooding issues. Patch 1 fixes a flooding issue in the previous patch set. Patch 2 finishes STP support by adding a ALR entry. Patch 3 prevent duplicate flooding in HW and SW bridge. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01net: dsa: lan9303: lan9303_rcv set skb->offload_fwd_markEgil Hjelmeland1-0/+2
The chip flood broadcast and unknown multicast frames. On receive set skb->offload_fwd_mark to prevent the SW from flooding to the same ports. One exception: Because the ALR is set up to forward STP BPDUs only to CPU, the SW bridge should flood STP BPDUs if local STP is not enabled. This is archived by not setting skb->offload_fwd_mark on STP BPDUs. Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01net: dsa: lan9303: Add STP ALR entry on port 0Egil Hjelmeland3-1/+4
STP BPDUs arriving on user ports must sent to CPU port only, for processing by the SW bridge. Add an ALR entry with STP state override to fix that. Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01net: dsa: lan9303: Transmit using ALR when unicastEgil Hjelmeland1-2/+2
lan9303_xmit_use_arl() introduced in previous patch set is wrong. The chip flood broadcast and unknown multicast frames. The effect is that broadcasts and multicasts are duplicated on egress. It is not possible to configure the chip to direct unknown multicasts to CPU port only. This means that only unicast frames can be transmitted using ALR lookup. Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01net: thunderx: remove a couple of redundant assignmentsColin Ian King1-4/+0
The assignment to pointer msg is redundant as it is never read, so remove msg. Also remove the first assignment to qset as this is not read before the next re-assignment of a new value to qset in the for-loop. Cleans up two clang warnings: drivers/net/ethernet/cavium/thunder/nic_main.c:589:2: warning: Value stored to 'msg' is never read drivers/net/ethernet/cavium/thunder/nic_main.c:611:2: warning: Value stored to 'qset' is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01MAINTAINERS: Add lib/net_utils.c to NETWORKING (general)Andy Shevchenko1-0/+1
It looks like the best place in MAINTAINERS data base to cover this orphaned module. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01sfc: support rx-fcs and rx-allEdward Cree4-8/+30
Ethernet FCS inclusion (rx-fcs) is supported on EF10 NICs, conditional on a firmware capability bit (MC_CMD_GET_CAPABILITIES_OUT_RX_INCLUDE_FCS). To receive frames with bad FCS (rx-all) we just don't return the discard flag EFX_RX_PKT_DISCARD from efx_ef10_handle_rx_event_errors() or efx_farch_handle_rx_not_ok(). Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01net: macb: remove redundant assignment to variable work_doneColin Ian King1-2/+0
Variable work_done is set to zero and this value is never read, instead it is set to another value a few statements later. Remove the redundant assignment. Cleans up clang warning: drivers/net/ethernet/cadence/macb_main.c:1221:2: warning: Value stored to 'work_done' is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Tested-by: Alexander Dahl <ada@thorsis.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01ipv4: fix validate_source for VRF setupPaolo Abeni1-3/+15
David reported breakages of VRF scenarios due to the commit 6e617de84e87 ("net: avoid a full fib lookup when rp_filter is disabled."): the local addresses based test is too strict when VRFs are in place. With this change we fall-back to a full lookup when custom fib rules are in place; so that we address the VRF use case and possibly other similar issues in non trivial setups. v1 -> v2: - fix build breakage when CONFIG_IP_MULTIPLE_TABLES is not defined, reported by the kbuild test robot Reported-by: David Ahern <dsahern@gmail.com> Fixes: 6e617de84e87 ("net: avoid a full fib lookup when rp_filter is disabled.") Signed-off-by: Paolo Abeni <pabeni@redhat.com> Acked-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01sctp: fix error return code in sctp_send_add_streams()Wei Yongjun1-2/+4
Fix to returnerror code -ENOMEM from the sctp_make_strreset_addstrm() error handling case instead of 0. 'retval' can be overwritten to 0 after call sctp_stream_alloc_out(). Fixes: e090abd0d81c ("sctp: factor out stream->out allocation") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01net: hso: remove redundant unused variable devColin Ian King1-2/+0
The pointer dev is being assigned but is never used, hence it is redundant and can be removed. Cleans up clang warning: drivers/net/usb/hso.c:2280:2: warning: Value stored to 'dev' is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01ppp: Destroy the mutex when cleanupGao Feng1-0/+1
The mutex_destroy only makes sense when enable DEBUG_MUTEX. For the good readbility, it's better to invoke it in exit func when the init func invokes mutex_init. Signed-off-by: Gao Feng <gfree.wind@vip.163.com> Acked-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01net: ethernet: slicoss: remove redundant initialization of idxColin Ian King1-1/+1
Variable idx is being initialized and later on over-written by a new value in a do-loop without the initial value ever being read. Hence the initializion is redundant and can be removed. Cleans up clang warning: drivers/net/ethernet/alacritech/slicoss.c:358:15: warning: Value stored to 'idx' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01tcp: fix tcp_mtu_probe() vs highest_sackEric Dumazet2-4/+5
Based on SNMP values provided by Roman, Yuchung made the observation that some crashes in tcp_sacktag_walk() might be caused by MTU probing. Looking at tcp_mtu_probe(), I found that when a new skb was placed in front of the write queue, we were not updating tcp highest sack. If one skb is freed because all its content was copied to the new skb (for MTU probing), then tp->highest_sack could point to a now freed skb. Bad things would then happen, including infinite loops. This patch renames tcp_highest_sack_combine() and uses it from tcp_mtu_probe() to fix the bug. Note that I also removed one test against tp->sacked_out, since we want to replace tp->highest_sack regardless of whatever condition, since keeping a stale pointer to freed skb is a recipe for disaster. Fixes: a47e5a988a57 ("[TCP]: Convert highest_sack to sk_buff to allow direct access") Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com> Reported-by: Roman Gushchin <guro@fb.com> Reported-by: Oleksandr Natalenko <oleksandr@natalenko.name> Acked-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Neal Cardwell <ncardwell@google.com> Acked-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01ipv6: addrconf: increment ifp refcount before ipv6_del_addr()Eric Dumazet1-0/+1
In the (unlikely) event fixup_permanent_addr() returns a failure, addrconf_permanent_addr() calls ipv6_del_addr() without the mandatory call to in6_ifa_hold(), leading to a refcount error, spotted by syzkaller : WARNING: CPU: 1 PID: 3142 at lib/refcount.c:227 refcount_dec+0x4c/0x50 lib/refcount.c:227 Kernel panic - not syncing: panic_on_warn set ... CPU: 1 PID: 3142 Comm: ip Not tainted 4.14.0-rc4-next-20171009+ #33 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:52 panic+0x1e4/0x41c kernel/panic.c:181 __warn+0x1c4/0x1e0 kernel/panic.c:544 report_bug+0x211/0x2d0 lib/bug.c:183 fixup_bug+0x40/0x90 arch/x86/kernel/traps.c:178 do_trap_no_signal arch/x86/kernel/traps.c:212 [inline] do_trap+0x260/0x390 arch/x86/kernel/traps.c:261 do_error_trap+0x120/0x390 arch/x86/kernel/traps.c:298 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:311 invalid_op+0x18/0x20 arch/x86/entry/entry_64.S:905 RIP: 0010:refcount_dec+0x4c/0x50 lib/refcount.c:227 RSP: 0018:ffff8801ca49e680 EFLAGS: 00010286 RAX: 000000000000002c RBX: ffff8801d07cfcdc RCX: 0000000000000000 RDX: 000000000000002c RSI: 1ffff10039493c90 RDI: ffffed0039493cc4 RBP: ffff8801ca49e688 R08: ffff8801ca49dd70 R09: 0000000000000000 R10: ffff8801ca49df58 R11: 0000000000000000 R12: 1ffff10039493cd9 R13: ffff8801ca49e6e8 R14: ffff8801ca49e7e8 R15: ffff8801d07cfcdc __in6_ifa_put include/net/addrconf.h:369 [inline] ipv6_del_addr+0x42b/0xb60 net/ipv6/addrconf.c:1208 addrconf_permanent_addr net/ipv6/addrconf.c:3327 [inline] addrconf_notify+0x1c66/0x2190 net/ipv6/addrconf.c:3393 notifier_call_chain+0x136/0x2c0 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x2d/0x40 kernel/notifier.c:401 call_netdevice_notifiers_info+0x32/0x60 net/core/dev.c:1697 call_netdevice_notifiers net/core/dev.c:1715 [inline] __dev_notify_flags+0x15d/0x430 net/core/dev.c:6843 dev_change_flags+0xf5/0x140 net/core/dev.c:6879 do_setlink+0xa1b/0x38e0 net/core/rtnetlink.c:2113 rtnl_newlink+0xf0d/0x1a40 net/core/rtnetlink.c:2661 rtnetlink_rcv_msg+0x733/0x1090 net/core/rtnetlink.c:4301 netlink_rcv_skb+0x216/0x440 net/netlink/af_netlink.c:2408 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4313 netlink_unicast_kernel net/netlink/af_netlink.c:1273 [inline] netlink_unicast+0x4e8/0x6f0 net/netlink/af_netlink.c:1299 netlink_sendmsg+0xa4a/0xe70 net/netlink/af_netlink.c:1862 sock_sendmsg_nosec net/socket.c:633 [inline] sock_sendmsg+0xca/0x110 net/socket.c:643 ___sys_sendmsg+0x75b/0x8a0 net/socket.c:2049 __sys_sendmsg+0xe5/0x210 net/socket.c:2083 SYSC_sendmsg net/socket.c:2094 [inline] SyS_sendmsg+0x2d/0x50 net/socket.c:2090 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x7fa9174d3320 RSP: 002b:00007ffe302ae9e8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007ffe302b2ae0 RCX: 00007fa9174d3320 RDX: 0000000000000000 RSI: 00007ffe302aea20 RDI: 0000000000000016 RBP: 0000000000000082 R08: 0000000000000000 R09: 000000000000000f R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe302b32a0 R13: 0000000000000000 R14: 00007ffe302b2ab8 R15: 00007ffe302b32b8 Fixes: f1705ec197e7 ("net: ipv6: Make address flushing on ifdown optional") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: David Ahern <dsahern@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01Merge branch 'PHYLINK-cosmetic-and-build-fixes'David S. Miller3-30/+23
Florian Fainelli says: ==================== PHYLINK cosmetic and build fixes Please find two small "fixes" one that corrects some stylistic changes and another one that fixes an actual build failure in sfp.c. Since PHYLINK is not directly visible to user, and there are no in-tree users yet (coming) this is not targeted at "net" but "net-next" instead. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01net: phy: Fix sfp.c build against GPIO definitionsFlorian Fainelli1-1/+1
include/gpio.h does not contain the references we want, we should be including linux/gpio/consumer.h instead. Fixes: 73970055450e ("sfp: add SFP module support") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01net: phy: Cosmetic fixes to phylink/sfp/sfp-bus.cFlorian Fainelli3-29/+22
Perform a number of stylistic changes to phylink.c, sfp.c and sfp-bus.c: - align with netdev-style comments - align function arguments to the opening parenthesis - remove blank lines - fixup a few lines over 80 columns Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01bpf: document answers to common questions about BPFAlexei Starovoitov2-0/+157
to address common misconceptions about what BPF is and what it's not add short BPF Q&A that clarifies core BPF design principles and answers some common questions. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-01net: display hw address of source machine during ipv6 DAD failureVishwanath Pai3-8/+9
This patch updates the error messages displayed in kernel log to include hwaddress of the source machine that caused ipv6 duplicate address detection failures. Examples: a) When we receive a NA packet from another machine advertising our address: ICMPv6: NA: 34:ab:cd:56:11:e8 advertised our address 2001:db8:: on eth0! b) When we detect DAD failure during address assignment to an interface: IPv6: eth0: IPv6 duplicate address 2001:db8:: used by 34:ab:cd:56:11:e8 detected! v2: Changed %pI6 to %pI6c in ndisc_recv_na() Chaged the v6 address in the commit message to 2001:db8:: Suggested-by: Igor Lubashev <ilubashe@akamai.com> Signed-off-by: Vishwanath Pai <vpai@akamai.com> Acked-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>