Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1651546
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] net: llc: add lock_sock in llc_ui_bind to avoid a race condition |
| Date | 2017-05-26 20:30 +0200 |
| Message-ID | <tLs9P-UB-3@gated-at.bofh.it> (permalink) |
| References | <tKU8a-4uG-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Lin Zhang <xiaolou4617@gmail.com> Date: Thu, 25 May 2017 14:07:18 +0800 > There is a race condition in llc_ui_bind if two or more processes/threads > try to bind a same socket. > > If more processes/threads bind a same socket success that will lead to > two problems, one is this action is not what we expected, another is > will lead to kernel in unstable status or oops(in my simple test case, > cause llc2.ko can't unload). > > The current code is test SOCK_ZAPPED bit to avoid a process to > bind a same socket twice but that is can't avoid more processes/threads > try to bind a same socket at the same time. > > So, add lock_sock in llc_ui_bind like others, such as llc_ui_connect. > > Signed-off-by: Lin Zhang <xiaolou4617@gmail.com> Applied, thank you.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] net: llc: add lock_sock in llc_ui_bind to avoid a race condition Lin Zhang <xiaolou4617@gmail.com> - 2017-05-25 08:10 +0200 Re: [PATCH] net: llc: add lock_sock in llc_ui_bind to avoid a race condition David Miller <davem@davemloft.net> - 2017-05-26 20:30 +0200
csiph-web