]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid
authorAnant Thazhemadam <anant.thazhemadam@gmail.com>
Mon, 12 Oct 2020 04:24:04 +0000 (09:54 +0530)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 10 Dec 2020 11:02:57 +0000 (12:02 +0100)
commitd7be3758b193ba17a3232d581d80b8a4ca7d6c15
tree6bb443d92b3d0e8a804fd6ca6cec087ea28a7cab
parent5ddecbc1d3cb91c2dcc2f984498916d8728038ea
net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid

BugLink: https://bugs.launchpad.net/bugs/1904450
[ Upstream commit 7ca1db21ef8e0e6725b4d25deed1ca196f7efb28 ]

In p9_fd_create_unix, checking is performed to see if the addr (passed
as an argument) is NULL or not.
However, no check is performed to see if addr is a valid address, i.e.,
it doesn't entirely consist of only 0's.
The initialization of sun_server.sun_path to be equal to this faulty
addr value leads to an uninitialized variable, as detected by KMSAN.
Checking for this (faulty addr) and returning a negative error number
appropriately, resolves this issue.

Link: http://lkml.kernel.org/r/20201012042404.2508-1-anant.thazhemadam@gmail.com
Reported-by: syzbot+75d51fe5bf4ebe988518@syzkaller.appspotmail.com
Tested-by: syzbot+75d51fe5bf4ebe988518@syzkaller.appspotmail.com
Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
net/9p/trans_fd.c