[PATCH v9 03/15] Introduce new filtering architecture

Dmitry V. Levin ldv at altlinux.org
Fri Aug 25 10:40:36 UTC 2017


On Fri, Aug 25, 2017 at 01:08:32PM +0700, Nikolay Marchuk wrote:
> On 25.08.2017 07:41, Dmitry V. Levin wrote:
> > On Thu, Aug 24, 2017 at 06:19:41PM +0700, Nikolay Marchuk wrote:
> >> This change introduces new filtering architecture primitives: filter,
> >> filter_action and bool_expression. Filtering is now done after decoding of
> >> syscall and tcp->qual_flg stores filtering results.
> > This change is still to big to review.  Here are just two issues:
> >
> > [...]
> >> +void
> >> +apply_trace(struct tcb *tcp, void *_priv_data)
> > Please do not introduce identifiers with names starting with underscore.
> >
> > [...]
> >> --- a/strace.c
> >> +++ b/strace.c
> >> @@ -771,7 +771,8 @@ droptcb(struct tcb *tcp)
> >>  
> >>  	int p;
> >>  	for (p = 0; p < SUPPORTED_PERSONALITIES; ++p)
> >> -		free(tcp->inject_vec[p]);
> >> +		if (tcp->inject_vec[p])
> >> +			free(tcp->inject_vec[p]);
> >>  
> >>  	free_tcb_priv_data(tcp);
> >>  
> > What is this?
> tcp->inject_vec for a specific personality is initialized only if syscall from this personality was injected,
> so inject_vec should be checked before freeing.

Why do you need to check this pointer before passing it to free(3)?


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170825/bbcaf638/attachment.bin>


More information about the Strace-devel mailing list