All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space
@ 2016-12-02 17:33 ` Quentin Lambert
  0 siblings, 0 replies; 36+ messages in thread
From: Quentin Lambert @ 2016-12-02 17:33 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman,
	lustre-devel, devel, linux-kernel, kernel-janitors
  Cc: Quentin Lambert

lnet_ipif_enumerate was assigning a pointer from kernel space to user
space. This patch uses copy_to_user to properly do that assignment.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
---
 shouldn't we be using ifc_req instead of ifc_buf?

 drivers/staging/lustre/lnet/lnet/lib-socket.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- a/drivers/staging/lustre/lnet/lnet/lib-socket.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-socket.c
@@ -181,7 +181,13 @@ lnet_ipif_enumerate(char ***namesp)
 			goto out0;
 		}
 
-		ifc.ifc_buf = (char *)ifr;
+		rc = copy_to_user(ifc.ifc_buf, (char *)ifr,
+				  nalloc * sizeof(*ifr));
+		if (rc) {
+			rc = -ENOMEM;
+			goto out1;
+		}
+
 		ifc.ifc_len = nalloc * sizeof(*ifr);
 
 		rc = lnet_sock_ioctl(SIOCGIFCONF, (unsigned long)&ifc);

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2016-12-07 19:53 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-02 17:33 [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Quentin Lambert
2016-12-02 17:33 ` Quentin Lambert
2016-12-02 17:33 ` [lustre-devel] " Quentin Lambert
2016-12-05 20:52 ` Dan Carpenter
2016-12-05 20:52   ` Dan Carpenter
2016-12-05 20:52   ` [lustre-devel] " Dan Carpenter
2016-12-05 22:58 ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to Oleg Drokin
2016-12-05 22:58   ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Oleg Drokin
2016-12-05 22:58   ` Oleg Drokin
2016-12-06 13:48   ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to Quentin Lambert
2016-12-06 13:48     ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Quentin Lambert
2016-12-06 13:48     ` Quentin Lambert
2016-12-07 15:20     ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to Quentin Lambert
2016-12-07 15:20       ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Quentin Lambert
2016-12-07 15:20       ` Quentin Lambert
2016-12-07 15:32       ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to Dan Carpenter
2016-12-07 15:32         ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Dan Carpenter
2016-12-07 15:32         ` Dan Carpenter
2016-12-07 15:33       ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to Dan Carpenter
2016-12-07 15:33         ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Dan Carpenter
2016-12-07 15:33         ` Dan Carpenter
2016-12-07 15:42         ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to Quentin Lambert
2016-12-07 15:42           ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Quentin Lambert
2016-12-07 15:42           ` Quentin Lambert
2016-12-07 19:22           ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to Dan Carpenter
2016-12-07 19:22             ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Dan Carpenter
2016-12-07 19:22             ` Dan Carpenter
2016-12-07 19:52             ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to James Simmons
2016-12-07 19:52               ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space James Simmons
2016-12-07 19:52               ` James Simmons
2016-12-07 17:10         ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to Oleg Drokin
2016-12-07 17:10           ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Oleg Drokin
2016-12-07 17:10           ` Oleg Drokin
2016-12-07 17:22       ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to Oleg Drokin
2016-12-07 17:22         ` [lustre-devel] [PATCH] staging: lustre: Fix a spatch warning due to an assignment from kernel to user space Oleg Drokin
2016-12-07 17:22         ` Oleg Drokin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.