* x25: remote-triggerable heap overflow in call user data processing
@ 2011-10-03 3:23 matt d
2011-10-03 5:45 ` Eric Dumazet
0 siblings, 1 reply; 3+ messages in thread
From: matt d @ 2011-10-03 3:23 UTC (permalink / raw)
To: netdev
Refer to the x25 packet layer's handling of incoming call user data,
namely at these two locations, in x25_rx_call_request and
x25_state1_machine:
https://github.com/mirrors/linux/blob/master/net/x25/af_x25.c#L1039
https://github.com/mirrors/linux/blob/master/net/x25/x25_in.c#L126
Call user data from an incoming message is copied into
(make)x25->calluserdata.cuddata buffers, which are 128 bytes long.
However, the length copied is based on the remaining message length,
and is not limited to the output buffer size. This allows a remote
attacker to overflow data onto the heap.
There is an appropriate constant defined for the length, but it
seemingly isn't used there:
https://github.com/mirrors/linux/blob/master/include/net/x25.h#L104
It seems this issue was noticed some time ago:
http://www.spinics.net/lists/linux-x25/msg00043.html
http://patchwork.ozlabs.org/patch/23917/
...however nothing was done about the bigger problem.
I have written a simple exploit for this vulnerability if it needs to
be posted, however I think the problem is pretty straightforward to
see as-is.
- Matthew Daley
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: x25: remote-triggerable heap overflow in call user data processing
2011-10-03 3:23 x25: remote-triggerable heap overflow in call user data processing matt d
@ 2011-10-03 5:45 ` Eric Dumazet
2011-10-03 6:51 ` Andrew Hendry
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2011-10-03 5:45 UTC (permalink / raw)
To: matt d; +Cc: netdev
Le lundi 03 octobre 2011 à 16:23 +1300, matt d a écrit :
> Refer to the x25 packet layer's handling of incoming call user data,
> namely at these two locations, in x25_rx_call_request and
> x25_state1_machine:
> https://github.com/mirrors/linux/blob/master/net/x25/af_x25.c#L1039
> https://github.com/mirrors/linux/blob/master/net/x25/x25_in.c#L126
>
> Call user data from an incoming message is copied into
> (make)x25->calluserdata.cuddata buffers, which are 128 bytes long.
> However, the length copied is based on the remaining message length,
> and is not limited to the output buffer size. This allows a remote
> attacker to overflow data onto the heap.
>
> There is an appropriate constant defined for the length, but it
> seemingly isn't used there:
> https://github.com/mirrors/linux/blob/master/include/net/x25.h#L104
>
> It seems this issue was noticed some time ago:
> http://www.spinics.net/lists/linux-x25/msg00043.html
> http://patchwork.ozlabs.org/patch/23917/
> ...however nothing was done about the bigger problem.
>
> I have written a simple exploit for this vulnerability if it needs to
> be posted, however I think the problem is pretty straightforward to
> see as-is.
Please send a patch, it seems you have everything done to do it
properly ;)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: x25: remote-triggerable heap overflow in call user data processing
2011-10-03 5:45 ` Eric Dumazet
@ 2011-10-03 6:51 ` Andrew Hendry
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Hendry @ 2011-10-03 6:51 UTC (permalink / raw)
To: Eric Dumazet; +Cc: matt d, netdev
x25_in.c looks straightforward.
with af_x25.c we might want to move the incoming call user data check
before the call accept block above.
Otherwise it could send call accept/call clear right next to each
other and it might get bad state
On Mon, Oct 3, 2011 at 4:45 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le lundi 03 octobre 2011 à 16:23 +1300, matt d a écrit :
>> Refer to the x25 packet layer's handling of incoming call user data,
>> namely at these two locations, in x25_rx_call_request and
>> x25_state1_machine:
>> https://github.com/mirrors/linux/blob/master/net/x25/af_x25.c#L1039
>> https://github.com/mirrors/linux/blob/master/net/x25/x25_in.c#L126
>>
>> Call user data from an incoming message is copied into
>> (make)x25->calluserdata.cuddata buffers, which are 128 bytes long.
>> However, the length copied is based on the remaining message length,
>> and is not limited to the output buffer size. This allows a remote
>> attacker to overflow data onto the heap.
>>
>> There is an appropriate constant defined for the length, but it
>> seemingly isn't used there:
>> https://github.com/mirrors/linux/blob/master/include/net/x25.h#L104
>>
>> It seems this issue was noticed some time ago:
>> http://www.spinics.net/lists/linux-x25/msg00043.html
>> http://patchwork.ozlabs.org/patch/23917/
>> ...however nothing was done about the bigger problem.
>>
>> I have written a simple exploit for this vulnerability if it needs to
>> be posted, however I think the problem is pretty straightforward to
>> see as-is.
>
> Please send a patch, it seems you have everything done to do it
> properly ;)
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-03 6:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-03 3:23 x25: remote-triggerable heap overflow in call user data processing matt d
2011-10-03 5:45 ` Eric Dumazet
2011-10-03 6:51 ` Andrew Hendry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox