Commit 2946f49
committed
local socket: fix accept used after free
==1729315==ERROR: AddressSanitizer: heap-use-after-free on address 0xf0501d60 at pc 0x032ffe43 bp 0xef4ed158 sp 0xef4ed148
READ of size 2 at 0xf0501d60 thread T0
#0 0x32ffe42 in nxsem_wait semaphore/sem_wait.c:94
#1 0x3548cf5 in _net_timedwait utils/net_lock.c:97
#2 0x3548f48 in net_sem_timedwait utils/net_lock.c:236
apache#3 0x3548f8c in net_sem_wait utils/net_lock.c:318
apache#4 0x350124d in local_accept local/local_accept.c:246
apache#5 0x3492719 in psock_accept socket/accept.c:149
apache#6 0x3492bcc in accept4 socket/accept.c:280
apache#7 0x662dc04 in accept net/lib_accept.c:50
apache#8 0x55c81ab in kvdb_loop kvdb/server.c:415
apache#9 0x55c860a in kvdbd_main kvdb/server.c:458
apache#10 0x33d968b in nxtask_startup sched/task_startup.c:70
apache#11 0x32ec039 in nxtask_start task/task_start.c:134
apache#12 0x34109be in pre_start sim/sim_initialstate.c:52
0xf0501d60 is located 288 bytes inside of 420-byte region [0xf0501c40,0xf0501de4)
freed by thread T0 here:
#0 0xf7aa6a3f in __interceptor_free ../../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127
#1 0x73aa06e in host_free sim/posix/sim_hostmemory.c:192
#2 0x34131d6 in mm_free sim/sim_heap.c:230
apache#3 0x3409388 in free umm_heap/umm_free.c:49
apache#4 0x35631f3 in local_free local/local_conn.c:225
apache#5 0x3563f75 in local_release local/local_release.c:129
apache#6 0x34f5a32 in local_close local/local_sockif.c:785
apache#7 0x3496ee8 in psock_close socket/net_close.c:102
apache#8 0x36500bc in sock_file_close socket/socket.c:115
apache#9 0x3635f6c in file_close vfs/fs_close.c:74
apache#10 0x3632439 in nx_close_from_tcb inode/fs_files.c:670
apache#11 0x36324f3 in nx_close inode/fs_files.c:697
apache#12 0x3632557 in close inode/fs_files.c:735
apache#13 0x55be289 in property_set_ kvdb/client.c:210
apache#14 0x55c0309 in property_set_int32_ kvdb/common.c:226
apache#15 0x55c03f5 in property_set_int32_oneway kvdb/common.c:236
Signed-off-by: ligd <[email protected]>1 parent 4f25c28 commit 2946f49
4 files changed
+94
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
226 | 260 | | |
227 | 261 | | |
228 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| |||
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
166 | | - | |
| 168 | + | |
| 169 | + | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| |||
246 | 249 | | |
247 | 250 | | |
248 | 251 | | |
| 252 | + | |
| 253 | + | |
249 | 254 | | |
250 | 255 | | |
251 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
228 | 275 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
141 | | - | |
| 140 | + | |
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
| |||
243 | 242 | | |
244 | 243 | | |
245 | 244 | | |
246 | | - | |
| 245 | + | |
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
| |||
257 | 256 | | |
258 | 257 | | |
259 | 258 | | |
260 | | - | |
| 259 | + | |
261 | 260 | | |
262 | | - | |
263 | | - | |
264 | 261 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
| 262 | + | |
269 | 263 | | |
270 | 264 | | |
271 | 265 | | |
| |||
773 | 767 | | |
774 | 768 | | |
775 | 769 | | |
776 | | - | |
777 | | - | |
778 | 770 | | |
779 | 771 | | |
780 | 772 | | |
781 | 773 | | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
| 774 | + | |
793 | 775 | | |
794 | 776 | | |
795 | 777 | | |
| |||
0 commit comments