Staging: batman-adv: return -EFAULT on copy_to_user errors
Subsystems (2)
PATCH 1/1 Staging: batman-adv: return -EFAULT on copy_to_user errors
copy_to_user() returns the number of bites remaining but we want to return a negative error code here.
drivers/staging/batman-adv/device.c +1 -1
@@ -196,7 +196,7 @@ ssize_t bat_device_read(struct file *file, char __user *buf, size_t count,kfree (device_packet);if (error) -return error; +return -EFAULT ;return sizeof (struct icmp_packet ); }
Quoted 10 lines · Dan Carpenter
copy_to_user()returns the number of bites remaining but we want to return a negative error code here.Signed-off-by Dan Carpenter <[email protected]>(quoted diff) +0
-0
b/drivers/staging/batman-adv/device.cindex ad82ec4..c7f3978 100644
drivers/staging/batman-adv/device.c ssize_t bat_device_read(struct file *file, char __user · line 202
Quoted 8 lines
drivers/staging/batman-adv/device.c +1
-1@@ -196,7 +196,7 @@ ssize_t bat_device_read(struct file *file, char __user *buf, size_t count, kfree(device_packet);if (error) -return error; +return -EFAULT ;return sizeof (struct icmp_packet ); }
Thanks for your patch, but this collides with a patch currently waiting in GregKH's queue. I will port that patch on top of that.
Best regards,
Sven
PATCH 1/1 batman-adv: return -EFAULT on copy_to_user errors
In reply to Dan CarpenterFrom: Dan Carpenter <[email protected]>
copy_to_user() returns the number of bites remaining but we want to return a negative error code here.
---
This patch is already applied in maint and must be applied in master.
batman-adv-kernelland/icmp_socket.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
batman-adv-kernelland/icmp_socket.c +1 -1
@@ -148,7 +148,7 @@ static ssize_t bat_socket_read(struct file *file, char __user *buf,kfree (socket_packet);if (error) -return error; +return -EFAULT ;return packet_len; }
Signature · 1 line
1.7.1
Simon Wunderlich
AppliedRe: [B.A.T.M.A.N.] [PATCH] batman-adv: return -EFAULT on copy_to_user errors
Thank you, applied in svn r1689.
Quoted 31 lines · Sven Eckelmann
From: Dan Carpenter <[email protected]>
copy_to_user()returns the number of bites remaining but we want to return a negative error code here.Signed-off-by Dan Carpenter <[email protected]>[[email protected]: Move change from device.c to icmp_socket.c]Signed-off-by Sven Eckelmann <[email protected]>---
This patch is already applied in maint and must be applied in master.batman-adv-kernelland/icmp_socket.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)batman-adv-kernelland/icmp_socket.c +1
-1@@ -148,7 +148,7 @@ static ssize_t bat_socket_read(struct file *file, char __user *buf,kfree (socket_packet);if (error) -return error; +return -EFAULT ;return packet_len; }Signature · 1 line
1.7.1