Skip to content

Commit cb2dfac

Browse files
panjaneyjmberg-intel
authored andcommitted
wifi: iwlwifi: fix out of bound copy_from_user
The driver copies the userspace buffer into an internal NUL byte terminated buffer. While doing so, it was reading beyond the end of the userspace buffer, overwriting its own NUL termination in the process. Fix this by only copying the correct number of bytes. Fixes: 3f24487 ("wifi: iwlwifi: make debugfs entries link specific") Signed-off-by: Anjaneyulu <[email protected]> Reviewed-by: Gregory Greenman <[email protected]> Reviewed-by: Benjamin Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20231219215605.e4913deb2ad4.Idcf6a7e909ff4b7801cd49c2f691f84a2f68eff9@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent c5bfdb4 commit cb2dfac

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+1
-1
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ static ssize_t _iwl_dbgfs_link_sta_##name##_write(struct file *file, \
18291829
char buf[buflen] = {}; \
18301830
size_t buf_size = min(count, sizeof(buf) - 1); \
18311831
\
1832-
if (copy_from_user(buf, user_buf, sizeof(buf))) \
1832+
if (copy_from_user(buf, user_buf, buf_size)) \
18331833
return -EFAULT; \
18341834
\
18351835
return _iwl_dbgfs_link_sta_wrap_write(iwl_dbgfs_##name##_write, \

0 commit comments

Comments
 (0)