summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap/linus/0038-CAN-Use-inode-instead-of-kernel-address-for-proc-fil.patch
diff options
context:
space:
mode:
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.patch43
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 @@
1From 177f55e48f91842a6e33e896d64ebb9a44db298b Mon Sep 17 00:00:00 2001
2From: Dan Rosenberg <drosenberg@vsecurity.com>
3Date: Sun, 26 Dec 2010 06:54:53 +0000
4Subject: [PATCH 38/65] CAN: Use inode instead of kernel address for /proc file
5
6Since the socket address is just being used as a unique identifier, its
7inode number is an alternative that does not leak potentially sensitive
8information.
9
10CC-ing stable because MITRE has assigned CVE-2010-4565 to the issue.
11
12Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
13Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
14Signed-off-by: David S. Miller <davem@davemloft.net>
15---
16 net/can/bcm.c | 4 ++--
17 1 files changed, 2 insertions(+), 2 deletions(-)
18
19diff --git a/net/can/bcm.c b/net/can/bcm.c
20index 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--
421.6.6.1
43