1. 30 12月, 2021 1 次提交
  2. 23 12月, 2021 1 次提交
  3. 19 10月, 2021 1 次提交
    • K
      xfrm: Use memset_after() to clear padding · caf283d0
      Kees Cook 提交于
      In preparation for FORTIFY_SOURCE performing compile-time and run-time
      field bounds checking for memset(), avoid intentionally writing across
      neighboring fields.
      
      Clear trailing padding bytes using the new helper so that memset()
      doesn't get confused about writing "past the end" of the last struct
      member. There is no change to the resulting machine code.
      
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NKees Cook <keescook@chromium.org>
      caf283d0
  4. 23 9月, 2021 1 次提交
  5. 15 9月, 2021 2 次提交
  6. 09 9月, 2021 1 次提交
  7. 29 7月, 2021 1 次提交
  8. 21 7月, 2021 1 次提交
  9. 29 6月, 2021 1 次提交
  10. 14 6月, 2021 1 次提交
  11. 19 4月, 2021 1 次提交
  12. 29 3月, 2021 1 次提交
  13. 04 2月, 2021 1 次提交
  14. 27 11月, 2020 1 次提交
    • A
      xfrm: redact SA secret with lockdown confidentiality · c7a5899e
      Antony Antony 提交于
      redact XFRM SA secret in the netlink response to xfrm_get_sa()
      or dumpall sa.
      Enable lockdown, confidentiality mode, at boot or at run time.
      
      e.g. when enabled:
      cat /sys/kernel/security/lockdown
      none integrity [confidentiality]
      
      ip xfrm state
      src 172.16.1.200 dst 172.16.1.100
      	proto esp spi 0x00000002 reqid 2 mode tunnel
      	replay-window 0
      	aead rfc4106(gcm(aes)) 0x0000000000000000000000000000000000000000 96
      
      note: the aead secret is redacted.
      Redacting secret is also a FIPS 140-2 requirement.
      
      v1->v2
       - add size checks before memset calls
      v2->v3
       - replace spaces with tabs for consistency
      v3->v4
       - use kernel lockdown instead of a /proc setting
      v4->v5
       - remove kconfig option
      Reviewed-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NAntony Antony <antony.antony@secunet.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      c7a5899e
  15. 24 9月, 2020 3 次提交
    • D
      xfrm/compat: Add 32=>64-bit messages translator · 5106f4a8
      Dmitry Safonov 提交于
      Provide the user-to-kernel translator under XFRM_USER_COMPAT, that
      creates for 32-bit xfrm-user message a 64-bit translation.
      The translation is afterwards reused by xfrm_user code just as if
      userspace had sent 64-bit message.
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      5106f4a8
    • D
      xfrm/compat: Attach xfrm dumps to 64=>32 bit translator · 5f3eea6b
      Dmitry Safonov 提交于
      Currently nlmsg_unicast() is used by functions that dump structures that
      can be different in size for compat tasks, see dump_one_state() and
      dump_one_policy().
      
      The following nlmsg_unicast() users exist today in xfrm:
      
               Function                          |    Message can be different
                                                 |       in size on compat
      -------------------------------------------|------------------------------
          xfrm_get_spdinfo()                     |               N
          xfrm_get_sadinfo()                     |               N
          xfrm_get_sa()                          |               Y
          xfrm_alloc_userspi()                   |               Y
          xfrm_get_policy()                      |               Y
          xfrm_get_ae()                          |               N
      
      Besides, dump_one_state() and dump_one_policy() can be used by filtered
      netlink dump for XFRM_MSG_GETSA, XFRM_MSG_GETPOLICY.
      
      Just as for xfrm multicast, allocate frag_list for compat skb journey
      down to recvmsg() which will give user the desired skb according to
      syscall bitness.
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      5f3eea6b
    • D
      xfrm/compat: Add 64=>32-bit messages translator · 5461fc0c
      Dmitry Safonov 提交于
      Provide the kernel-to-user translator under XFRM_USER_COMPAT, that
      creates for 64-bit xfrm-user message a 32-bit translation and puts it
      in skb's frag_list. net/compat.c layer provides MSG_CMSG_COMPAT to
      decide if the message should be taken from skb or frag_list.
      (used by wext-core which has also an ABI difference)
      
      Kernel sends 64-bit xfrm messages to the userspace for:
      - multicast (monitor events)
      - netlink dumps
      
      Wire up the translator to xfrm_nlmsg_multicast().
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      5461fc0c
  16. 24 6月, 2020 1 次提交
    • X
      xfrm: policy: match with both mark and mask on user interfaces · 4f47e8ab
      Xin Long 提交于
      In commit ed17b8d3 ("xfrm: fix a warning in xfrm_policy_insert_list"),
      it would take 'priority' to make a policy unique, and allow duplicated
      policies with different 'priority' to be added, which is not expected
      by userland, as Tobias reported in strongswan.
      
      To fix this duplicated policies issue, and also fix the issue in
      commit ed17b8d3 ("xfrm: fix a warning in xfrm_policy_insert_list"),
      when doing add/del/get/update on user interfaces, this patch is to change
      to look up a policy with both mark and mask by doing:
      
        mark.v == pol->mark.v && mark.m == pol->mark.m
      
      and leave the check:
      
        (mark & pol->mark.m) == pol->mark.v
      
      for tx/rx path only.
      
      As the userland expects an exact mark and mask match to manage policies.
      
      v1->v2:
        - make xfrm_policy_mark_match inline and fix the changelog as
          Tobias suggested.
      
      Fixes: 295fae56 ("xfrm: Allow user space manipulation of SPD mark")
      Fixes: ed17b8d3 ("xfrm: fix a warning in xfrm_policy_insert_list")
      Reported-by: NTobias Brunner <tobias@strongswan.org>
      Tested-by: NTobias Brunner <tobias@strongswan.org>
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      4f47e8ab
  17. 12 2月, 2020 2 次提交
    • X
      xfrm: add the missing verify_sec_ctx_len check in xfrm_add_acquire · a1a7e3a3
      Xin Long 提交于
      Without doing verify_sec_ctx_len() check in xfrm_add_acquire(), it may be
      out-of-bounds to access uctx->ctx_str with uctx->ctx_len, as noticed by
      syz:
      
        BUG: KASAN: slab-out-of-bounds in selinux_xfrm_alloc_user+0x237/0x430
        Read of size 768 at addr ffff8880123be9b4 by task syz-executor.1/11650
      
        Call Trace:
         dump_stack+0xe8/0x16e
         print_address_description.cold.3+0x9/0x23b
         kasan_report.cold.4+0x64/0x95
         memcpy+0x1f/0x50
         selinux_xfrm_alloc_user+0x237/0x430
         security_xfrm_policy_alloc+0x5c/0xb0
         xfrm_policy_construct+0x2b1/0x650
         xfrm_add_acquire+0x21d/0xa10
         xfrm_user_rcv_msg+0x431/0x6f0
         netlink_rcv_skb+0x15a/0x410
         xfrm_netlink_rcv+0x6d/0x90
         netlink_unicast+0x50e/0x6a0
         netlink_sendmsg+0x8ae/0xd40
         sock_sendmsg+0x133/0x170
         ___sys_sendmsg+0x834/0x9a0
         __sys_sendmsg+0x100/0x1e0
         do_syscall_64+0xe5/0x660
         entry_SYSCALL_64_after_hwframe+0x6a/0xdf
      
      So fix it by adding the missing verify_sec_ctx_len check there.
      
      Fixes: 980ebd25 ("[IPSEC]: Sync series - acquire insert")
      Reported-by: NHangbin Liu <liuhangbin@gmail.com>
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      a1a7e3a3
    • X
      xfrm: fix uctx len check in verify_sec_ctx_len · 171d449a
      Xin Long 提交于
      It's not sufficient to do 'uctx->len != (sizeof(struct xfrm_user_sec_ctx) +
      uctx->ctx_len)' check only, as uctx->len may be greater than nla_len(rt),
      in which case it will cause slab-out-of-bounds when accessing uctx->ctx_str
      later.
      
      This patch is to fix it by return -EINVAL when uctx->len > nla_len(rt).
      
      Fixes: df71837d ("[LSM-IPSec]: Security association restriction.")
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      171d449a
  18. 17 6月, 2019 1 次提交
  19. 28 5月, 2019 1 次提交
  20. 21 5月, 2019 1 次提交
  21. 28 4月, 2019 1 次提交
    • J
      netlink: make validation more configurable for future strictness · 8cb08174
      Johannes Berg 提交于
      We currently have two levels of strict validation:
      
       1) liberal (default)
           - undefined (type >= max) & NLA_UNSPEC attributes accepted
           - attribute length >= expected accepted
           - garbage at end of message accepted
       2) strict (opt-in)
           - NLA_UNSPEC attributes accepted
           - attribute length >= expected accepted
      
      Split out parsing strictness into four different options:
       * TRAILING     - check that there's no trailing data after parsing
                        attributes (in message or nested)
       * MAXTYPE      - reject attrs > max known type
       * UNSPEC       - reject attributes with NLA_UNSPEC policy entries
       * STRICT_ATTRS - strictly validate attribute size
      
      The default for future things should be *everything*.
      The current *_strict() is a combination of TRAILING and MAXTYPE,
      and is renamed to _deprecated_strict().
      The current regular parsing has none of this, and is renamed to
      *_parse_deprecated().
      
      Additionally it allows us to selectively set one of the new flags
      even on old policies. Notably, the UNSPEC flag could be useful in
      this case, since it can be arranged (by filling in the policy) to
      not be an incompatible userspace ABI change, but would then going
      forward prevent forgetting attribute entries. Similar can apply
      to the POLICY flag.
      
      We end up with the following renames:
       * nla_parse           -> nla_parse_deprecated
       * nla_parse_strict    -> nla_parse_deprecated_strict
       * nlmsg_parse         -> nlmsg_parse_deprecated
       * nlmsg_parse_strict  -> nlmsg_parse_deprecated_strict
       * nla_parse_nested    -> nla_parse_nested_deprecated
       * nla_validate_nested -> nla_validate_nested_deprecated
      
      Using spatch, of course:
          @@
          expression TB, MAX, HEAD, LEN, POL, EXT;
          @@
          -nla_parse(TB, MAX, HEAD, LEN, POL, EXT)
          +nla_parse_deprecated(TB, MAX, HEAD, LEN, POL, EXT)
      
          @@
          expression NLH, HDRLEN, TB, MAX, POL, EXT;
          @@
          -nlmsg_parse(NLH, HDRLEN, TB, MAX, POL, EXT)
          +nlmsg_parse_deprecated(NLH, HDRLEN, TB, MAX, POL, EXT)
      
          @@
          expression NLH, HDRLEN, TB, MAX, POL, EXT;
          @@
          -nlmsg_parse_strict(NLH, HDRLEN, TB, MAX, POL, EXT)
          +nlmsg_parse_deprecated_strict(NLH, HDRLEN, TB, MAX, POL, EXT)
      
          @@
          expression TB, MAX, NLA, POL, EXT;
          @@
          -nla_parse_nested(TB, MAX, NLA, POL, EXT)
          +nla_parse_nested_deprecated(TB, MAX, NLA, POL, EXT)
      
          @@
          expression START, MAX, POL, EXT;
          @@
          -nla_validate_nested(START, MAX, POL, EXT)
          +nla_validate_nested_deprecated(START, MAX, POL, EXT)
      
          @@
          expression NLH, HDRLEN, MAX, POL, EXT;
          @@
          -nlmsg_validate(NLH, HDRLEN, MAX, POL, EXT)
          +nlmsg_validate_deprecated(NLH, HDRLEN, MAX, POL, EXT)
      
      For this patch, don't actually add the strict, non-renamed versions
      yet so that it breaks compile if I get it wrong.
      
      Also, while at it, make nla_validate and nla_parse go down to a
      common __nla_validate_parse() function to avoid code duplication.
      
      Ultimately, this allows us to have very strict validation for every
      new caller of nla_parse()/nlmsg_parse() etc as re-introduced in the
      next patch, while existing things will continue to work as is.
      
      In effect then, this adds fully strict validation for any new command.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8cb08174
  22. 26 3月, 2019 1 次提交
    • C
      xfrm: clean up xfrm protocol checks · dbb2483b
      Cong Wang 提交于
      In commit 6a53b759 ("xfrm: check id proto in validate_tmpl()")
      I introduced a check for xfrm protocol, but according to Herbert
      IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so
      it should be removed from validate_tmpl().
      
      And, IPSEC_PROTO_ANY is expected to only match 3 IPSec-specific
      protocols, this is why xfrm_state_flush() could still miss
      IPPROTO_ROUTING, which leads that those entries are left in
      net->xfrm.state_all before exit net. Fix this by replacing
      IPSEC_PROTO_ANY with zero.
      
      This patch also extracts the check from validate_tmpl() to
      xfrm_id_proto_valid() and uses it in parse_ipsecrequest().
      With this, no other protocols should be added into xfrm.
      
      Fixes: 6a53b759 ("xfrm: check id proto in validate_tmpl()")
      Reported-by: syzbot+0bf0519d6e0de15914fe@syzkaller.appspotmail.com
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      dbb2483b
  23. 21 3月, 2019 1 次提交
  24. 08 3月, 2019 1 次提交
  25. 01 3月, 2019 1 次提交
    • Y
      xfrm: policy: Fix out-of-bound array accesses in __xfrm_policy_unlink · b805d78d
      YueHaibing 提交于
      UBSAN report this:
      
      UBSAN: Undefined behaviour in net/xfrm/xfrm_policy.c:1289:24
      index 6 is out of range for type 'unsigned int [6]'
      CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.162-514.55.6.9.x86_64+ #13
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
       0000000000000000 1466cf39b41b23c9 ffff8801f6b07a58 ffffffff81cb35f4
       0000000041b58ab3 ffffffff83230f9c ffffffff81cb34e0 ffff8801f6b07a80
       ffff8801f6b07a20 1466cf39b41b23c9 ffffffff851706e0 ffff8801f6b07ae8
      Call Trace:
       <IRQ>  [<ffffffff81cb35f4>] __dump_stack lib/dump_stack.c:15 [inline]
       <IRQ>  [<ffffffff81cb35f4>] dump_stack+0x114/0x1a0 lib/dump_stack.c:51
       [<ffffffff81d94225>] ubsan_epilogue+0x12/0x8f lib/ubsan.c:164
       [<ffffffff81d954db>] __ubsan_handle_out_of_bounds+0x16e/0x1b2 lib/ubsan.c:382
       [<ffffffff82a25acd>] __xfrm_policy_unlink+0x3dd/0x5b0 net/xfrm/xfrm_policy.c:1289
       [<ffffffff82a2e572>] xfrm_policy_delete+0x52/0xb0 net/xfrm/xfrm_policy.c:1309
       [<ffffffff82a3319b>] xfrm_policy_timer+0x30b/0x590 net/xfrm/xfrm_policy.c:243
       [<ffffffff813d3927>] call_timer_fn+0x237/0x990 kernel/time/timer.c:1144
       [<ffffffff813d8e7e>] __run_timers kernel/time/timer.c:1218 [inline]
       [<ffffffff813d8e7e>] run_timer_softirq+0x6ce/0xb80 kernel/time/timer.c:1401
       [<ffffffff8120d6f9>] __do_softirq+0x299/0xe10 kernel/softirq.c:273
       [<ffffffff8120e676>] invoke_softirq kernel/softirq.c:350 [inline]
       [<ffffffff8120e676>] irq_exit+0x216/0x2c0 kernel/softirq.c:391
       [<ffffffff82c5edab>] exiting_irq arch/x86/include/asm/apic.h:652 [inline]
       [<ffffffff82c5edab>] smp_apic_timer_interrupt+0x8b/0xc0 arch/x86/kernel/apic/apic.c:926
       [<ffffffff82c5c985>] apic_timer_interrupt+0xa5/0xb0 arch/x86/entry/entry_64.S:735
       <EOI>  [<ffffffff81188096>] ? native_safe_halt+0x6/0x10 arch/x86/include/asm/irqflags.h:52
       [<ffffffff810834d7>] arch_safe_halt arch/x86/include/asm/paravirt.h:111 [inline]
       [<ffffffff810834d7>] default_idle+0x27/0x430 arch/x86/kernel/process.c:446
       [<ffffffff81085f05>] arch_cpu_idle+0x15/0x20 arch/x86/kernel/process.c:437
       [<ffffffff8132abc3>] default_idle_call+0x53/0x90 kernel/sched/idle.c:92
       [<ffffffff8132b32d>] cpuidle_idle_call kernel/sched/idle.c:156 [inline]
       [<ffffffff8132b32d>] cpu_idle_loop kernel/sched/idle.c:251 [inline]
       [<ffffffff8132b32d>] cpu_startup_entry+0x60d/0x9a0 kernel/sched/idle.c:299
       [<ffffffff8113e119>] start_secondary+0x3c9/0x560 arch/x86/kernel/smpboot.c:245
      
      The issue is triggered as this:
      
      xfrm_add_policy
          -->verify_newpolicy_info  //check the index provided by user with XFRM_POLICY_MAX
      			      //In my case, the index is 0x6E6BB6, so it pass the check.
          -->xfrm_policy_construct  //copy the user's policy and set xfrm_policy_timer
          -->xfrm_policy_insert
      	--> __xfrm_policy_link //use the orgin dir, in my case is 2
      	--> xfrm_gen_index   //generate policy index, there is 0x6E6BB6
      
      then xfrm_policy_timer be fired
      
      xfrm_policy_timer
         --> xfrm_policy_id2dir  //get dir from (policy index & 7), in my case is 6
         --> xfrm_policy_delete
            --> __xfrm_policy_unlink //access policy_count[dir], trigger out of range access
      
      Add xfrm_policy_id2dir check in verify_newpolicy_info, make sure the computed dir is
      valid, to fix the issue.
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Fixes: e682adf0 ("xfrm: Try to honor policy index if it's supplied by user")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      b805d78d
  26. 05 2月, 2019 1 次提交
    • C
      xfrm: destroy xfrm_state synchronously on net exit path · f75a2804
      Cong Wang 提交于
      xfrm_state_put() moves struct xfrm_state to the GC list
      and schedules the GC work to clean it up. On net exit call
      path, xfrm_state_flush() is called to clean up and
      xfrm_flush_gc() is called to wait for the GC work to complete
      before exit.
      
      However, this doesn't work because one of the ->destructor(),
      ipcomp_destroy(), schedules the same GC work again inside
      the GC work. It is hard to wait for such a nested async
      callback. This is also why syzbot still reports the following
      warning:
      
       WARNING: CPU: 1 PID: 33 at net/ipv6/xfrm6_tunnel.c:351 xfrm6_tunnel_net_exit+0x2cb/0x500 net/ipv6/xfrm6_tunnel.c:351
       ...
        ops_exit_list.isra.0+0xb0/0x160 net/core/net_namespace.c:153
        cleanup_net+0x51d/0xb10 net/core/net_namespace.c:551
        process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153
        worker_thread+0x143/0x14a0 kernel/workqueue.c:2296
        kthread+0x357/0x430 kernel/kthread.c:246
        ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
      
      In fact, it is perfectly fine to bypass GC and destroy xfrm_state
      synchronously on net exit call path, because it is in process context
      and doesn't need a work struct to do any blocking work.
      
      This patch introduces xfrm_state_put_sync() which simply bypasses
      GC, and lets its callers to decide whether to use this synchronous
      version. On net exit path, xfrm_state_fini() and
      xfrm6_tunnel_net_exit() use it. And, as ipcomp_destroy() itself is
      blocking, it can use xfrm_state_put_sync() directly too.
      
      Also rename xfrm_state_gc_destroy() to ___xfrm_state_destroy() to
      reflect this change.
      
      Fixes: b48c05ab ("xfrm: Fix warning in xfrm6_tunnel_net_exit.")
      Reported-and-tested-by: syzbot+e9aebef558e3ed673934@syzkaller.appspotmail.com
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      f75a2804
  27. 10 1月, 2019 1 次提交
    • F
      xfrm: refine validation of template and selector families · 35e61038
      Florian Westphal 提交于
      The check assumes that in transport mode, the first templates family
      must match the address family of the policy selector.
      
      Syzkaller managed to build a template using MODE_ROUTEOPTIMIZATION,
      with ipv4-in-ipv6 chain, leading to following splat:
      
      BUG: KASAN: stack-out-of-bounds in xfrm_state_find+0x1db/0x1854
      Read of size 4 at addr ffff888063e57aa0 by task a.out/2050
       xfrm_state_find+0x1db/0x1854
       xfrm_tmpl_resolve+0x100/0x1d0
       xfrm_resolve_and_create_bundle+0x108/0x1000 [..]
      
      Problem is that addresses point into flowi4 struct, but xfrm_state_find
      treats them as being ipv6 because it uses templ->encap_family is used
      (AF_INET6 in case of reproducer) rather than family (AF_INET).
      
      This patch inverts the logic: Enforce 'template family must match
      selector' EXCEPT for tunnel and BEET mode.
      
      In BEET and Tunnel mode, xfrm_tmpl_resolve_one will have remote/local
      address pointers changed to point at the addresses found in the template,
      rather than the flowi ones, so no oob read will occur.
      
      Reported-by: 3ntr0py1337@gmail.com
      Reported-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      35e61038
  28. 23 11月, 2018 1 次提交
  29. 01 11月, 2018 1 次提交
    • D
      compat: Cleanup in_compat_syscall() callers · 98f76206
      Dmitry Safonov 提交于
      Now that in_compat_syscall() is consistent on all architectures and does
      not longer report true on native i686, the workarounds (ifdeffery and
      helpers) can be removed.
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Andy Lutomirsky <luto@kernel.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-efi@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Link: https://lkml.kernel.org/r/20181012134253.23266-3-dima@arista.com
      98f76206
  30. 09 10月, 2018 1 次提交
  31. 20 9月, 2018 1 次提交
    • S
      xfrm: validate template mode · 32bf94fb
      Sean Tranchetti 提交于
      XFRM mode parameters passed as part of the user templates
      in the IP_XFRM_POLICY are never properly validated. Passing
      values other than valid XFRM modes can cause stack-out-of-bounds
      reads to occur later in the XFRM processing:
      
      [  140.535608] ================================================================
      [  140.543058] BUG: KASAN: stack-out-of-bounds in xfrm_state_find+0x17e4/0x1cc4
      [  140.550306] Read of size 4 at addr ffffffc0238a7a58 by task repro/5148
      [  140.557369]
      [  140.558927] Call trace:
      [  140.558936] dump_backtrace+0x0/0x388
      [  140.558940] show_stack+0x24/0x30
      [  140.558946] __dump_stack+0x24/0x2c
      [  140.558949] dump_stack+0x8c/0xd0
      [  140.558956] print_address_description+0x74/0x234
      [  140.558960] kasan_report+0x240/0x264
      [  140.558963] __asan_report_load4_noabort+0x2c/0x38
      [  140.558967] xfrm_state_find+0x17e4/0x1cc4
      [  140.558971] xfrm_resolve_and_create_bundle+0x40c/0x1fb8
      [  140.558975] xfrm_lookup+0x238/0x1444
      [  140.558977] xfrm_lookup_route+0x48/0x11c
      [  140.558984] ip_route_output_flow+0x88/0xc4
      [  140.558991] raw_sendmsg+0xa74/0x266c
      [  140.558996] inet_sendmsg+0x258/0x3b0
      [  140.559002] sock_sendmsg+0xbc/0xec
      [  140.559005] SyS_sendto+0x3a8/0x5a8
      [  140.559008] el0_svc_naked+0x34/0x38
      [  140.559009]
      [  140.592245] page dumped because: kasan: bad access detected
      [  140.597981] page_owner info is not active (free page?)
      [  140.603267]
      [  140.653503] ================================================================
      Signed-off-by: NSean Tranchetti <stranche@codeaurora.org>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      32bf94fb
  32. 03 8月, 2018 1 次提交
  33. 25 7月, 2018 1 次提交
  34. 25 6月, 2018 1 次提交
  35. 23 6月, 2018 2 次提交