Repository navigation
Commit 40ee4df
tracing: Have "enable" file use refcounts like the "filter" file
The "enable" file for the event system can be removed when a module
is unloaded and the event system only has events from that module.
As the event system nr_events count goes to zero, it may be freed
if its ref_count is also set to zero.
Like the "filter" file, the "enable" file may be opened by a task and
referenced later, after a module has been unloaded and the events for
that event system have been removed.
Although the "filter" file referenced the event system structure,
the "enable" file only references a pointer to the event system
name. Since the name is freed when the event system is removed,
it is possible that an access to the "enable" file may reference
a freed pointer.
Update the "enable" file to use the subsystem_open() routine that
the "filter" file uses, to keep a reference to the event system
structure while the "enable" file is opened.
Cc: <stable@kernel.org>
Reported-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>1 parent e9dbfae commit 40ee4df
1 file changed
Lines changed: 22 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
560 | | - | |
| 560 | + | |
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
| |||
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
571 | | - | |
| 571 | + | |
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
601 | | - | |
| 601 | + | |
| 602 | + | |
602 | 603 | | |
603 | 604 | | |
604 | 605 | | |
| |||
622 | 623 | | |
623 | 624 | | |
624 | 625 | | |
625 | | - | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
626 | 634 | | |
627 | 635 | | |
628 | 636 | | |
| |||
862 | 870 | | |
863 | 871 | | |
864 | 872 | | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
865 | 876 | | |
866 | 877 | | |
867 | 878 | | |
| |||
880 | 891 | | |
881 | 892 | | |
882 | 893 | | |
| 894 | + | |
883 | 895 | | |
884 | | - | |
| 896 | + | |
885 | 897 | | |
886 | 898 | | |
887 | 899 | | |
| |||
891 | 903 | | |
892 | 904 | | |
893 | 905 | | |
894 | | - | |
| 906 | + | |
| 907 | + | |
895 | 908 | | |
896 | 909 | | |
897 | 910 | | |
| |||
1041 | 1054 | | |
1042 | 1055 | | |
1043 | 1056 | | |
1044 | | - | |
| 1057 | + | |
1045 | 1058 | | |
1046 | 1059 | | |
1047 | 1060 | | |
| 1061 | + | |
1048 | 1062 | | |
1049 | 1063 | | |
1050 | 1064 | | |
| |||
1133 | 1147 | | |
1134 | 1148 | | |
1135 | 1149 | | |
1136 | | - | |
1137 | | - | |
| 1150 | + | |
1138 | 1151 | | |
1139 | 1152 | | |
1140 | 1153 | | |
| |||
0 commit comments