In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
Inthe Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: #cd /sys/kernel/tracing #echo p:sched schedule >kprobe_events #exec 5>>events/kprobes/sched/enable #>kprobe_events #exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create akprobe event (doesn tmatter what one) 3. Open bash file descriptor 5on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes acrash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present page PGD 0P4D 0Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 +ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates atrace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes awrite to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing ause-after-free bug.To solve this, add aref count to the event file descriptor as well as anew flag called FREED .The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still areference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel:# cd /sys/kernel/tracing# echo p:sched schedule > kprobe_events# exec 5>>events/kprobes/sched/enable#> kprobe_events# exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createa kprobeevent (doesnt matter what one) 3. Open bash file descriptor5 on the enable file of the kprobeevent 4. Delete the kprobeevent (removes the files too) 5. Close the bash file descriptor 5The above causesa crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000)- not-present page PGD0 P4D0 Oops: 0000 [#1] PREEMPT SMP PTI CPU:6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35+ ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains state of theevent (is it enabled for the given instance?).Opening the enable file getsa reference to theevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefssystem which also frees theevent file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with theevent file descriptor that is already freed. If the userdoesa write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causinga use-after-free bug.To solve this, adda ref count to theevent file descriptor as well as anew flag called FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when theevent isremoved to prevent any more modifications to that event from happening,even if there s stilla reference to theevent file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
In the Linux kernel,the following vulnerability hasbeen resolved:tracing: Have trace_event_filehave ref countersThe following can crashthe kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events#exec 5>&-Theabove commands:1. Changedirectory tothe tracefs directory 2.Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on theenable file ofthe kprobe event 4. Delete the kprobe event (removes the files too)5. Close thebash file descriptor 5Theabove causes a crash! BUG: kernel NULL pointer dereference, address:0000000000000028#PF: supervisor read accessin kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Nottainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009),BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here isthatthe kprobeevent createsa trace_event_file file descriptor that represents the file in tracefs to theevent. Itmaintains stateof the event(isit enabled for the given instance?).Opening the enable file gets areference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from thetracefs system whichalso frees theevent file descriptor.But as the tracefs file is still opened byuserspace, it will not betotally removed until the final dput()is calledon it. But this is nottruewith the event file descriptor that is already freed. If the userdoes a write to or simplyclosesthe file descriptor it will reference theevent file descriptor that wasjustfreed, causinga use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flagcalled FREED. The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to preventany more modifications to that event from happening,even if there s still a reference to the event file descriptor.
In the Linux kernel, the following vulnerability has been resolved:tracing: Have trace_event_file have ref countersThe following can crash the kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn t matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50What happens here is that the kprobe event creates a trace_event_file file descriptor that represents the file in tracefs to the event. Itmaintains state of the event (is it enabled for the given instance?).Opening the enable file gets a reference to the event file descriptorvia the open file descriptor. When the kprobe event is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file is still opened by user space, it will not betotally removed until the final dput() is called on it. But this is nottrue with the event file descriptor that is already freed. If the userdoes a write to or simply closes the file descriptor it will reference theevent file descriptor that was just freed, causing a use-after-free bug.To solve this, add a ref count to the event file descriptor as well as anew flag called FREED . The file will not be freed until the lastreference is released. But the FREE flag will be set when the event isremoved to prevent any more modifications to that event from happening,even if there s still a reference to the event file descriptor.
| linux | | https://git.kernel.org/linus/bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
| linux | | https://git.kernel.org/linus/9034c87d61be8cff989017740a91701ac8195a1d | https://git.kernel.org/linus/f5ca233e2e66dc1c249bf07eefa37e34a6c9346a | ubuntu |
</details>
二、漏洞分析结构反馈
影响性分析说明:
IntheLinuxkernel,thefollowingvulnerabilityhasbeenresolved:tracing:Havetrace_event_file have refcountersThe following can crashthe kernel: # cd /sys/kernel/tracing # echo p:sched schedule > kprobe_events # exec5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&-The above commands: 1. Change directory to the tracefs directory 2. Createakprobe event(doesn t matterwhat one)3. Open bashfile descriptor 5 on theenable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5.Close the bashfile descriptor 5The above causes a crash! BUG: kernel NULL pointerdereference,address: 0000000000000028#PF: supervisor read access in kernel mode #PF: error_code(0x0000) -not-present pagePGD 0 P4D 0 Oops: 0000 [#1]PREEMPT SMP PTI CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC(Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50Whathappens here is that the kprobe event creates a trace_event_filefile descriptor that represents thefilein tracefsto the event.Itmaintains state of theevent (is it enabled for the given instance?).Openingthe enable file gets areference totheevent file descriptorvia the open file descriptor. When the kprobeevent is deleted, the file isalso deleted from the tracefs system which also frees the event file descriptor.But as the tracefs file isstill opened by userspace, it willnot betotally removed until the final dput() is called on it. Butthisis nottrue with the event file descriptor that is alreadyfreed. Ifthe userdoes a write to orsimply closes the file descriptor it will reference theevent file descriptor that was justfreed,causing a use-after-free bug.To solve this, adda refcount to the event file descriptor aswell as anew flag called FREED . The file will not be freed until the lastreference is released. Butthe FREE flagwill be setwhen the event isremoved to prevent any more modifications to that event from happening,even if there s still a referenceto the event file descriptor.