Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1345294

[PATCH 2/2] staging: lustre: Use __user for a pointer to a user space address

From "M. Vefa Bicakci" <m.v.b@runbox.com>
Newsgroups linux.kernel
Subject [PATCH 2/2] staging: lustre: Use __user for a pointer to a user space address
Date 2016-02-28 15:50 +0100
Message-ID <r7aPw-3VM-11@gated-at.bofh.it> (permalink)
References <r7aPw-3VM-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This commit corrects two sparse warnings caused by the lack of a __user
annotation for the third argument of the libcfs_ioctl_handle function.

  module.c:165:68: warning: incorrect type in argument 1
    (different address spaces)
  module.c:165:68:    expected void [noderef] <asn:1>*arg
  module.c:165:68:    got void *arg
  module.c:209:47: warning: incorrect type in argument 3
    (different address spaces)
  module.c:209:47:    expected void *arg
  module.c:209:47:    got void [noderef] <asn:1>*arg

The need to have the __user annotation is supported by the fact that
libcfs_ioctl_handle passes its third argument to a helper function
(libcfs_ioctl_popdata) which also has a __user annotation for its
corresponding argument.

Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
---
 drivers/staging/lustre/lustre/libcfs/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index 05e2c5625220..f3845dcee259 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -120,7 +120,7 @@ int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand)
 EXPORT_SYMBOL(libcfs_deregister_ioctl);
 
 static int libcfs_ioctl_handle(struct cfs_psdev_file *pfile, unsigned long cmd,
-			       void *arg, struct libcfs_ioctl_hdr *hdr)
+			       void __user *arg, struct libcfs_ioctl_hdr *hdr)
 {
 	struct libcfs_ioctl_data *data = NULL;
 	int err = -EINVAL;
-- 
2.5.0

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] staging: lustre: Correct two minor issues found by sparse "M. Vefa Bicakci" <m.v.b@runbox.com> - 2016-02-28 15:50 +0100
  [PATCH 2/2] staging: lustre: Use __user for a pointer to a user space address "M. Vefa Bicakci" <m.v.b@runbox.com> - 2016-02-28 15:50 +0100

csiph-web