【问题描述】
问题根因:在函数 __do_proc_doulongvec_minmax 中,返回值 err 被初始化为 0,
但是当解析到传入的值为负数时,会continue进入下一个循环而不更新err。
导致当传入负值时,返回值为0。给人造成负值被正常写入的错觉。
变更内容:当传入的值为负数时,正确返回 -EINVAL,因为 ulong类型不支持负数
具体表现为:
- 当传入单个值时,假如值为负值,内核返回 -EINVAL,用户态返回 1.
- 当传入多个值时,假如其中存在负数,所有值都不会写入,内核返回 -EINVAL,用户态返回 1.
【涉及版本&平台】
2.6之后所有版本,所有架构
Hi letfly, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @gatieme , @qiuuuuu , @zhengzengkai , @gogooo , @xiexiuqi , @yangyingliang
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论