Re: [PATCH u-boot] regmap: fix a serious pointer casting bug

2021-03-16 Thread Simon Glass
Hi Bin, On Tue, 16 Mar 2021 at 21:46, Bin Meng wrote: > > Hi Simon, > > On Tue, Mar 16, 2021 at 2:10 PM Simon Glass wrote: > > > > Hello Marek, > > > > On 03.03.21 14:15, Marek Behún wrote: > > > There is a serious bug in regmap_read() and regmap_write() functions > > > where an uint pointer is

Re: [PATCH u-boot] regmap: fix a serious pointer casting bug

2021-03-16 Thread Bin Meng
Hi Simon, On Tue, Mar 16, 2021 at 2:10 PM Simon Glass wrote: > > Hello Marek, > > On 03.03.21 14:15, 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

Re: [PATCH u-boot] regmap: fix a serious pointer casting bug

2021-03-15 Thread Simon Glass
Hello Marek, On 03.03.21 14:15, 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

Re: [PATCH u-boot] regmap: fix a serious pointer casting bug

2021-03-05 Thread Heiko Schocher
Hello Marek, On 03.03.21 14:15, 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

Re: [PATCH u-boot] regmap: fix a serious pointer casting bug

2021-03-04 Thread Simon Glass
On Wed, 3 Mar 2021 at 08:16, 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 w

[PATCH u-boot] regmap: fix a serious pointer casting bug

2021-03-03 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