]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Fix buffer overflow checking in gss_encode_v0_msg/gss_encode_v1_msg
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 28 Oct 2013 22:18:00 +0000 (18:18 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 28 Oct 2013 22:53:21 +0000 (18:53 -0400)
commit126f51415b9bcda566bd86308acaa294a592cfbc
tree52e223ce02fc746865cac4bbce64b433fde53613
parent2bfc7fb49283ca531d59820cdd2ffa6fe5f30ba5
SUNRPC: Fix buffer overflow checking in gss_encode_v0_msg/gss_encode_v1_msg

In gss_encode_v1_msg, it is pointless to BUG() after the overflow has
happened. Replace the existing sprintf()-based code with scnprintf(),
and warn if an overflow is ever triggered.

In gss_encode_v0_msg, replace the runtime BUG_ON() with an appropriate
compile-time BUILD_BUG_ON.

Reported-by: Bruce Fields <bfields@fieldses.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/auth_gss/auth_gss.c