sysfs: Remove address alignment constraint in sysfs_emit{_at}
hulk inclusion category: bugfix bugzilla: 51349 CVE: CVE-2021-27365 --------------------------- sysfs_emit and sysfs_emit_at have a constraint that output buffer should be alignment with PAGE_SIZE, but currently we can not guarantee it since 59bb4798 ("mm, sl[aou]b: guarantee natural alignment for kmalloc(power-of-two)") is not merged. This may lead to an unexpected warning when execute like: 'cat /sys/class/iscsi_transport/tcp/handle'. As for the necessity of the address alignment constraint, Joe Perches (the code author) wrote that: > It's to make sure it's a PAGE_SIZE aligned buffer. > It's just so it would not be misused/abused in non-sysfs derived cases. So we'll not need to introduce 59bb4798 ("mm, sl[aou]b: guarantee natural alignment for kmalloc(power-of-two)") but just remove the address alignment constraint. For more discussions of the issue, see: https://www.spinics.net/lists/stable/msg455428.htmlSigned-off-by: NZheng Yejian <zhengyejian1@huawei.com> Reviewed-by: Nzhangyi (F) <yi.zhang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com> Reviewed-by: NZhang Yi <yi.zhang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录