[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #56922] Resource Leak in TCP packet handling in grub, trivial patch
From: |
Manfred Härtel |
Subject: |
[bug #56922] Resource Leak in TCP packet handling in grub, trivial patch |
Date: |
Fri, 20 Sep 2019 11:42:23 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 |
URL:
<https://savannah.gnu.org/bugs/?56922>
Summary: Resource Leak in TCP packet handling in grub,
trivial patch
Project: GNU GRUB
Submitted by: mhaertel
Submitted on: Fri 20 Sep 2019 03:42:22 PM UTC
Category: Network
Severity: Major
Priority: 5 - Normal
Item Group: Software Error
Status: None
Privacy: Public
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release:
Release: Git master
Reproducibility: Every Time
Planned Release: None
_______________________________________________________
Details:
I wrote a grub module which uses the TCP communication functions included in
grub for educating myself. :-)
During stress tests I recognized a resource leak. Naturally, I suspected my
program first, but could not find a reason why this would happen.
Then I got the feeling that the problem has something to do with the list of
unacked outgoing packets in grub, it seems as if some of them do not get
unallocated from memory. I also recognized that the unacked queue for a
certain socket never exceeds the size of 2 packets, even if it should
actually.
While looking through the source code of tcp.c, I think I found the problem
and made a trivial patch (attached).
Without my patch, a new packet is inserted in the link list after
socket->unack_last, but socket->unack_last does not change, so when another
unacked packet comes it is prepended to the same packet in the list as before,
so the packet we inserted before is not in the linked list anymore, and so
never gets unallocated.
The patch seems to solve my problem and I did not recognize any side effects.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 20 Sep 2019 03:42:22 PM UTC Name: tcp.c.patch Size: 374B By:
mhaertel
<http://savannah.gnu.org/bugs/download.php?file_id=47553>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?56922>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #56922] Resource Leak in TCP packet handling in grub, trivial patch,
Manfred Härtel <=