Commit 9af4058
tracing/filters: Fix error-handling of cpulist parsing buffer
parse_pred() allocates a string buffer to parse the user-provided cpulist,
but doesn't check the allocation result nor does it free the buffer once it
is no longer needed.
Add an allocation check, and free the buffer as soon as it is no longer
needed.
Link: https://lkml.kernel.org/r/20230901151039.125186-2-vschneid@redhat.com
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Reported-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent 3d07fa1 commit 9af4058
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1744 | 1744 | | |
1745 | 1745 | | |
1746 | 1746 | | |
1747 | | - | |
| 1747 | + | |
| 1748 | + | |
1748 | 1749 | | |
| 1750 | + | |
1749 | 1751 | | |
1750 | | - | |
| 1752 | + | |
| 1753 | + | |
1751 | 1754 | | |
| 1755 | + | |
1752 | 1756 | | |
1753 | 1757 | | |
1754 | 1758 | | |
| 1759 | + | |
1755 | 1760 | | |
1756 | 1761 | | |
1757 | 1762 | | |
| 1763 | + | |
1758 | 1764 | | |
1759 | 1765 | | |
1760 | 1766 | | |
| |||
0 commit comments