On 8/27/15 4:43 PM, Steven Rostedt wrote:
On Thu, 27 Aug 2015 16:20:39 -0700 (PDT)
David Miller wrote:
From: Alexei Starovoitov
Date: Thu, 27 Aug 2015 16:06:14 -0700
Fair or you still think it should be per byte copy?
I'm terribly surprised we don't have an equivalent of strncpy()
for uns
On Thu, 27 Aug 2015 16:20:39 -0700 (PDT)
David Miller wrote:
> From: Alexei Starovoitov
> Date: Thu, 27 Aug 2015 16:06:14 -0700
>
> > Fair or you still think it should be per byte copy?
>
> I'm terribly surprised we don't have an equivalent of strncpy()
> for unsafe kernel pointers.
>
> You p
From: Alexei Starovoitov
Date: Thu, 27 Aug 2015 16:06:14 -0700
> Fair or you still think it should be per byte copy?
I'm terribly surprised we don't have an equivalent of strncpy()
for unsafe kernel pointers.
You probably won't be the last person to want this, and it's silly
to optimize it in o
On 8/27/15 3:34 PM, David Miller wrote:
From: Alexei Starovoitov
Date: Wed, 26 Aug 2015 23:26:59 -0700
+/* similar to strncpy_from_user() but with extra checks */
+static void probe_read_string(char *buf, int size, long unsafe_ptr)
+{
+ char dst[4];
+ int i = 0;
+
+ size--;
+
From: Alexei Starovoitov
Date: Wed, 26 Aug 2015 23:26:59 -0700
> +/* similar to strncpy_from_user() but with extra checks */
> +static void probe_read_string(char *buf, int size, long unsafe_ptr)
> +{
> + char dst[4];
> + int i = 0;
> +
> + size--;
> + for (;;) {
> + i
%s specifier makes bpf program and kernel debugging easier.
To make sure that trace_printk won't crash the unsafe string
is copied into stack and unsafe pointer is substituted.
String is also sanitized for printable characters.
The cost of swapping FS in probe_kernel_read is
amortized over 4 chars
6 matches
Mail list logo