Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1363109
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 10/29] staging: lustre: libcfs: test if userland data is to small |
| Date | 2016-03-23 00:20 +0100 |
| Message-ID | <rfDKH-34K-21@gated-at.bofh.it> (permalink) |
| References | <rfDAZ-310-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Liang Zhen <liang.zhen@intel.com>
Ensure that user land data is at least the smallest size.
Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
.../lustre/lnet/libcfs/linux/linux-module.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c
index 35e2fcf..ae05895 100644
--- a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c
@@ -73,6 +73,11 @@ int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr **hdr_pp,
return -EINVAL;
}
+ if (hdr.ioc_len < sizeof(struct libcfs_ioctl_data)) {
+ CERROR("libcfs ioctl: user buffer too small for ioctl\n");
+ return -EINVAL;
+ }
+
if (hdr.ioc_len > LIBCFS_IOC_DATA_MAX) {
CERROR("libcfs ioctl: user buffer is too large %d/%d\n",
hdr.ioc_len, LIBCFS_IOC_DATA_MAX);
--
1.7.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/29] Bring libcfs ioctl handling up to date James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 29/29] staging: lustre: libcfs: return size_t for libcfs_ioctl_packlen James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 28/29] staging: lustre: libcfs: use BIT macro in linux-module.c James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 22/29] staging: lustre: libcfs: removal all userland only macros from libcfs_ioctl.h James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 18/29] staging:lustre: remove the IOC_LIBCFS_MEMHOG ioctl James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 24/29] staging: lustre: libcfs: move function declarations from libcfs_ioctl.h James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 03/29] staging: lustre: libcfs: merge code from libcfs_ioctl into libcfs_ioctl_getdata James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 23/29] staging: lustre: libcfs: migrate inline functions to source file James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 19/29] staging:lustre: remove libcfs_psdev_[open|release] James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 26/29] staging: lustre: libcfs: add uapi headers to libcfs_ioctl.h James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 14/29] staging: lustre: libcfs: remove libcfsutil.h in comment James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 25/29] staging: lustre: libcfs: make libcfs_ioctl.h readable James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 27/29] staging: lustre: libcfs: return proper bool values James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100 [PATCH 08/29] staging: lustre: libcfs: invert test condition for libcfs_ioctl James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100 [PATCH 13/29] staging: lustre: libcfs: change variable name James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100 [PATCH 11/29] staging: lustre: lnet: make sure lnet data not greater than LIBCFS_IOC_DATA_MAX James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100 [PATCH 04/29] staging: lustre: libcfs: merge libcfs_ioctl_handle into libcfs_ioctl James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100 [PATCH 10/29] staging: lustre: libcfs: test if userland data is to small James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100 [PATCH 01/29] staging: lustre: libcfs: replace LNET_MAX_IOCTL_BUF_LEN with something bigger James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100 [PATCH 02/29] staging: lustre: libcfs: use break in switch options for libcfs_ioctl_handle James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100 [PATCH 15/29] staging: lustre: libcfs: move libcfs_ioctl_handler stuff to libcfs.h James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100 [PATCH 12/29] staging: lustre: simple cleanup in obd_ioctl_popdata James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100 [PATCH 09/29] staging: lustre: libcfs: update error messages in linux-module.c James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100 [PATCH 05/29] staging: lustre: libcfs: add debugging info for libcfs_ioctl James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
csiph-web