Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Quoting Hans Verkuil : On 01/30/18 12:43, Gustavo A. R. Silva wrote: Quoting Hans Verkuil : [...] What happens if you do: ((u64)CEC_TIM_START_BIT_TOTAL + I think that forces everything else in the expression to be evaluated as u64. Well, in this

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Hans Verkuil
On 01/30/18 12:43, Gustavo A. R. Silva wrote: > > Quoting Hans Verkuil : > > [...] > What happens if you do: ((u64)CEC_TIM_START_BIT_TOTAL + I think that forces everything else in the expression to be evaluated as u64. >>> >>> Well, in this case the

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Quoting Hans Verkuil : [...] What happens if you do: ((u64)CEC_TIM_START_BIT_TOTAL + I think that forces everything else in the expression to be evaluated as u64. Well, in this case the operator precedence takes place and the expression len * 10 *

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Quoting Hans Verkuil : On 01/30/2018 09:51 AM, Gustavo A. R. Silva wrote: Hi Hans, Quoting Hans Verkuil : Hi Gustavo, On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote: Cast len to const u64 in order to avoid a potential integer overflow. This

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Hans Verkuil
On 01/30/18 11:55, Gustavo A. R. Silva wrote: > > Quoting Hans Verkuil : > >> On 01/30/2018 09:51 AM, Gustavo A. R. Silva wrote: >>> Hi Hans, >>> >>> Quoting Hans Verkuil : >>> Hi Gustavo, On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote:

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Hans Verkuil
On 01/30/2018 09:51 AM, Gustavo A. R. Silva wrote: > Hi Hans, > > Quoting Hans Verkuil : > >> Hi Gustavo, >> >> On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote: >>> Cast len to const u64 in order to avoid a potential integer >>> overflow. This variable is being used in a

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Hi Hans, Quoting Hans Verkuil : Hi Gustavo, On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote: Cast len to const u64 in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type const u64.

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-29 Thread Hans Verkuil
Hi Gustavo, On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote: > Cast len to const u64 in order to avoid a potential integer > overflow. This variable is being used in a context that expects > an expression of type const u64. > > Addresses-Coverity-ID: 1454996 ("Unintentional integer overflow")

[PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-29 Thread Gustavo A. R. Silva
Cast len to const u64 in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type const u64. Addresses-Coverity-ID: 1454996 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva ---