Skip to content

Commit

Permalink
net: ax25: fix information leak to userland
Browse files Browse the repository at this point in the history
Sometimes ax25_getname() doesn't initialize all members of fsa_digipeater
field of fsa struct, also the struct has padding bytes between
sax25_call and sax25_ndigis fields.  This structure is then copied to
userland.  It leads to leaking of contents of kernel stack memory.

Signed-off-by: Vasiliy Kulikov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
segoon authored and davem330 committed Nov 10, 2010
1 parent 332dd96 commit fe10ae5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ax25/af_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,7 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr,
ax25_cb *ax25;
int err = 0;

memset(fsa, 0, sizeof(fsa));
lock_sock(sk);
ax25 = ax25_sk(sk);

Expand All @@ -1403,7 +1404,6 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr,

fsa->fsa_ax25.sax25_family = AF_AX25;
fsa->fsa_ax25.sax25_call = ax25->dest_addr;
fsa->fsa_ax25.sax25_ndigis = 0;

if (ax25->digipeat != NULL) {
ndigi = ax25->digipeat->ndigi;
Expand Down

0 comments on commit fe10ae5

Please sign in to comment.