aboutsummaryrefslogtreecommitdiff
path: root/scripts/bpf_helpers_doc.py
diff options
context:
space:
mode:
authorTuomas Tynkkynen <[email protected]>2020-04-10 15:32:57 +0300
committerJohannes Berg <[email protected]>2020-04-14 12:31:46 +0200
commit7ea862048317aa76d0f22334202779a25530980c (patch)
tree777d9da213eb7bb24cf86464afca0908fba178fd /scripts/bpf_helpers_doc.py
parent0e012b4e4b5ec8e064be3502382579dd0bb43269 (diff)
mac80211_hwsim: Use kstrndup() in place of kasprintf()
syzbot reports a warning: precision 33020 too large WARNING: CPU: 0 PID: 9618 at lib/vsprintf.c:2471 set_precision+0x150/0x180 lib/vsprintf.c:2471 vsnprintf+0xa7b/0x19a0 lib/vsprintf.c:2547 kvasprintf+0xb2/0x170 lib/kasprintf.c:22 kasprintf+0xbb/0xf0 lib/kasprintf.c:59 hwsim_del_radio_nl+0x63a/0x7e0 drivers/net/wireless/mac80211_hwsim.c:3625 genl_family_rcv_msg_doit net/netlink/genetlink.c:672 [inline] ... entry_SYSCALL_64_after_hwframe+0x49/0xbe Thus it seems that kasprintf() with "%.*s" format can not be used for duplicating a string with arbitrary length. Replace it with kstrndup(). Note that later this string is limited to NL80211_WIPHY_NAME_MAXLEN == 64, but the code is simpler this way. Reported-by: [email protected] Reported-by: [email protected] Cc: [email protected] Signed-off-by: Tuomas Tynkkynen <[email protected]> Link: https://lore.kernel.org/r/[email protected] [johannes: add note about length limit] Signed-off-by: Johannes Berg <[email protected]>
Diffstat (limited to 'scripts/bpf_helpers_doc.py')
0 files changed, 0 insertions, 0 deletions