diff options
author | santosh.shilimkar@oracle.com <santosh.shilimkar@oracle.com> | 2017-01-06 10:44:15 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-06 22:14:26 -0500 |
commit | 780e982905bef61d13496d9af5310bf4af3a64d3 (patch) | |
tree | bc67c33913e700fce2c8d1e6288be81ea5b5b364 /net/rds | |
parent | 1c966c5d26fec8bd71c42867e09d8da8aa721e58 (diff) | |
download | op-kernel-dev-780e982905bef61d13496d9af5310bf4af3a64d3.zip op-kernel-dev-780e982905bef61d13496d9af5310bf4af3a64d3.tar.gz |
RDS: validate the requested traces user input against max supported
Larger than supported value can lead to array read/write overflow.
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds')
-rw-r--r-- | net/rds/af_rds.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c index fd82174..b405f77 100644 --- a/net/rds/af_rds.c +++ b/net/rds/af_rds.c @@ -310,6 +310,9 @@ static int rds_recv_track_latency(struct rds_sock *rs, char __user *optval, if (copy_from_user(&trace, optval, sizeof(trace))) return -EFAULT; + if (trace.rx_traces > RDS_MSG_RX_DGRAM_TRACE_MAX) + return -EFAULT; + rs->rs_rx_traces = trace.rx_traces; for (i = 0; i < rs->rs_rx_traces; i++) { if (trace.rx_trace_pos[i] > RDS_MSG_RX_DGRAM_TRACE_MAX) { |