]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
9p/xen: fix check for xenbus_read error in front_probe
authorDominique Martinet <dominique.martinet@cea.fr>
Tue, 14 Aug 2018 02:43:48 +0000 (02:43 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitf55db9404d815f3dc912adb0f7988910b4713835
tree1a165d17a206feac027c8d1b5151926ae128395f
parent895b45fe8b2ae7911256e65bfca66e078acea43c
9p/xen: fix check for xenbus_read error in front_probe

BugLink: https://bugs.launchpad.net/bugs/1838824
[ Upstream commit 2f9ad0ac947ccbe3ffe7c6229c9330f2a7755f64 ]

If the xen bus exists but does not expose the proper interface, it is
possible to get a non-zero length but still some error, leading to
strcmp failing trying to load invalid memory addresses e.g.
fffffffffffffffe.

There is then no need to check length when there is no error, as the
xenbus driver guarantees that the string is nul-terminated.

Link: http://lkml.kernel.org/r/1534236007-10170-1-git-send-email-asmadeus@codewreck.org
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/9p/trans_xen.c