Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1687247
| From | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/4] thermal: imx: Add support for reading OCOTP through nvmem |
| Date | 2017-07-14 13:00 +0200 |
| Message-ID | <u36ue-2ge-37@gated-at.bofh.it> (permalink) |
| References | <u1GVc-5yK-41@gated-at.bofh.it> <u2jtx-4CF-29@gated-at.bofh.it> <u2jtw-4CF-27@gated-at.bofh.it> <u34C6-Xc-17@gated-at.bofh.it> <u36uf-2ge-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 14/07/17 11:49, Leonard Crestez wrote: >>>> + } >>>> + memcpy(val, buf, sizeof(*val)); >> This can overflow the memory allocated to val, we should be careful here >> not to do so. >> limit this to sizeof(u32) should be good. Also add some sanity checks to >> make sure that len is atleast 4 bytes. > I'm not sure what you mean, isn't this already done? There is an > explicit check above that the read len is exactly as expected. It's > just that the limit is written as sizeof(*val) rather than sizeof(u32). Opps, I overlooked the type.. it looks okay. thanks, srini >
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH 2/4] thermal: imx: Add support for reading OCOTP through nvmem Shawn Guo <shawnguo@kernel.org> - 2017-07-12 08:40 +0200
Re: [PATCH 2/4] thermal: imx: Add support for reading OCOTP through nvmem Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2017-07-14 11:00 +0200
Re: [PATCH 2/4] thermal: imx: Add support for reading OCOTP through nvmem Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2017-07-14 13:00 +0200
csiph-web