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]
Date:   Wed, 15 May 2019 10:57:27 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     "Michael S. Tsirkin" <mst@...hat.com>
Cc:     kvm@...r.kernel.org, virtualization@...ts.linux-foundation.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        ppandit@...hat.com
Subject: Re: [PATCH net] vhost_net: fix possible infinite loop


On 2019/5/15 上午5:39, Michael S. Tsirkin wrote:
> Let me try to explain again.
> At the moment how does handle_tx_copy exit?
> It's for(;;) so you know you need to look for a break.
>
> When reading code you also notice there's a goto done
> which could exit the loop. if you scan forward
> you notice that it does not.
> This is confusing, but oh well. Worth fixing maybe ...
>
> Now you add the next round check.
> And there is also special code that
> detects whether you exited with break
> and whenever you did it acts specially.
>
> Yea it works. But I think it's clearer if we
> just make things obvious.
> If we want something to happen on error then
>
> 	if (error)
> 		handle
> 		break
>
> is imho clearer than
>
> 	flag = true
> 	if (error)
> 		break
> 	flag = false
>
>
> if (flag)
> 	handle
>
> in partucular - less branches on data path.
>
> you point out code duplication correctly,
> but we can solve it just by adding functions.
> like i suggested.


Ok, I think I get you.

Will try in next version.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ