Re: [Xen-devel] [PATCH 2/2] hvmloader: cast to 64bit before multiplication in get_module_entry

2016-08-22 Thread Jan Beulich
>>> On 22.08.16 at 13:37, wrote: > On Fri, Aug 19, 2016 at 06:00:12AM -0600, Jan Beulich wrote: >> >>> On 19.08.16 at 12:09, wrote: >> > On 19/08/16 09:31, Jan Beulich wrote: >> > On 19.08.16 at 10:06, wrote: >> >>> ---

Re: [Xen-devel] [PATCH 2/2] hvmloader: cast to 64bit before multiplication in get_module_entry

2016-08-22 Thread Wei Liu
On Fri, Aug 19, 2016 at 06:00:12AM -0600, Jan Beulich wrote: > >>> On 19.08.16 at 12:09, wrote: > > On 19/08/16 09:31, Jan Beulich wrote: > > On 19.08.16 at 10:06, wrote: > >>> --- a/tools/firmware/hvmloader/hvmloader.c > >>> +++

Re: [Xen-devel] [PATCH 2/2] hvmloader: cast to 64bit before multiplication in get_module_entry

2016-08-19 Thread Jan Beulich
>>> On 19.08.16 at 12:09, wrote: > On 19/08/16 09:31, Jan Beulich wrote: > On 19.08.16 at 10:06, wrote: >>> --- a/tools/firmware/hvmloader/hvmloader.c >>> +++ b/tools/firmware/hvmloader/hvmloader.c >>> @@ -272,8 +272,8 @@ const struct

Re: [Xen-devel] [PATCH 2/2] hvmloader: cast to 64bit before multiplication in get_module_entry

2016-08-19 Thread Andrew Cooper
On 19/08/16 09:31, Jan Beulich wrote: On 19.08.16 at 10:06, wrote: >> Coverity complains: >> >> overflow_before_widen: Potentially overflowing expression >> info->nr_modules * 32U with type unsigned int (32 bits, unsigned) is >> evaluated using 32-bit arithmetic, and

Re: [Xen-devel] [PATCH 2/2] hvmloader: cast to 64bit before multiplication in get_module_entry

2016-08-19 Thread Jan Beulich
>>> On 19.08.16 at 10:06, wrote: > Coverity complains: > > overflow_before_widen: Potentially overflowing expression > info->nr_modules * 32U with type unsigned int (32 bits, unsigned) is > evaluated using 32-bit arithmetic, and then used in a context that > expects an

[Xen-devel] [PATCH 2/2] hvmloader: cast to 64bit before multiplication in get_module_entry

2016-08-19 Thread Wei Liu
Coverity complains: overflow_before_widen: Potentially overflowing expression info->nr_modules * 32U with type unsigned int (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type uint64_t (64 bits, unsigned). The overflow is