aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o/i2o_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/i2o/i2o_config.c')
-rw-r--r--drivers/message/i2o/i2o_config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index 098de2b35784..9a49c243a6ac 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -188,6 +188,13 @@ static int i2o_cfg_parms(unsigned long arg, unsigned int type)
188 if (!dev) 188 if (!dev)
189 return -ENXIO; 189 return -ENXIO;
190 190
191 /*
192 * Stop users being able to try and allocate arbitary amounts
193 * of DMA space. 64K is way more than sufficient for this.
194 */
195 if (kcmd.oplen > 65536)
196 return -EMSGSIZE;
197
191 ops = memdup_user(kcmd.opbuf, kcmd.oplen); 198 ops = memdup_user(kcmd.opbuf, kcmd.oplen);
192 if (IS_ERR(ops)) 199 if (IS_ERR(ops))
193 return PTR_ERR(ops); 200 return PTR_ERR(ops);