[ceph] parse_longname(): strrchr() expects NUL-terminated string
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 18 Feb 2025 22:57:17 +0000 (17:57 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 17 Jun 2025 21:57:14 +0000 (17:57 -0400)
commit101841c38346f4ca41dc1802c867da990ffb32eb
treeb24a1cf0dc2d7ce8072a6ebc4db7a6b03b7db231
parent19272b37aa4f83ca52bdf9c16d5d81bdd1354494
[ceph] parse_longname(): strrchr() expects NUL-terminated string

... and parse_longname() is not guaranteed that.  That's the reason
why it uses kmemdup_nul() to build the argument for kstrtou64();
the problem is, kstrtou64() is not the only thing that need it.

Just get a NUL-terminated copy of the entire thing and be done
with that...

Fixes: dd66df0053ef "ceph: add support for encrypted snapshot names"
Tested-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ceph/crypto.c