bugGNU GRUB - Bugs: bug #42765, TCP stack frees wrong netbuff,...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #42765: TCP stack frees wrong netbuff, twice (double free)

Submitted by:  Curtis Larsen <fractal13>
Submitted on:  Sun 13 Jul 2014 05:05:28 PM UTC  
 
Category: NetworkSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: Curtis Larsen
Open/Closed: OpenRelease: 
Release: Git masterReproducibility: Every Time
Planned Release: None

Sun 13 Jul 2014 05:05:28 PM UTC, original submission:

Using the http module to download config files, produces memory errors, after the config file is downloaded.

The error was traced to the tcp stack in grub-core/net/tcp.c. The wrong netbuff pointer was being freed in the clean up loop.

Changing the code to free the correct netbuff pointer removes the runtime error.

Here's the git diff output:

diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c
index 2077f55..1d90f1e 100644
--- a/grub-core/net/tcp.c
+++ b/grub-core/net/tcp.c
@@ -918,7 +918,7 @@ grub_net_recv_tcp_packet (struct grub_net_buff *nb,
do_ack = 1;
}
else
- grub_netbuff_free (nb);
+ grub_netbuff_free (nb_top);
}
if (do_ack)
ack (sock);

Thanks for the code!

Curtis Larsen <fractal13>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by fractal13 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup