1. 12 Oct, 2023 9 commits
  2. 11 Oct, 2023 9 commits
  3. 10 Oct, 2023 11 commits
  4. 09 Oct, 2023 5 commits
  5. 08 Oct, 2023 3 commits
  6. 07 Oct, 2023 3 commits
    • Dinghao Liu's avatar
      ieee802154: ca8210: Fix a potential UAF in ca8210_probe · f990874b
      Dinghao Liu authored
      If of_clk_add_provider() fails in ca8210_register_ext_clock(),
      it calls clk_unregister() to release priv->clk and returns an
      error. However, the caller ca8210_probe() then calls ca8210_remove(),
      where priv->clk is freed again in ca8210_unregister_ext_clock(). In
      this case, a use-after-free may happen in the second time we call
      clk_unregister().
      
      Fix this by removing the first clk_unregister(). Also, priv->clk could
      be an error code on failure of clk_register_fixed_rate(). Use
      IS_ERR_OR_NULL to catch this case in ca8210_unregister_ext_clock().
      
      Fixes: ded845a7 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
      Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
      Message-ID: <20231007033049.22353-1-dinghao.liu@zju.edu.cn>
      Signed-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
      f990874b
    • Daniel Borkmann's avatar
      selftests/bpf: Make seen_tc* variable tests more robust · 37345b85
      Daniel Borkmann authored
      Martin reported that on his local dev machine the test_tc_chain_mixed() fails as
      "test_tc_chain_mixed:FAIL:seen_tc5 unexpected seen_tc5: actual 1 != expected 0"
      and others occasionally, too.
      
      However, when running in a more isolated setup (qemu in particular), it works fine
      for him. The reason is that there is a small race-window where seen_tc* could turn
      into true for various test cases when there is background traffic, e.g. after the
      asserts they often get reset. In such case when subsequent detach takes place,
      unrelated background traffic could have already flipped the bool to true beforehand.
      
      Add a small helper tc_skel_reset_all_seen() to reset all bools before we do the ping
      test. At this point, everything is set up as expected and therefore no race can occur.
      All tc_{opts,links} tests continue to pass after this change.
      Reported-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/r/20231006220655.1653-7-daniel@iogearbox.netSigned-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
      37345b85
    • Daniel Borkmann's avatar
      selftests/bpf: Test query on empty mprog and pass revision into attach · 685446b0
      Daniel Borkmann authored
      Add a new test case to query on an empty bpf_mprog and pass the revision
      directly into expected_revision for attachment to assert that this does
      succeed.
      
        ./test_progs -t tc_opts
        [    1.406778] tsc: Refined TSC clocksource calibration: 3407.990 MHz
        [    1.408863] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fcaf6eb0, max_idle_ns: 440795321766 ns
        [    1.412419] clocksource: Switched to clocksource tsc
        [    1.428671] bpf_testmod: loading out-of-tree module taints kernel.
        [    1.430260] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
        #252     tc_opts_after:OK
        #253     tc_opts_append:OK
        #254     tc_opts_basic:OK
        #255     tc_opts_before:OK
        #256     tc_opts_chain_classic:OK
        #257     tc_opts_chain_mixed:OK
        #258     tc_opts_delete_empty:OK
        #259     tc_opts_demixed:OK
        #260     tc_opts_detach:OK
        #261     tc_opts_detach_after:OK
        #262     tc_opts_detach_before:OK
        #263     tc_opts_dev_cleanup:OK
        #264     tc_opts_invalid:OK
        #265     tc_opts_max:OK
        #266     tc_opts_mixed:OK
        #267     tc_opts_prepend:OK
        #268     tc_opts_query:OK
        #269     tc_opts_query_attach:OK     <--- (new test)
        #270     tc_opts_replace:OK
        #271     tc_opts_revision:OK
        Summary: 20/0 PASSED, 0 SKIPPED, 0 FAILED
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/r/20231006220655.1653-6-daniel@iogearbox.netSigned-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
      685446b0