aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorSakari Ailus <[email protected]>2018-09-11 09:32:37 +0000
committerMauro Carvalho Chehab <[email protected]>2018-10-03 10:32:51 +0000
commitad608fbcf166fec809e402d548761768f602702c (patch)
tree7c0b71ffee7dfb6a03ba25afb532c7af732eaa4e /net/ipv4/tcp_input.c
parentmedia: platform: fix cros-ec-cec build error (diff)
downloadkernel-ad608fbcf166fec809e402d548761768f602702c.tar.gz
kernel-ad608fbcf166fec809e402d548761768f602702c.zip
media: v4l: event: Prevent freeing event subscriptions while accessed
The event subscriptions are added to the subscribed event list while holding a spinlock, but that lock is subsequently released while still accessing the subscription object. This makes it possible to unsubscribe the event --- and freeing the subscription object's memory --- while the subscription object is simultaneously accessed. Prevent this by adding a mutex to serialise the event subscription and unsubscription. This also gives a guarantee to the callback ops that the add op has returned before the del op is called. This change also results in making the elems field less special: subscriptions are only added to the event list once they are fully initialised. Signed-off-by: Sakari Ailus <[email protected]> Reviewed-by: Hans Verkuil <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Cc: [email protected] # for 4.14 and up Fixes: c3b5b0241f62 ("V4L/DVB: V4L: Events: Add backend") Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_input.c')
0 files changed, 0 insertions, 0 deletions