Skip to content
Commit 4db3d750 authored by Leo Stone's avatar Leo Stone Committed by Keith Busch
Browse files

nvmet: Don't overflow subsysnqn



nvmet_root_discovery_nqn_store treats the subsysnqn string like a fixed
size buffer, even though it is dynamically allocated to the size of the
string.

Create a new string with kstrndup instead of using the old buffer.

Reported-by: default avatar <syzbot+ff4aab278fa7e27e0f9e@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=ff4aab278fa7e27e0f9e


Fixes: 95409e27 ("nvmet: implement unique discovery NQN")
Signed-off-by: default avatarLeo Stone <leocstone@gmail.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent ebefac56
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment