[PATCH 1/7] tracing/filters: NUL-terminate user input filter

[PATCH 1/7] tracing/filters: NUL-terminate user input filter

Post by Li Zefa » Sun, 12 Apr 2009 17:00:17


Make sure messages from user space are NUL-terminated strings,
otherwise we could dump random memory while reading filter file.

Try this:
# echo 'parent_comm ==' > events/sched/sched_process_fork/filter
# cat events/sched/sched_process_fork/filter
parent_comm ==
Signed-off-by: Li Zefan<< XXXX@XXXXX.COM >>
---
kernel/trace/trace_events.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 64ec4d2..054bc18 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -503,6 +503,7 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,

if (copy_from_user(&buf, ubuf, cnt))
return -EFAULT;
+ buf[cnt] = '\0';

pred = kzalloc(sizeof(*pred), GFP_KERNEL);
if (!pred)
@@ -569,6 +570,7 @@ subsystem_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,

if (copy_from_user(&buf, ubuf, cnt))
return -EFAULT;
+ buf[cnt] = '\0';

pred = kzalloc(sizeof(*pred), GFP_KERNEL);
if (!pred)
--
1.5.4.rc3

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

1. Filter design | Input+Output are known; how to reconstruct filter?

2. Transform filter with different input & output media types (crop filter, Delphi)?

(Delphi)
http://www.yqcomputer.com/
http://www.yqcomputer.com/
http://www.yqcomputer.com/

I have been trying to create CropFilter in Delphi. So far I managed to
create filter fine but without cropping.

I want to crop right+bottom side of the original video. Zip has example
256x256 video and I want to output it as 246x246 RGB32 video. Pixels are
manipulated along the cropping. Example now draws a opaque gradient colors.

GetMediaType call should return media type of output pin. I copy input
pin format and then change width,height,lSampleSize,biSizeImage attributes.

DecideBufferSize instructs to use a new cropped size for buffers.

Its like .avi videofile or DX resets everything and force pipeline to
use input pin filter.

Problems:
* Input media type and output media type are always identicals even if I
put 10 pixels crop.

Any (delphi) specilists here can help?

3. Use input box to make filter choice while providing list of possible filter choices

4. Filters *SOS* Filters *SOS* Filters *SOS*

5. Can one add new filter graph to filter graph manager while other filter graph is running?

6. fk-filter, velocity filter, frequency-wavenumber filter

7. Outlook 2003 Junk filter not filtering SPAM, filtering items from

8. Filter for WordML vs Filter for XML vs Filter for Text

9. Subform Filter by Form not filtering when using Access built int Filter by Form

10. Acc97 Advanced Filter - Capturing the Filter for report Filter

11. transition from frequency filter (LPF etc.) to noise filter (Kalman filter)

12. FreeBSD Firewall Questions: (Regular) Packet Filtering vs. Stateful Packet Filtering vs. Dynamic Proxy Packet Filtering

13. Junk Filter is filtering out a sender that I MUST NOT filter o

14. FreeBSD Firewall Questions: (Regular) Packet Filtering vs. Stateful Packet Filtering vs. Dynamic Proxy Packet Filtering

15. Filter Filter Filter