lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cea6d18e823ed89270a5bb2cad9c65377b520678.camel@redhat.com>
Date:   Thu, 17 Sep 2020 10:18:51 +0200
From:   Paolo Abeni <pabeni@...hat.com>
To:     Ye Bin <yebin10@...wei.com>, mathew.j.martineau@...ux.intel.com,
        matthieu.baerts@...sares.net, mptcp@...ts.01.org,
        netdev@...r.kernel.org
Cc:     Hulk Robot <hulkci@...wei.com>
Subject: Re: [PATCH v3] mptcp: Fix unsigned 'max_seq' compared with zero in
 mptcp_data_queue_ofo

On Thu, 2020-09-17 at 09:12 +0800, Ye Bin wrote:
> Fixes coccicheck warnig:
> net/mptcp/protocol.c:164:11-18: WARNING: Unsigned expression compared with zero: max_seq > 0
> 
> Fixes: ab174ad8ef76 ("mptcp: move ooo skbs into msk out of order queue")
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Ye Bin <yebin10@...wei.com>
> ---
>  net/mptcp/protocol.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index ef0dd2f23482..386cd4e60250 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -157,11 +157,12 @@ static void mptcp_data_queue_ofo(struct mptcp_sock *msk, struct sk_buff *skb)
>  	struct rb_node **p, *parent;
>  	u64 seq, end_seq, max_seq;
>  	struct sk_buff *skb1;
> +	int space;
>  
>  	seq = MPTCP_SKB_CB(skb)->map_seq;
>  	end_seq = MPTCP_SKB_CB(skb)->end_seq;
> -	max_seq = tcp_space(sk);
> -	max_seq = max_seq > 0 ? max_seq + msk->ack_seq : msk->ack_seq;
> +	space = tcp_space(sk);
> +	max_seq = space > 0 ? space + msk->ack_seq : msk->ack_seq;
>  
>  	pr_debug("msk=%p seq=%llx limit=%llx empty=%d", msk, seq, max_seq,
>  		 RB_EMPTY_ROOT(&msk->out_of_order_queue));

Thank you for addressing our feedback!

Acked-by: Paolo Abeni <pabeni@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ