diff options
author | JP Abgrall <jpa@google.com> | 2011-09-25 19:24:02 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:39:08 -0800 |
commit | 64d8eb004f4179c4d97cd4f6293d135a32d4cc05 (patch) | |
tree | f8a5f0b9070e84e60b1a746fe3f4cfa2fc886d08 /net/netfilter/xt_qtaguid_print.h | |
parent | d69a23cedf782704f6155c2971e836d9b30a2157 (diff) |
netfilter: xt_qtaguid: fix crash after using delete ctrl command
* Crash fix
The delete command would delete a socket tag entry without removing it
from the proc_qtu_data { ..., sock_tag_list, }.
This in turn would cause an exiting process to crash while cleaning up
its matching proc_qtu_data.
* Added more aggressive tracking/cleanup of proc_qtu_data
This should allow one process to cleanup qtu_tag_data{} left around from
processes that didn't use resource tracking via /dev/xt_qtaguid.
* Debug printing tweaks
Better code inclusion/exclusion handling,
and extra debug out of full state.
Change-Id: I735965af2962ffcd7f3021cdc0068b3ab21245c2
Signed-off-by: JP Abgrall <jpa@google.com>
Diffstat (limited to 'net/netfilter/xt_qtaguid_print.h')
-rw-r--r-- | net/netfilter/xt_qtaguid_print.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/net/netfilter/xt_qtaguid_print.h b/net/netfilter/xt_qtaguid_print.h index 388622860ea0..b63871a0be5a 100644 --- a/net/netfilter/xt_qtaguid_print.h +++ b/net/netfilter/xt_qtaguid_print.h @@ -12,6 +12,8 @@ #include "xt_qtaguid_internal.h" +#ifdef DDEBUG + char *pp_tag_t(tag_t *tag); char *pp_data_counters(struct data_counters *dc, bool showValues); char *pp_tag_node(struct tag_node *tn); @@ -37,6 +39,82 @@ void prdebug_tag_stat_tree(int indent_level, void prdebug_iface_stat_list(int indent_level, struct list_head *iface_stat_list); +#else + +/*------------------------------------------*/ +static inline char *pp_tag_t(tag_t *tag) +{ + return NULL; +} +static inline char *pp_data_counters(struct data_counters *dc, bool showValues) +{ + return NULL; +} +static inline char *pp_tag_node(struct tag_node *tn) +{ + return NULL; +} +static inline char *pp_tag_ref(struct tag_ref *tr) +{ + return NULL; +} +static inline char *pp_tag_stat(struct tag_stat *ts) +{ + return NULL; +} +static inline char *pp_iface_stat(struct iface_stat *is) +{ + return NULL; +} +static inline char *pp_sock_tag(struct sock_tag *st) +{ + return NULL; +} +static inline char *pp_uid_tag_data(struct uid_tag_data *qtd) +{ + return NULL; +} +static inline char *pp_proc_qtu_data(struct proc_qtu_data *pqd) +{ + return NULL; +} + +/*------------------------------------------*/ +static inline +void prdebug_sock_tag_list(int indent_level, + struct list_head *sock_tag_list) +{ +} +static inline +void prdebug_sock_tag_tree(int indent_level, + struct rb_root *sock_tag_tree) +{ +} +static inline +void prdebug_proc_qtu_data_tree(int indent_level, + struct rb_root *proc_qtu_data_tree) +{ +} +static inline +void prdebug_tag_ref_tree(int indent_level, struct rb_root *tag_ref_tree) +{ +} +static inline +void prdebug_uid_tag_data_tree(int indent_level, + struct rb_root *uid_tag_data_tree) +{ +} +static inline +void prdebug_tag_stat_tree(int indent_level, + struct rb_root *tag_stat_tree) +{ +} +static inline +void prdebug_iface_stat_list(int indent_level, + struct list_head *iface_stat_list) +{ +} +#endif /*------------------------------------------*/ const char *netdev_evt_str(int netdev_event); #endif /* ifndef __XT_QTAGUID_PRINT_H__ */ |