1. 15 2月, 2017 7 次提交
    • M
      ath10k: silence firmware file probing warnings · 9f5bcfe9
      Michal Kazior 提交于
      Firmware files are versioned to prevent older
      driver instances to load unsupported firmware
      blobs. This is reflected with a fallback logic
      which attempts to load several firmware files.
      
      This however produced a lot of unnecessary
      warnings sometimes confusing users and leading
      them to rename firmware files making things even
      more confusing.
      
      Hence use request_firmware_direct() which does not
      produce extra warnings. This shouldn't really
      break anything because most modern systems don't
      rely on udev/hotplug helpers to load firmware
      files anymore. For example it was confirmed that
      LEDE does not user helper.
      
      This also fixes a 60 second delay per _each_
      unexistent firmware/calibration file with distros
      which have CONFIG_FW_LOADER_USER_HELPER_FALLBACK
      enabled, RHEL being a notable example. Using
      ath10k with firmware-2.bin this might end up
      into a five minute delay in boot.
      Signed-off-by: NMichal Kazior <michal.kazior@tieto.com>
      [kvalo@qca.qualcomm.com: add more info to the commit log]
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      9f5bcfe9
    • K
      ath10k: add directory to board data error message · 310c01af
      Kalle Valo 提交于
      This way user has a better idea what file exactly is missing.
      This is needed when we switch to using request_firmware_direct() which doesn't
      print any errors anymore.
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      310c01af
    • E
      ath10k: fetch firmware images in a loop · 1c61bedc
      Erik Stromdahl 提交于
      To make it easier to handle minimum and maximum firmware API numbers convert
      the firmware fetch functionality to a loop. If no firmware image is found print
      an error with minimum and maximum API numbers and the name of firmware
      directory. This is needed when we switch to using request_firmware_direct()
      which doesn't print any errors anymore.
      
      Also add a new function for creating the fw file name dynamically which makes it
      easier to add new bus support, for example SDIO and USB, later.
      Signed-off-by: NErik Stromdahl <erik.stromdahl@gmail.com>
      [kvalo@qca.qualcomm.com: remove sdio/usb part, new error message, clarify commit log]
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      1c61bedc
    • K
      ath10k: fix napi crash during rmmod when probe firmware fails · 1427228d
      Kalle Valo 提交于
      This fixes the below crash when ath10k probe firmware fails, NAPI polling tries
      to access a rx ring resource which was never allocated. An easy way to
      reproduce this is easy to remove all the firmware files, load ath10k modules
      and ath10k will crash when calling 'rmmod ath10k_pci'. The fix is to call
      napi_enable() from ath10k_pci_hif_start() so that it matches with
      napi_disable() being called from ath10k_pci_hif_stop().
      
      Big thanks to Mohammed Shafi Shajakhan who debugged this and provided first
      version of the fix. In this patch I just fix the actual problem in pci.c
      instead of having a workaround in core.c.
      
      BUG: unable to handle kernel NULL pointer dereference at (null)
      IP:  __ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core]
      __ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core]
      
      Call Trace:
      
      [<ffffffffa113ec62>] ath10k_htt_rx_msdu_buff_replenish+0x42/0x90
      [ath10k_core]
      [<ffffffffa113f393>] ath10k_htt_txrx_compl_task+0x433/0x17d0
      [ath10k_core]
      [<ffffffff8114406d>] ? __wake_up_common+0x4d/0x80
      [<ffffffff811349ec>] ? cpu_load_update+0xdc/0x150
      [<ffffffffa119301d>] ? ath10k_pci_read32+0xd/0x10 [ath10k_pci]
      [<ffffffffa1195b17>] ath10k_pci_napi_poll+0x47/0x110 [ath10k_pci]
      [<ffffffff817863af>] net_rx_action+0x20f/0x370
      Reported-by: NBen Greear <greearb@candelatech.com>
      Fixes: 3c97f5de ("ath10k: implement NAPI support")
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      1427228d
    • A
      ath10k: fix comment · 6d219113
      Amadeusz Sławiński 提交于
      I wanted to take a look and it's apparently in other header
      Signed-off-by: NAmadeusz Sławiński <amadeusz.slawinski@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      6d219113
    • A
      ath10k: use size_t for len variables · 182f1e5a
      Amadeusz Sławiński 提交于
      cleanup to consolidate type used for len variables
      Signed-off-by: NAmadeusz Sławiński <amadeusz.slawinski@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      182f1e5a
    • A
      ath10k: remove ath10k_vif_to_arvif() · 56ac13bf
      Amadeusz Sławiński 提交于
      it adds unnecessary level of indirection, while we just access structure
      field
      Signed-off-by: NAmadeusz Sławiński <amadeusz.slawinski@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      56ac13bf
  2. 13 2月, 2017 23 次提交
  3. 12 2月, 2017 10 次提交
    • P
      netfilter: nf_tables: honor NFT_SET_OBJECT in set backend selection · 7286ff7f
      Pablo Neira Ayuso 提交于
      Check for NFT_SET_OBJECT feature flag, otherwise we may end up selecting
      the wrong set backend.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      7286ff7f
    • P
      netfilter: update MAINTAINERS · fc52497e
      Pablo Neira Ayuso 提交于
      It's been a while since Patrick has been suspended as coreteam member [1].
      Update this file to remove him.
      
      While at this, remove references to all foo-tables variants, given the
      project hosts more than just that, eg. ipset, conntrack, ...
      
      [1] https://marc.info/?l=netfilter-devel&m=146887464512702Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      fc52497e
    • P
      netfilter: nf_tables: add NFTA_RULE_ID attribute · 1a94e38d
      Pablo Neira Ayuso 提交于
      This new attribute allows us to uniquely identify a rule in transaction.
      Robots may trigger an insertion followed by deletion in a batch, in that
      scenario we still don't have a public rule handle that we can use to
      delete the rule. This is similar to the NFTA_SET_ID attribute that
      allows us to refer to an anonymous set from a batch.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      1a94e38d
    • P
      netfilter: nf_tables: add check_genid to the nfnetlink subsystem · 74e8bcd2
      Pablo Neira Ayuso 提交于
      This patch implements the check generation id as provided by nfnetlink.
      This allows us to reject ruleset updates against stale baseline, so
      userspace can retry update with a fresh ruleset cache.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      74e8bcd2
    • P
      netfilter: nfnetlink: allow to check for generation ID · 8c4d4e8b
      Pablo Neira Ayuso 提交于
      This patch allows userspace to specify the generation ID that has been
      used to build an incremental batch update.
      
      If userspace specifies the generation ID in the batch message as
      attribute, then nfnetlink compares it to the current generation ID so
      you make sure that you work against the right baseline. Otherwise, bail
      out with ERESTART so userspace knows that its changeset is stale and
      needs to respin. Userspace can do this transparently at the cost of
      taking slightly more time to refresh caches and rework the changeset.
      
      This check is optional, if there is no NFNL_BATCH_GENID attribute in the
      batch begin message, then no check is performed.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      8c4d4e8b
    • P
      netfilter: nfnetlink: add nfnetlink_rcv_skb_batch() · 48656835
      Pablo Neira Ayuso 提交于
      Add new nfnetlink_rcv_skb_batch() to wrap initial nfnetlink batch
      handling.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      48656835
    • P
      netfilter: nfnetlink: get rid of u_intX_t types · b745d035
      Pablo Neira Ayuso 提交于
      Use uX types instead.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      b745d035
    • G
      netfilter: nf_ct_expect: nf_ct_expect_insert() returns void · 4dee62b1
      Gao Feng 提交于
      Because nf_ct_expect_insert() always succeeds now, its return value can
      be just void instead of int. And remove code that checks for its return
      value.
      Signed-off-by: NGao Feng <fgao@ikuai8.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      4dee62b1
    • G
      netfilter: nf_ct_sip: Use mod_timer_pending() · a96e66e7
      Gao Feng 提交于
      timer_del() followed by timer_add() can be replaced by
      mod_timer_pending().
      Signed-off-by: NGao Feng <fgao@ikuai8.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      a96e66e7
    • E
      net_sched: fix error recovery at qdisc creation · 87b60cfa
      Eric Dumazet 提交于
      Dmitry reported uses after free in qdisc code [1]
      
      The problem here is that ops->init() can return an error.
      
      qdisc_create_dflt() then call ops->destroy(),
      while qdisc_create() does _not_ call it.
      
      Four qdisc chose to call their own ops->destroy(), assuming their caller
      would not.
      
      This patch makes sure qdisc_create() calls ops->destroy()
      and fixes the four qdisc to avoid double free.
      
      [1]
      BUG: KASAN: use-after-free in mq_destroy+0x242/0x290 net/sched/sch_mq.c:33 at addr ffff8801d415d440
      Read of size 8 by task syz-executor2/5030
      CPU: 0 PID: 5030 Comm: syz-executor2 Not tainted 4.3.5-smp-DEV #119
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
       0000000000000046 ffff8801b435b870 ffffffff81bbbed4 ffff8801db000400
       ffff8801d415d440 ffff8801d415dc40 ffff8801c4988510 ffff8801b435b898
       ffffffff816682b1 ffff8801b435b928 ffff8801d415d440 ffff8801c49880c0
      Call Trace:
       [<ffffffff81bbbed4>] __dump_stack lib/dump_stack.c:15 [inline]
       [<ffffffff81bbbed4>] dump_stack+0x6c/0x98 lib/dump_stack.c:51
       [<ffffffff816682b1>] kasan_object_err+0x21/0x70 mm/kasan/report.c:158
       [<ffffffff81668524>] print_address_description mm/kasan/report.c:196 [inline]
       [<ffffffff81668524>] kasan_report_error+0x1b4/0x4b0 mm/kasan/report.c:285
       [<ffffffff81668953>] kasan_report mm/kasan/report.c:305 [inline]
       [<ffffffff81668953>] __asan_report_load8_noabort+0x43/0x50 mm/kasan/report.c:326
       [<ffffffff82527b02>] mq_destroy+0x242/0x290 net/sched/sch_mq.c:33
       [<ffffffff82524bdd>] qdisc_destroy+0x12d/0x290 net/sched/sch_generic.c:953
       [<ffffffff82524e30>] qdisc_create_dflt+0xf0/0x120 net/sched/sch_generic.c:848
       [<ffffffff8252550d>] attach_default_qdiscs net/sched/sch_generic.c:1029 [inline]
       [<ffffffff8252550d>] dev_activate+0x6ad/0x880 net/sched/sch_generic.c:1064
       [<ffffffff824b1db1>] __dev_open+0x221/0x320 net/core/dev.c:1403
       [<ffffffff824b24ce>] __dev_change_flags+0x15e/0x3e0 net/core/dev.c:6858
       [<ffffffff824b27de>] dev_change_flags+0x8e/0x140 net/core/dev.c:6926
       [<ffffffff824f5bf6>] dev_ifsioc+0x446/0x890 net/core/dev_ioctl.c:260
       [<ffffffff824f61fa>] dev_ioctl+0x1ba/0xb80 net/core/dev_ioctl.c:546
       [<ffffffff82430509>] sock_do_ioctl+0x99/0xb0 net/socket.c:879
       [<ffffffff82430d30>] sock_ioctl+0x2a0/0x390 net/socket.c:958
       [<ffffffff816f3b68>] vfs_ioctl fs/ioctl.c:44 [inline]
       [<ffffffff816f3b68>] do_vfs_ioctl+0x8a8/0xe50 fs/ioctl.c:611
       [<ffffffff816f41a4>] SYSC_ioctl fs/ioctl.c:626 [inline]
       [<ffffffff816f41a4>] SyS_ioctl+0x94/0xc0 fs/ioctl.c:617
       [<ffffffff8123e357>] entry_SYSCALL_64_fastpath+0x12/0x17
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: NDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87b60cfa