* [net-next][PATCH] RDS: validate the requested traces user input against max supported
@ 2017-01-06 18:44 Santosh Shilimkar
2017-01-07 3:14 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Santosh Shilimkar @ 2017-01-06 18:44 UTC (permalink / raw)
To: netdev, davem; +Cc: linux-kernel, Santosh Shilimkar
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>
---
net/rds/af_rds.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index fd821740..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) {
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net-next][PATCH] RDS: validate the requested traces user input against max supported
2017-01-06 18:44 [net-next][PATCH] RDS: validate the requested traces user input against max supported Santosh Shilimkar
@ 2017-01-07 3:14 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-01-07 3:14 UTC (permalink / raw)
To: santosh.shilimkar; +Cc: netdev, linux-kernel
From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Date: Fri, 6 Jan 2017 10:44:15 -0800
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-07 3:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-06 18:44 [net-next][PATCH] RDS: validate the requested traces user input against max supported Santosh Shilimkar
2017-01-07 3:14 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).