diff options
author | jah <jah@FreeBSD.org> | 2016-05-20 03:03:04 +0000 |
---|---|---|
committer | jah <jah@FreeBSD.org> | 2016-05-20 03:03:04 +0000 |
commit | 09fce610f95b1e08464b46c6bda32df7ba9c5c4a (patch) | |
tree | 9c4ee70efee6b7622d4c82d088f1e3e318667470 /sys/netnatm | |
parent | b245978b1884863127ad9cf3bf166275bbc6c000 (diff) | |
download | FreeBSD-src-09fce610f95b1e08464b46c6bda32df7ba9c5c4a.zip FreeBSD-src-09fce610f95b1e08464b46c6bda32df7ba9c5c4a.tar.gz |
iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages to prevent memory exhaustion and short allocations on 32-bit systems. Since iicrdwr is intended to be a workalike of a Linux i2c-dev call, use the same limit of 42 that Linux uses.
Also check the return value of copyin(9) to prevent unnecessary allocation in the failure case.
Submitted by: ngie
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5155
Diffstat (limited to 'sys/netnatm')
0 files changed, 0 insertions, 0 deletions