netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Wang Yufen <wangyufen@huawei.com>
Cc: <davem@davemloft.net>, <yoshfuji@linux-ipv6.org>,
	<dsahern@kernel.org>, <edumazet@google.com>, <pabeni@redhat.com>,
	<ast@kernel.org>, <daniel@iogearbox.net>, <andrii@kernel.org>,
	<kafai@fb.com>, <songliubraving@fb.com>, <yhs@fb.com>,
	<john.fastabend@gmail.com>, <kpsingh@kernel.org>,
	<netdev@vger.kernel.org>, <bpf@vger.kernel.org>
Subject: Re: [PATCH net-next v3] ipv6: Fix signed integer overflow in __ip6_append_data
Date: Tue, 31 May 2022 21:35:00 -0700	[thread overview]
Message-ID: <20220531213500.521ef5cc@kernel.org> (raw)
In-Reply-To: <20220528022312.2827597-1-wangyufen@huawei.com>

On Sat, 28 May 2022 10:23:12 +0800 Wang Yufen wrote:
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index 55afd7f39c04..91704bbc7715 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -1308,7 +1308,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
>  	struct ipcm6_cookie ipc6;
>  	int addr_len = msg->msg_namelen;
>  	bool connected = false;
> -	int ulen = len;
> +	size_t ulen = len;
>  	int corkreq = READ_ONCE(up->corkflag) || msg->msg_flags&MSG_MORE;
>  	int err;
>  	int is_udplite = IS_UDPLITE(sk);

No need to change ulen neither, it will not overflow and will be
promoted to size_t when passed to ip6_append_data() / ip6_make_skb().

  reply	other threads:[~2022-06-01  4:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-28  2:23 [PATCH net-next v3] ipv6: Fix signed integer overflow in __ip6_append_data Wang Yufen
2022-06-01  4:35 ` Jakub Kicinski [this message]
2022-06-01  6:21   ` wangyufen

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=20220531213500.521ef5cc@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=songliubraving@fb.com \
    --cc=wangyufen@huawei.com \
    --cc=yhs@fb.com \
    --cc=yoshfuji@linux-ipv6.org \
    /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).