lwIP - A Lightweight TCP/IP stack - Bugs: bug #19162, lwip_sendto: possible to corrupt...
You are not allowed to post comments on this tracker with your current authentication level.
bug #19162: lwip_sendto: possible to corrupt remote addr/port connection state
Submitter: | Rob Stedman <robstedman1> | ||
Submitted: | Tue 27 Feb 2007 08:34:23 AM UTC | ||
Category: | None | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Fixed |
Privacy: | Public | Assigned to: | fbernon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | None |
Jump to the original submission
Fri 04 May 2007 03:23:21 PM UTC, comment #37: |
Frédéric Bernon <fbernon> |
Fri 04 May 2007 03:04:50 PM UTC, comment #36: To me too. |
Simon Goldschmidt <goldsimon> |
Fri 04 May 2007 02:54:59 PM UTC, comment #35: Looks good to me. |
Jonathan Larmour <jifl> |
Fri 04 May 2007 01:44:03 PM UTC, comment #34: Ok, new patch file merged with Jonathan's patch.
|
Frédéric Bernon <fbernon> |
Fri 04 May 2007 12:49:09 PM UTC, comment #33: Seems ok for me. About names, if no objection, I propose to replace "fromaddr" & "fromport" by "addr" & "port" in netbuf struct.
|
Frédéric Bernon <fbernon> |
Fri 04 May 2007 10:04:48 AM UTC, comment #32: Yes, that's all I was thinking of. It's a small job, but I'm not in a position to test it at the moment, hence me putting it in a task (task #6848).
|
Jonathan Larmour <jifl> |
Fri 04 May 2007 07:27:43 AM UTC, comment #31: Ok, I understand "Shame". But to be clear, do you want something like that :
|
Frédéric Bernon <fbernon> |
Thu 03 May 2007 11:28:49 PM UTC, comment #30: I was advocating netconn_sendto, just for symmetry with sendto, and because the only overhead now would be the function itself and thus only affects people who choose to use it - it doesn't affect anything elsewhere since your patch already provides the underlying support. It's not necessary, no. That's why it's only a "shame".
|
Jonathan Larmour <jifl> |
Thu 03 May 2007 07:37:47 PM UTC, comment #29:
|
Frédéric Bernon <fbernon> |
Thu 03 May 2007 07:00:55 PM UTC, comment #28: I think it's a shame there is not a netconn_sendto(). I also think we should not be afraid to change the names of internal variables. Anyone not using the API deserves what they get, although at the same time, netbuf_fromaddr/fromport could be made macros.
|
Jonathan Larmour <jifl> |
Thu 03 May 2007 06:41:16 PM UTC, comment #27: I don't have change netbuf field's names because it could broke existing code.
|
Frédéric Bernon <fbernon> |
Fri 20 Apr 2007 11:19:51 AM UTC, comment #26: To this general discussion: how do we go on with this? I think this is a big bug regarding thread-safety (and speed).
|
Simon Goldschmidt <goldsimon> |
Thu 12 Apr 2007 09:42:47 PM UTC, comment #25:
|
Frédéric Bernon <fbernon> |
Thu 12 Apr 2007 06:50:32 PM UTC, comment #24:
|
Jonathan Larmour <jifl> |
Thu 12 Apr 2007 01:20:33 PM UTC, comment #23:
|
Frédéric Bernon <fbernon> |
Thu 12 Apr 2007 03:52:18 AM UTC, comment #22:
|
Jonathan Larmour <jifl> |
Thu 12 Apr 2007 03:27:07 AM UTC, comment #21:
|
Frédéric Bernon <fbernon> |
Thu 12 Apr 2007 02:47:33 AM UTC, comment #20: I have some queries about the patch:
|
Jonathan Larmour <jifl> |
Mon 09 Apr 2007 09:20:56 PM UTC, comment #19: New patch file for the whole problem is attached. I'm not at the office this week, so, I can't just build it, but not test it. So, befaore next week, see it like a draft.
|
Frédéric Bernon <fbernon> |
Thu 05 Apr 2007 05:02:03 PM UTC, comment #18: A little patch to avoid a potential error during lwip_sendto (part of comment #12):
|
Frédéric Bernon <fbernon> |
Wed 28 Mar 2007 09:06:27 AM UTC, comment #17: Ok, add new bug report
|
Frédéric Bernon <fbernon> |
Wed 28 Mar 2007 08:48:56 AM UTC, comment #16: For netbuf_ref bug - we really should be discussing this separately. Could you open a new bug report for it? If making this change I'd also like to see the return code changed so that the caller is notified of the error.
|
Kieran Mansley <kieranm> |
Wed 28 Mar 2007 08:16:57 AM UTC, comment #15: For netbuf_ref bug, I propose to commit directly.
|
Frédéric Bernon <fbernon> |
Wed 28 Mar 2007 08:08:37 AM UTC, comment #14: There seems to be a lot of changes being proposed here that have nothing to do with the original bug report. Perhaps I've misunderstood, but if that's the case can we open new bugs/tasks for these issues?
|
Kieran Mansley <kieranm> |
Wed 28 Mar 2007 06:37:19 AM UTC, comment #13: re comment #12:
|
Simon Goldschmidt <goldsimon> |
Tue 27 Mar 2007 08:28:40 PM UTC, comment #12: Some remarks. In netbuf_ref, pbuf_alloc result is not tested.
|
Frédéric Bernon <fbernon> |
Wed 21 Mar 2007 02:07:07 PM UTC, comment #11: Hello,
|
Bryan Schwichtenberg <schwichb> |
Wed 21 Mar 2007 10:30:04 AM UTC, comment #10: Yes. |
Kieran Mansley <kieranm> |
Wed 21 Mar 2007 10:06:59 AM UTC, comment #9: Right, but when you have to send a multiple receivers a same datagram, I don't see what else you can do. I don't want to change something in the core, but "just" in api_msg (yes, it will be in tcpip_thread context, but no more code will be executed...).
|
Frédéric Bernon <fbernon> |
Wed 21 Mar 2007 09:56:52 AM UTC, comment #8: Removing lwip_sendto() is not the only solution, but definitely the easiest!
|
Kieran Mansley <kieranm> |
Wed 21 Mar 2007 09:25:10 AM UTC, comment #7: lwip_sendto()? Uhmm, I don't like lwip_sendto() implementation, but remove would be the only solution? :)
|
Frédéric Bernon <fbernon> |
Wed 21 Mar 2007 08:55:28 AM UTC, comment #6: Hmm, interesting. I think I understand what you're describing. One thing I'm not sure about is why the response from the linux stack results in an ICMP destination unreachable - if the socket is still connected to the address/port used for the send, surely the reply (which I assume is bound for that address/port) will be received correctly?
|
Kieran Mansley <kieranm> |
Tue 20 Mar 2007 08:47:58 PM UTC, comment #5: Some additional clarification. When I say internal lwIP thread I am referring to our receive interrupt which is passing the data back to the lwIP receiver thread. |
Bryan Schwichtenberg <schwichb> |
Tue 20 Mar 2007 08:41:03 PM UTC, comment #4: Hello,
|
Bryan Schwichtenberg <schwichb> |
Tue 20 Mar 2007 08:27:31 PM UTC, comment #3: Hello,
|
Frédéric Bernon <fbernon> |
Tue 20 Mar 2007 08:04:15 PM UTC, comment #2: Hello,
|
Bryan Schwichtenberg <schwichb> |
Tue 27 Feb 2007 08:53:30 AM UTC, comment #1: You're right about the assumption that there's only one calling thread per netconn. That is a deliberate decision to keep things simple, and in most cases will be true. If a resource of any sort is used from two or more threads, it is usually up to the threads to synchronize access to it, and in this respect a netconn is no different.
|
Kieran Mansley <kieranm> |
Tue 27 Feb 2007 08:34:23 AM UTC, original submission:
lwip_sendto appears to work as a series of steps that should be atomic.
|
Rob Stedman <robstedman1> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 16 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-05-04 | fbernon | Status | Works For Me | Fixed | |
Open/Closed | Open | Closed | |||
2007-05-04 | fbernon | Attached File | - | Added lwip_sendto.patch, #12692 | |
2007-05-04 | jifl | Attached File | - | Added lwip.netbuf.macro.patch, #12691 | |
2007-05-03 | fbernon | Attached File | - | Added lwip_sendto.patch, #12683 | |
Status | In Progress | Works For Me | |||
2007-04-09 | fbernon | Attached File | - | Added lwip_sendto.patch, #12448 | |
2007-04-05 | fbernon | Attached File | - | Added lwip_send.patch, #12408 | |
Status | None | In Progress | |||
2007-03-21 | kieranm | Assigned to | kieranm | fbernon | |
2007-03-21 | kieranm | Severity | 1 - Wish | 3 - Normal | |
Item Group | Change Request | Faulty Behaviour | |||
Assigned to | fbernon | kieranm | |||
2007-03-04 | fbernon | Assigned to | None | fbernon | |
2007-02-27 | kieranm | Severity | 3 - Normal | 1 - Wish | |
Item Group | Faulty Behaviour | Change Request |
Powered by Savane 3.13-f8d8.
Corresponding source code
"Like it we have talk in https://savannah.nongnu.org/task/?6683 , need to add some thread-safe features if two threads call the same "socket/netconn" in the same time (in a global way, not only for this problem). "
This more generic problem would have to be continue in another task..