android_kernel_sony_sdm845/net/sunrpc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christophe JAILLET 778f78f969 SUNRPC: Fix a potential buffer overflow in 'svc_print_xprts()'
[ Upstream commit b25b60d7bfb02a74bc3c2d998e09aab159df8059 ]

'maxlen' is the total size of the destination buffer. There is only one
caller and this value is 256.

When we compute the size already used and what we would like to add in
the buffer, the trailling NULL character is not taken into account.
However, this trailling character will be added by the 'strcat' once we
have checked that we have enough place.

So, there is a off-by-one issue and 1 byte of the stack could be
erroneously overwridden.

Take into account the trailling NULL, when checking if there is enough
place in the destination buffer.

While at it, also replace a 'sprintf' by a safer 'snprintf', check for
output truncation and avoid a superfluous 'strlen'.

Fixes: dc9a16e49d ("svc: Add /proc/sys/sunrpc/transport files")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
[ cel: very minor fix to documenting comment
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 20:40:11 +02:00
..
auth_gss sunrpc: clean up properly in gss_mech_unregister() 2020-06-20 10:24:21 +02:00
xprtrdma xprtrdma: Fix backchannel allocation of extra rpcrdma_reps 2020-05-10 10:28:03 +02:00
addr.c net: sunrpc: Fix off-by-one issues in 'rpc_ntop6' 2020-06-30 15:38:27 -04:00
auth.c sunrpc: replace generic auth_cred hash with auth-specific function 2016-09-30 15:47:47 -04:00
auth_generic.c SUNRPC: Fix a bogus get/put in generic_key_to_expire() 2018-12-01 09:44:21 +01:00
auth_null.c sunrpc: move NO_CRKEY_TIMEOUT to the auth->au_flags 2016-07-19 16:23:24 -04:00
auth_unix.c NFS client updates for Linux 4.9 2016-10-13 21:28:20 -07:00
backchannel_rqst.c SUNRPC: Refactor rpc_xdr_buf_init() 2016-09-19 13:08:37 -04:00
cache.c sunrpc: fix crash when cache_head become valid before update 2019-12-21 10:42:19 +01:00
clnt.c net :sunrpc :clnt :Fix xps refcount imbalance on the error path 2019-07-21 09:05:57 +02:00
debugfs.c SUNRPC: Address kbuild warning in net/sunrpc/debugfs.c 2015-06-11 14:01:06 -04:00
Kconfig rpcrdma: Merge svcrdma and xprtrdma modules into one 2015-06-04 16:56:02 -04:00
Makefile SUNRPC: Add a structure to track multiple transports 2016-02-05 18:48:54 -05:00
netns.h
rpc_pipe.c sunrpc: fixed rollback in rpc_gssd_dummy_populate() 2020-06-30 15:38:45 -04:00
rpcb_clnt.c SUNRPC: stop printk reading past end of string 2020-09-23 08:46:14 +02:00
sched.c SUNRPC: Fix priority queue fairness 2019-11-25 09:53:19 +01:00
socklib.c sunrpc: do not pull udp headers on receive 2016-04-11 15:31:33 -04:00
stats.c sunrpc: add rpc_count_iostats_idx 2015-02-03 11:06:38 -08:00
sunrpc.h
sunrpc_syms.c SUNRPC: cleanup ida information when removing sunrpc module 2017-02-01 08:33:09 +01:00
svc.c sunrpc: use-after-free in svc_process_common() 2019-01-16 22:12:33 +01:00
svc_xprt.c SUNRPC: Fix a potential buffer overflow in 'svc_print_xprts()' 2020-10-01 20:40:11 +02:00
svcauth.c svcrpc: move some initialization to common code 2015-11-24 10:39:16 -07:00
svcauth_unix.c kernel: make groups_sort calling a responsibility group_info allocators 2018-01-10 09:29:52 +01:00
svcsock.c sunrpc: use-after-free in svc_process_common() 2019-01-16 22:12:33 +01:00
sysctl.c Sunrpc: Supports hexadecimal number for sysctl files of sunrpc debug 2015-11-03 15:56:49 -05:00
timer.c
xdr.c SUNRPC: Properly set the @subbuf parameter of xdr_buf_subsegment() 2020-06-30 15:38:45 -04:00
xprt.c SUNRPC: Fix a potential race in xprt_connect() 2018-12-21 14:11:36 +01:00
xprtmultipath.c SUNRPC search xprt switch for sockaddr 2016-09-19 13:08:36 -04:00
xprtsock.c sunrpc: safely reallow resvport min/max inversion 2019-11-28 18:28:31 +01:00