Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-16 Thread Chen Gang
On 2013年04月16日 18:38, Chen Gang wrote: > On 2013年04月16日 18:25, Chen Gang wrote: >> On 2013年04月12日 17:42, Chen Gang wrote: >>> On 2013年04月11日 12:10, Chen Gang wrote: On 2013年04月11日 05:19, Eric Paris wrote: > - Original Message - > >>> b. has an new issue for AUDIT_DIR:

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-16 Thread Chen Gang
On 2013年04月16日 18:25, Chen Gang wrote: > On 2013年04月12日 17:42, Chen Gang wrote: >> On 2013年04月11日 12:10, Chen Gang wrote: >>> On 2013年04月11日 05:19, Eric Paris wrote: - Original Message - >> b. has an new issue for AUDIT_DIR: >>after AUDIT_DIR succeed, it will

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-16 Thread Chen Gang
On 2013年04月12日 17:42, Chen Gang wrote: > On 2013年04月11日 12:10, Chen Gang wrote: >> On 2013年04月11日 05:19, Eric Paris wrote: >>> - Original Message - >>> > b. has an new issue for AUDIT_DIR: >after AUDIT_DIR succeed, it will set rule->tree. >next, the other case

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-16 Thread Chen Gang
On 2013年04月12日 17:42, Chen Gang wrote: On 2013年04月11日 12:10, Chen Gang wrote: On 2013年04月11日 05:19, Eric Paris wrote: - Original Message - b. has an new issue for AUDIT_DIR: after AUDIT_DIR succeed, it will set rule-tree. next, the other case fail, then will call

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-16 Thread Chen Gang
On 2013年04月16日 18:25, Chen Gang wrote: On 2013年04月12日 17:42, Chen Gang wrote: On 2013年04月11日 12:10, Chen Gang wrote: On 2013年04月11日 05:19, Eric Paris wrote: - Original Message - b. has an new issue for AUDIT_DIR: after AUDIT_DIR succeed, it will set rule-tree. next,

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-16 Thread Chen Gang
On 2013年04月16日 18:38, Chen Gang wrote: On 2013年04月16日 18:25, Chen Gang wrote: On 2013年04月12日 17:42, Chen Gang wrote: On 2013年04月11日 12:10, Chen Gang wrote: On 2013年04月11日 05:19, Eric Paris wrote: - Original Message - b. has an new issue for AUDIT_DIR: after AUDIT_DIR

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-12 Thread Chen Gang
On 2013年04月11日 12:10, Chen Gang wrote: > On 2013年04月11日 05:19, Eric Paris wrote: >> - Original Message - >> b. has an new issue for AUDIT_DIR: after AUDIT_DIR succeed, it will set rule->tree. next, the other case fail, then will call audit_free_rule.

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-12 Thread Chen Gang
On 2013年04月11日 12:10, Chen Gang wrote: On 2013年04月11日 05:19, Eric Paris wrote: - Original Message - b. has an new issue for AUDIT_DIR: after AUDIT_DIR succeed, it will set rule-tree. next, the other case fail, then will call audit_free_rule. but

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-11 Thread Chen Gang
On 2013年04月11日 22:34, Chen Gang wrote: > On 2013年04月11日 21:40, Eric Paris wrote: >> > can we add it in audit_free_rule ? >> > >> > maybe like this: >> > >> > @@ -75,6 +75,8 @@ static inline void audit_free_rule(struct >> > audit_entry *e) >> > /*

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-11 Thread Chen Gang
On 2013年04月11日 21:40, Eric Paris wrote: >> > can we add it in audit_free_rule ? >> > >> > maybe like this: >> > >> > @@ -75,6 +75,8 @@ static inline void audit_free_rule(struct audit_entry *e) >> >/* some rules don't have associated watches */ >> >if (erule->watch) >> >

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-11 Thread Eric Paris
- Original Message - > On 2013年04月11日 05:19, Eric Paris wrote: > > - Original Message - > > > >> > b. has an new issue for AUDIT_DIR: > >> >after AUDIT_DIR succeed, it will set rule->tree. > >> >next, the other case fail, then will call audit_free_rule. > >> >

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-11 Thread Eric Paris
- Original Message - On 2013年04月11日 05:19, Eric Paris wrote: - Original Message - b. has an new issue for AUDIT_DIR: after AUDIT_DIR succeed, it will set rule-tree. next, the other case fail, then will call audit_free_rule. but

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-11 Thread Chen Gang
On 2013年04月11日 21:40, Eric Paris wrote: can we add it in audit_free_rule ? maybe like this: @@ -75,6 +75,8 @@ static inline void audit_free_rule(struct audit_entry *e) /* some rules don't have associated watches */ if (erule-watch)

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-11 Thread Chen Gang
On 2013年04月11日 22:34, Chen Gang wrote: On 2013年04月11日 21:40, Eric Paris wrote: can we add it in audit_free_rule ? maybe like this: @@ -75,6 +75,8 @@ static inline void audit_free_rule(struct audit_entry *e) /* some rules don't have associated watches */

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
On 2013年04月11日 05:19, Eric Paris wrote: > - Original Message - > >> > b. has an new issue for AUDIT_DIR: >> >after AUDIT_DIR succeed, it will set rule->tree. >> >next, the other case fail, then will call audit_free_rule. >> >but audit_free_rule will not free

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
On 2013年04月11日 04:08, Eric Paris wrote: > We only allow one filter key per rule. So we should never be able to get > into this situation. See audit_data_to_entry() really it is, thanks. :-) -- Chen Gang Asianux Corporation -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
On 2013年04月11日 04:29, Eric Paris wrote: > - Original Message - >> > >> > >> > in another function: audit_data_to_entry: >> > >> > a. has the same issue for case AUDIT_WATCH. > You are saying if there were 2 of them it will leak the old one? No. If you > have 2 AUDIT_WATCH entries

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
On 2013年04月11日 05:32, Eric Paris wrote: > - Original Message - >> > >> > also for function audit_list: >> > when call audit_make_reply fails (will return NULL). >> > we need free all its related variables instead of only kfree rull. >> > (such as call autit_free_rule) >> >

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
On 2013年04月11日 05:38, Eric Paris wrote: > - Original Message - >> > >> > also for function audit_list_rules: >> > when call audit_make_reply fails (will return NULL). >> > we also need process data->buf, not only data itself. >> > >> > please help check, thanks. > struct

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Eric Paris
- Original Message - > > also for function audit_list_rules: > when call audit_make_reply fails (will return NULL). > we also need process data->buf, not only data itself. > > please help check, thanks. struct audit_rule_data { [...] charbuf[0]; /* string

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Eric Paris
- Original Message - > > also for function audit_list: > when call audit_make_reply fails (will return NULL). > we need free all its related variables instead of only kfree rull. > (such as call autit_free_rule) > > please help check, thanks. audit_free_rule() takes a

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Eric Paris
- Original Message - > b. has an new issue for AUDIT_DIR: >after AUDIT_DIR succeed, it will set rule->tree. >next, the other case fail, then will call audit_free_rule. >but audit_free_rule will not free rule->tree. Definitely a couple of leaks here... I'm

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Eric Paris
- Original Message - > > > in another function: audit_data_to_entry: > > a. has the same issue for case AUDIT_WATCH. You are saying if there were 2 of them it will leak the old one? No. If you have 2 AUDIT_WATCH entries the first one will set entry->rule->watch and the second

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Eric Paris
We only allow one filter key per rule. So we should never be able to get into this situation. See audit_data_to_entry() -Eric - Original Message - > > in the 'fcount' looping, > if 'new->fields[*].type" has 2 or more AUDIT_FILTERKEYs > need judge new->filterkey whether has

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
also for function audit_list_rules: when call audit_make_reply fails (will return NULL). we also need process data->buf, not only data itself. please help check, thanks. :-) gchen. On 2013年04月10日 18:28, Chen Gang wrote: > > also for function audit_list: > when call

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
also for function audit_list: when call audit_make_reply fails (will return NULL). we need free all its related variables instead of only kfree rull. (such as call autit_free_rule) please help check, thanks. :-) gchen. On 2013年04月10日 18:18, Chen Gang wrote: > > > in

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
in another function: audit_data_to_entry: a. has the same issue for case AUDIT_WATCH. b. has an new issue for AUDIT_DIR: after AUDIT_DIR succeed, it will set rule->tree. next, the other case fail, then will call audit_free_rule. but audit_free_rule will not free

[PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
in the 'fcount' looping, if 'new->fields[*].type" has 2 or more AUDIT_FILTERKEYs need judge new->filterkey whether has value, or memory leak. Signed-off-by: Chen Gang --- kernel/auditfilter.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git

[PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
in the 'fcount' looping, if 'new-fields[*].type has 2 or more AUDIT_FILTERKEYs need judge new-filterkey whether has value, or memory leak. Signed-off-by: Chen Gang gang.c...@asianux.com --- kernel/auditfilter.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
in another function: audit_data_to_entry: a. has the same issue for case AUDIT_WATCH. b. has an new issue for AUDIT_DIR: after AUDIT_DIR succeed, it will set rule-tree. next, the other case fail, then will call audit_free_rule. but audit_free_rule will not free

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
also for function audit_list: when call audit_make_reply fails (will return NULL). we need free all its related variables instead of only kfree rull. (such as call autit_free_rule) please help check, thanks. :-) gchen. On 2013年04月10日 18:18, Chen Gang wrote: in another

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
also for function audit_list_rules: when call audit_make_reply fails (will return NULL). we also need process data-buf, not only data itself. please help check, thanks. :-) gchen. On 2013年04月10日 18:28, Chen Gang wrote: also for function audit_list: when call

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Eric Paris
We only allow one filter key per rule. So we should never be able to get into this situation. See audit_data_to_entry() -Eric - Original Message - in the 'fcount' looping, if 'new-fields[*].type has 2 or more AUDIT_FILTERKEYs need judge new-filterkey whether has value,

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Eric Paris
- Original Message - in another function: audit_data_to_entry: a. has the same issue for case AUDIT_WATCH. You are saying if there were 2 of them it will leak the old one? No. If you have 2 AUDIT_WATCH entries the first one will set entry-rule-watch and the second will bomb

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Eric Paris
- Original Message - b. has an new issue for AUDIT_DIR: after AUDIT_DIR succeed, it will set rule-tree. next, the other case fail, then will call audit_free_rule. but audit_free_rule will not free rule-tree. Definitely a couple of leaks here... I'm seeing

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Eric Paris
- Original Message - also for function audit_list: when call audit_make_reply fails (will return NULL). we need free all its related variables instead of only kfree rull. (such as call autit_free_rule) please help check, thanks. audit_free_rule() takes a struct

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Eric Paris
- Original Message - also for function audit_list_rules: when call audit_make_reply fails (will return NULL). we also need process data-buf, not only data itself. please help check, thanks. struct audit_rule_data { [...] charbuf[0]; /* string fields

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
On 2013年04月11日 05:38, Eric Paris wrote: - Original Message - also for function audit_list_rules: when call audit_make_reply fails (will return NULL). we also need process data-buf, not only data itself. please help check, thanks. struct audit_rule_data { [...]

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
On 2013年04月11日 05:32, Eric Paris wrote: - Original Message - also for function audit_list: when call audit_make_reply fails (will return NULL). we need free all its related variables instead of only kfree rull. (such as call autit_free_rule) please help

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
On 2013年04月11日 04:29, Eric Paris wrote: - Original Message - in another function: audit_data_to_entry: a. has the same issue for case AUDIT_WATCH. You are saying if there were 2 of them it will leak the old one? No. If you have 2 AUDIT_WATCH entries the first one will

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
On 2013年04月11日 04:08, Eric Paris wrote: We only allow one filter key per rule. So we should never be able to get into this situation. See audit_data_to_entry() really it is, thanks. :-) -- Chen Gang Asianux Corporation -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH] kernel: auditfilter: looping issue, memory leak if has 2 or more AUDIT_FILTERKEYs

2013-04-10 Thread Chen Gang
On 2013年04月11日 05:19, Eric Paris wrote: - Original Message - b. has an new issue for AUDIT_DIR: after AUDIT_DIR succeed, it will set rule-tree. next, the other case fail, then will call audit_free_rule. but audit_free_rule will not free rule-tree.