Re: [PULL v2 25/31] osdep: Make MIN/MAX evaluate arguments only once

2020-06-29 Thread Markus Armbruster
Peter Maydell writes: > On Fri, 26 Jun 2020 at 14:57, Paolo Bonzini wrote: >> >> From: Eric Blake >> >> I'm not aware of any immediate bugs in qemu where a second runtime >> evaluation of the arguments to MIN() or MAX() causes a problem, but >> proactively preventing such abuse is easier than f

Re: [PULL v2 25/31] osdep: Make MIN/MAX evaluate arguments only once

2020-06-29 Thread Paolo Bonzini
On 29/06/20 17:23, Eric Blake wrote: >> >> >> Can we do something (eg providing fallback less-intelligent >> versions of the macro ifdef __COVERITY__) to help it? > > Absolutely; I see we've done similar in include/qemu/thread.h.  I'll > post something later today. Done already, you're in Cc. :)

Re: [PULL v2 25/31] osdep: Make MIN/MAX evaluate arguments only once

2020-06-29 Thread Eric Blake
On 6/27/20 4:35 PM, Peter Maydell wrote: On Fri, 26 Jun 2020 at 14:57, Paolo Bonzini wrote: From: Eric Blake I'm not aware of any immediate bugs in qemu where a second runtime evaluation of the arguments to MIN() or MAX() causes a problem, but proactively preventing such abuse is easier than

Re: [PULL v2 25/31] osdep: Make MIN/MAX evaluate arguments only once

2020-06-27 Thread Peter Maydell
On Fri, 26 Jun 2020 at 14:57, Paolo Bonzini wrote: > > From: Eric Blake > > I'm not aware of any immediate bugs in qemu where a second runtime > evaluation of the arguments to MIN() or MAX() causes a problem, but > proactively preventing such abuse is easier than falling prey to an > unintended c

[PULL v2 25/31] osdep: Make MIN/MAX evaluate arguments only once

2020-06-26 Thread Paolo Bonzini
From: Eric Blake I'm not aware of any immediate bugs in qemu where a second runtime evaluation of the arguments to MIN() or MAX() causes a problem, but proactively preventing such abuse is easier than falling prey to an unintended case down the road. At any rate, here's the conversation that spa