Skip to content

RFC copy_strtok_from_user

Steven Rostedt lkml 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 RFC Latest6 patches 0 repliesNew
  2. v2 RFC5 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- created strtok_r for kernel.

- Simplified copy_strtok_from_user by using strtok_r

- updated the rest of the code to handle the above changes

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6uaccess: move probe_kernel_* functions to lib/uaccess.clib/Makefile lib/uaccess.c mm/Makefile +1 more+58 -570 replies
2/6string: add strtok_r to kernelinclude/linux/string.h lib/string.c+46 -00 replies
3/6uaccess: add copy_strtok_from_userinclude/linux/uaccess.h lib/uaccess.c+155 -10 replies
4/6tracing: convert event_trace to use copy_strtok_from_userkernel/trace/trace.h kernel/trace/trace_events.c+27 -440 replies
5/6tracing: convert ftrace_regex_write to use copy_strtok_from_userkernel/trace/ftrace.c+60 -410 replies
6/6tracing: convert ftrace_graph_write to use copy_strtok_from_userkernel/trace/ftrace.c+16 -320 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/6] [RFC] copy_strtok_from_user

Changes in v3:

- created strtok_r for kernel.

- Simplified copy_strtok_from_user by using strtok_r

- updated the rest of the code to handle the above changes

I tested both the strtok_r and copy_strtok_from_user with this user app:

http://www.kernel.org/pub/linux/kernel/people/rostedt/copy_strtok_from_user.c

Results of the test are here:

http://www.kernel.org/pub/linux/kernel/people/rostedt/copy_strtok_test.txt

I added a "#undef strtok_r" after the strtok_r function and ran it again to make sure the output was still the same, and it was.

Andrew, If this version is fine with you, could you ack the patches that create the strtok_r and copy_strtok_from_user functions.

Thanks,

-- Steve

The following patches are in:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git

branch: tip/tracing/uaccess

Steven Rostedt (6):
uaccess: move probe_kernel_* functions to lib/uaccess.c
string: add strtok_r to kernel
uaccess: add copy_strtok_from_user
tracing: convert event_trace to use copy_strtok_from_user
tracing: convert ftrace_regex_write to use copy_strtok_from_user
tracing: convert ftrace_graph_write to use copy_strtok_from_user

----

 include/linux/string.h      |    3 +
 include/linux/uaccess.h     |    4 +
 kernel/trace/ftrace.c       |  149 ++++++++++++++++---------------
 kernel/trace/trace.h        |    2 +
 kernel/trace/trace_events.c |   69 +++++---------
 lib/Makefile                |    3 +-
 lib/string.c                |   43 +++++++++
 lib/uaccess.c               |  205 +++++++++++++++++++++++++++++++++++++++++++
 mm/Makefile                 |    2 +-
 mm/maccess.c                |   55 ------------
 10 files changed, 361 insertions(+), 174 deletions(-)