Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1205028
| From | Shunqian Zheng <zhengsq@rock-chips.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 2/5] nvmem: fix the out-of-range leak in read/write() |
| Date | 2015-08-11 12:30 +0200 |
| Message-ID | <pWeYG-2jf-19@gated-at.bofh.it> (permalink) |
| References | <pWeOZ-27X-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: ZhengShunQian <zhengsq@rock-chips.com> The position to read/write must be less than max register size. Signed-off-by: ZhengShunQian <zhengsq@rock-chips.com> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> --- drivers/nvmem/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index d3c6676..f4af8e5 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -67,7 +67,7 @@ static ssize_t bin_attr_nvmem_read(struct file *filp, struct kobject *kobj, int rc; /* Stop the user from reading */ - if (pos > nvmem->size) + if (pos >= nvmem->size) return 0; if (pos + count > nvmem->size) @@ -92,7 +92,7 @@ static ssize_t bin_attr_nvmem_write(struct file *filp, struct kobject *kobj, int rc; /* Stop the user from writing */ - if (pos > nvmem->size) + if (pos >= nvmem->size) return 0; if (pos + count > nvmem->size) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 0/5] Add eFuse driver of Rockchip SoC Shunqian Zheng <zhengsq@rock-chips.com> - 2015-08-11 12:20 +0200
[PATCH v2 3/5] nvmem: rockchip-efuse: implement efuse driver Shunqian Zheng <zhengsq@rock-chips.com> - 2015-08-11 12:20 +0200
[PATCH v2 4/5] Documentation: rockchip-efuse: describe the usage of eFuse Shunqian Zheng <zhengsq@rock-chips.com> - 2015-08-11 12:20 +0200
[PATCH v2 1/5] clk: rockchip: rk3288: Add the clock id of eFuse Shunqian Zheng <zhengsq@rock-chips.com> - 2015-08-11 12:20 +0200
Re: [PATCH v2 1/5] clk: rockchip: rk3288: Add the clock id of eFuse Stephen Boyd <sboyd@codeaurora.org> - 2015-08-12 03:40 +0200
[PATCH v2 5/5] ARM: dts: rockchip: add eFuse config of rk3288 SoC Shunqian Zheng <zhengsq@rock-chips.com> - 2015-08-11 12:30 +0200
[PATCH v2 2/5] nvmem: fix the out-of-range leak in read/write() Shunqian Zheng <zhengsq@rock-chips.com> - 2015-08-11 12:30 +0200
csiph-web