netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ziyang Xuan <william.xuanziyang@huawei.com>
Cc: <borisp@nvidia.com>, <john.fastabend@gmail.com>,
	<daniel@iogearbox.net>, <davem@davemloft.net>,
	<pabeni@redhat.com>, <netdev@vger.kernel.org>,
	<vakul.garg@nxp.com>, <davejwatson@fb.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net v2] net/tls: fix slab-out-of-bounds bug in decrypt_internal
Date: Thu, 31 Mar 2022 20:20:57 -0700	[thread overview]
Message-ID: <20220331202057.4bbfb719@kernel.org> (raw)
In-Reply-To: <20220331070428.36111-1-william.xuanziyang@huawei.com>

On Thu, 31 Mar 2022 15:04:28 +0800 Ziyang Xuan wrote:
> The memory size of tls_ctx->rx.iv for AES128-CCM is 12 setting in
> tls_set_sw_offload(). The return value of crypto_aead_ivsize()
> for "ccm(aes)" is 16. So memcpy() require 16 bytes from 12 bytes
> memory space will trigger slab-out-of-bounds bug as following:
> 
> ==================================================================
> BUG: KASAN: slab-out-of-bounds in decrypt_internal+0x385/0xc40 [tls]
> Read of size 16 at addr ffff888114e84e60 by task tls/10911

Reviewed-by: Jakub Kicinski <kuba@kernel.org>

Thanks!

  reply	other threads:[~2022-04-01  3:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31  7:04 [PATCH net v2] net/tls: fix slab-out-of-bounds bug in decrypt_internal Ziyang Xuan
2022-04-01  3:20 ` Jakub Kicinski [this message]
2022-04-01 11:00 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220331202057.4bbfb719@kernel.org \
    --to=kuba@kernel.org \
    --cc=borisp@nvidia.com \
    --cc=daniel@iogearbox.net \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=john.fastabend@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vakul.garg@nxp.com \
    --cc=william.xuanziyang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).