nvmem: core: Check read_only flag for force_ro in bin_attr_nvmem_write()
Subsystems (2)
PATCH 1/1 nvmem: core: Check read_only flag for force_ro in bin_attr_nvmem_write()
The bin_attr_nvmem_write() must check the read_only flag and block writes on read-only devices, now that a nvmem device can be switched between read-write and read-only mode at runtime using the force_ro attribute. Add the missing check.
---
Cc: Srinivas Kandagatla <[email protected]>
Cc: [email protected]
--- drivers/nvmem/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/core.c +1 -1
@@ -267,7 +267,7 @@ static ssize_t bin_attr_nvmem_write(struct file *filp, struct kobject *kobj, count =round_down (count, nvmem->word_size); -if (!nvmem->reg_write) +if (!nvmem->reg_write || nvmem->read_only)return -EPERM ; rc =nvmem_reg_write (nvmem, pos, buf, count);
Signature · 1 line
2.43.0
Quoted 10 lines · Marek Vasut
The
bin_attr_nvmem_write()must check theread_onlyflag and block writes on read-only devices, now that a nvmem device can be switched between read-write and read-only mode at runtime using theforce_roattribute. Add the missing check.Fixes 9d7eb234ac7a ("nvmem: core: Implement force_ro sysfs attribute")Signed-off-by Marek Vasut <[email protected]>---
Cc: Srinivas Kandagatla <[email protected]>
Cc: [email protected]
It seems this bugfix is not even in next, any news ?
Quoted 6 lines · Marek Vasut
Quoted 5 lines · Marek Vasut
The
bin_attr_nvmem_write()must check theread_onlyflag and block writes on read-only devices, now that a nvmem device can be switched between read-write and read-only mode at runtime using theforce_roattribute. Add the missing check.
Quoted 6 lines
Quoted 5 lines
Fixes 9d7eb234ac7a ("nvmem: core: Implement force_ro sysfs attribute")Signed-off-by Marek Vasut <[email protected]>---
Cc: Srinivas Kandagatla <[email protected]>
Cc: [email protected]It seems this bugfix is not even in next, any news ?
This is still broken, bugfix is available for three months now, but not picked up. Any news?
Apologies, some how I missed this email.
Quoted 9 lines · Marek Vasut
Quoted 8 lines · Marek Vasut
Quoted 7 lines · Marek Vasut
The
bin_attr_nvmem_write()must check theread_onlyflag and block writes on read-only devices, now that a nvmem device can be switched between read-write and read-only mode at runtime using theforce_roattribute. Add the missing check.Fixes 9d7eb234ac7a ("nvmem: core: Implement force_ro sysfs attribute")Signed-off-by Marek Vasut <[email protected]>
Applied with CC stable.
--srini
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
---
Cc: Srinivas Kandagatla <[email protected]>
Cc: [email protected]It seems this bugfix is not even in next, any news ?
This is still broken, bugfix is available for three months now, but not picked up. Any news?
Quoted 1 line · Srinivas Kandagatla
Apologies, some how I missed this email.
No worries, the commit was still in my upstreaming queue, so I figured it was time to remind upstream about it.
Quoted 8 lines · Marek Vasut
Quoted 7 lines · Marek Vasut
Quoted 6 lines · Marek Vasut
Quoted 5 lines
The
bin_attr_nvmem_write()must check theread_onlyflag and block writes on read-only devices, now that a nvmem device can be switched between read-write and read-only mode at runtime using theforce_roattribute. Add the missing check.
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Fixes 9d7eb234ac7a ("nvmem: core: Implement force_ro sysfs attribute")Signed-off-by Marek Vasut <[email protected]>Applied with CC stable.
Thank you !