+ rfcomm-corec-avoid-dangling-pointer-check-session-exists.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     rfcomm/core.c: avoid dangling pointer, check session exists
has been added to the -mm tree.  Its filename is
     rfcomm-corec-avoid-dangling-pointer-check-session-exists.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: rfcomm/core.c: avoid dangling pointer, check session exists
From: David Fries <david@xxxxxxxxx>

rfcomm_process_sessions is calling rfcomm_process_rx, but in this case the
session is closed and freed leaving a dangling pointer that blows up when
rfcomm_process_rx returns and rfcomm_process_dlcs is called with the now
dangling session pointer.  Check to see if the entry is still in the list.

Signed-off-by: David Fries <David@xxxxxxxxx>
Cc: Marcel Holtmann <marcel@xxxxxxxxxxxx>
Cc: "Gustavo F. Padovan" <padovan@xxxxxxxxxxxxxx>
Cc: "John W. Linville" <linville@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 net/bluetooth/rfcomm/core.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN net/bluetooth/rfcomm/core.c~rfcomm-corec-avoid-dangling-pointer-check-session-exists net/bluetooth/rfcomm/core.c
--- a/net/bluetooth/rfcomm/core.c~rfcomm-corec-avoid-dangling-pointer-check-session-exists
+++ a/net/bluetooth/rfcomm/core.c
@@ -1955,6 +1955,12 @@ static inline void rfcomm_process_sessio
 
 		default:
 			rfcomm_process_rx(s);
+			/* The current session can be closed as part of rx
+			 * in which case s is now dangling.  Check if it
+			 * has been removed.
+			 */
+			if(n->prev != p)
+				continue;
 			break;
 		}
 
_

Patches currently in -mm which might be from david@xxxxxxxxx are

rfcomm-corec-avoid-dangling-pointer-check-session-exists.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux