dccp: fix info leak via getsockopt(DCCP_SOCKOPT_CCID_TX_INFO)
The CCID3 code fails to initialize the trailing padding bytes of struct tfrc_tx_info added for alignment on 64 bit architectures. It that for potentially leaks four bytes kernel stack via the getsockopt() syscall. Add an explicit memset(0) before filling the structure to avoid the info leak. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
276bdb82de
commit
7b07f8eb75
1 changed files with 1 additions and 0 deletions
|
@ -535,6 +535,7 @@ static int ccid3_hc_tx_getsockopt(struct sock *sk, const int optname, int len,
|
||||||
case DCCP_SOCKOPT_CCID_TX_INFO:
|
case DCCP_SOCKOPT_CCID_TX_INFO:
|
||||||
if (len < sizeof(tfrc))
|
if (len < sizeof(tfrc))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
memset(&tfrc, 0, sizeof(tfrc));
|
||||||
tfrc.tfrctx_x = hc->tx_x;
|
tfrc.tfrctx_x = hc->tx_x;
|
||||||
tfrc.tfrctx_x_recv = hc->tx_x_recv;
|
tfrc.tfrctx_x_recv = hc->tx_x_recv;
|
||||||
tfrc.tfrctx_x_calc = hc->tx_x_calc;
|
tfrc.tfrctx_x_calc = hc->tx_x_calc;
|
||||||
|
|
Loading…
Reference in a new issue