Skip to content

Commit eece6c9

Browse files
Colin Ian Kinggregkh
authored andcommitted
irda: do not leak initialized list.dev to userspace
[ Upstream commit b024d949a3c24255a7ef1a470420eb478949aa4c ] list.dev has not been initialized and so the copy_to_user is copying data from the stack back to user space which is a potential information leak. Fix this ensuring all of list is initialized to zero. Detected by CoverityScan, CID#1357894 ("Uninitialized scalar variable") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4e39b74 commit eece6c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/irda/af_irda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2227,7 +2227,7 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
22272227
{
22282228
struct sock *sk = sock->sk;
22292229
struct irda_sock *self = irda_sk(sk);
2230-
struct irda_device_list list;
2230+
struct irda_device_list list = { 0 };
22312231
struct irda_device_info *discoveries;
22322232
struct irda_ias_set * ias_opt; /* IAS get/query params */
22332233
struct ias_object * ias_obj; /* Object in IAS */

0 commit comments

Comments
 (0)