Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

CAN: Use inode instead of kernel address for /proc file

Since the socket address is just being used as a unique identifier, its
inode number is an alternative that does not leak potentially sensitive
information.

CC-ing stable because MITRE has assigned CVE-2010-4565 to the issue.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dan Rosenberg and committed by
David S. Miller
9f260e0e 4a5fc4e1

+2 -2
+2 -2
net/can/bcm.c
··· 125 125 struct list_head tx_ops; 126 126 unsigned long dropped_usr_msgs; 127 127 struct proc_dir_entry *bcm_proc_read; 128 - char procname [20]; /* pointer printed in ASCII with \0 */ 128 + char procname [32]; /* inode number in decimal with \0 */ 129 129 }; 130 130 131 131 static inline struct bcm_sock *bcm_sk(const struct sock *sk) ··· 1521 1521 1522 1522 if (proc_dir) { 1523 1523 /* unique socket address as filename */ 1524 - sprintf(bo->procname, "%p", sock); 1524 + sprintf(bo->procname, "%lu", sock_i_ino(sk)); 1525 1525 bo->bcm_proc_read = proc_create_data(bo->procname, 0644, 1526 1526 proc_dir, 1527 1527 &bcm_proc_fops, sk);