netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [SECURITY] CAN info leak/minor heap overflow
@ 2010-11-02 18:28 Dan Rosenberg
  2010-11-02 19:43 ` Oliver Hartkopp
  2010-11-05 18:33 ` [PATCH] Fix " Urs Thuermann
  0 siblings, 2 replies; 12+ messages in thread
From: Dan Rosenberg @ 2010-11-02 18:28 UTC (permalink / raw)
  To: socketcan, oliver.hartkopp, urs.thuermann; +Cc: netdev, security

In bcm_connect() (in net/can/bcm.c), I noticed the following code:

	sprintf(bo->procname, "%p", sock);

"procname" is a 9-byte char array.  This code is wrong on two levels.
First, leaking a kernel address via a /proc filename is bad.  Secondly,
on 64-bit platforms, up to 17 bytes may be copied into the buffer.
Fortunately, structure padding will most likely prevent this from being
a problem, except for the trailing NULL byte, which may overwrite the
first byte of the next heap object.  Please name your procfile in a way
that doesn't leak information and fits into the desired name buffer.

-Dan


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-11-10 22:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-02 18:28 [SECURITY] CAN info leak/minor heap overflow Dan Rosenberg
2010-11-02 19:43 ` Oliver Hartkopp
2010-11-02 19:53   ` Dan Rosenberg
2010-11-02 19:57     ` [Security] " Linus Torvalds
2010-11-02 20:19       ` Oliver Hartkopp
2010-11-02 20:16     ` Oliver Hartkopp
2010-11-05 18:33 ` [PATCH] Fix " Urs Thuermann
2010-11-09  7:52   ` Oliver Hartkopp
2010-11-09 17:05     ` David Miller
2010-11-10  6:52       ` Oliver Hartkopp
2010-11-10 17:51         ` David Miller
2010-11-10 22:10           ` Oliver Hartkopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).