Re: [PATCH u-boot v3 01/39] regmap: fix a serious pointer casting bug

2021-03-16 Thread Marek Behun
On Tue, 16 Mar 2021 20:59:55 +0530 Pratyush Yadav wrote: > On 16/03/21 03:15PM, Marek Behun wrote: > > On Tue, 16 Mar 2021 19:28:46 +0530 > > Pratyush Yadav wrote: > > > > > On 16/03/21 01:25PM, Marek Behún wrote: > > > > There is a serious bug in regmap_read() and regmap_write() functions

Re: [PATCH u-boot v3 01/39] regmap: fix a serious pointer casting bug

2021-03-16 Thread Pratyush Yadav
On 16/03/21 03:15PM, Marek Behun wrote: > On Tue, 16 Mar 2021 19:28:46 +0530 > Pratyush Yadav wrote: > > > On 16/03/21 01:25PM, Marek Behún wrote: > > > There is a serious bug in regmap_read() and regmap_write() functions > > > where an uint pointer is cast to (void *) which is then cast to (u8 *

Re: [PATCH u-boot v3 01/39] regmap: fix a serious pointer casting bug

2021-03-16 Thread Marek Behun
On Tue, 16 Mar 2021 19:28:46 +0530 Pratyush Yadav wrote: > On 16/03/21 01:25PM, Marek Behún wrote: > > There is a serious bug in regmap_read() and regmap_write() functions > > where an uint pointer is cast to (void *) which is then cast to (u8 *), > > (u16 *), (u32 *) or (u64 *), depending on reg

Re: [PATCH u-boot v3 01/39] regmap: fix a serious pointer casting bug

2021-03-16 Thread Pratyush Yadav
On 16/03/21 01:25PM, Marek Behún wrote: > There is a serious bug in regmap_read() and regmap_write() functions > where an uint pointer is cast to (void *) which is then cast to (u8 *), > (u16 *), (u32 *) or (u64 *), depending on register width of the map. > > For example given a regmap with 16-bit

[PATCH u-boot v3 01/39] regmap: fix a serious pointer casting bug

2021-03-16 Thread Marek Behún
There is a serious bug in regmap_read() and regmap_write() functions where an uint pointer is cast to (void *) which is then cast to (u8 *), (u16 *), (u32 *) or (u64 *), depending on register width of the map. For example given a regmap with 16-bit register width the code int val = 0x12340