41d0192d5ad08e206c7db243c76234dc15e5a108
[openembedded.git] /
1 From 9f260e0efa4766e56d0ac14f1aeea6ee5eb8fe83 Mon Sep 17 00:00:00 2001
2 From: Dan Rosenberg <drosenberg@vsecurity.com>
3 Date: Sun, 26 Dec 2010 06:54:53 +0000
4 Subject: [PATCH 38/66] CAN: Use inode instead of kernel address for /proc file
5
6 Since the socket address is just being used as a unique identifier, its
7 inode number is an alternative that does not leak potentially sensitive
8 information.
9
10 CC-ing stable because MITRE has assigned CVE-2010-4565 to the issue.
11
12 Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
13 Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
15 ---
16  net/can/bcm.c |    4 ++--
17  1 files changed, 2 insertions(+), 2 deletions(-)
18
19 diff --git a/net/can/bcm.c b/net/can/bcm.c
20 index 6faa825..9d5e8ac 100644
21 --- a/net/can/bcm.c
22 +++ b/net/can/bcm.c
23 @@ -125,7 +125,7 @@ struct bcm_sock {
24         struct list_head tx_ops;
25         unsigned long dropped_usr_msgs;
26         struct proc_dir_entry *bcm_proc_read;
27 -       char procname [20]; /* pointer printed in ASCII with \0 */
28 +       char procname [32]; /* inode number in decimal with \0 */
29  };
30  
31  static inline struct bcm_sock *bcm_sk(const struct sock *sk)
32 @@ -1521,7 +1521,7 @@ static int bcm_connect(struct socket *sock, struct sockaddr *uaddr, int len,
33  
34         if (proc_dir) {
35                 /* unique socket address as filename */
36 -               sprintf(bo->procname, "%p", sock);
37 +               sprintf(bo->procname, "%lu", sock_i_ino(sk));
38                 bo->bcm_proc_read = proc_create_data(bo->procname, 0644,
39                                                      proc_dir,
40                                                      &bcm_proc_fops, sk);
41 -- 
42 1.6.6.1
43