diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/linus/0038-CAN-Use-inode-instead-of-kernel-address-for-proc-fil.patch')
-rw-r--r-- | extras/recipes-kernel/linux/linux-omap/linus/0038-CAN-Use-inode-instead-of-kernel-address-for-proc-fil.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/linus/0038-CAN-Use-inode-instead-of-kernel-address-for-proc-fil.patch b/extras/recipes-kernel/linux/linux-omap/linus/0038-CAN-Use-inode-instead-of-kernel-address-for-proc-fil.patch new file mode 100644 index 00000000..130a6407 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/linus/0038-CAN-Use-inode-instead-of-kernel-address-for-proc-fil.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 177f55e48f91842a6e33e896d64ebb9a44db298b 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/65] 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 | |||