Control: tag -1 + patch ¡Hola! El 2016-06-20 a las 10:58 +0200, Maximiliano Curia escribió:
Package: findutils Version: 4.6.0+git+20160126-3 Severity: critical Justification: breaks unrelated software
The new version of find has a weird behaviour, at least in the arches: armhf armel and mipsel. As simple test:
dir=$(mktemp -d) cd $dir ln -s a b find -type f
Shows ./b while it shouldn't.
Interestingly:$ find -type l find: Duplicate file type 'l' in the argument list to -type
Both examples work fine in amd64.
I haven't followed the code thoroughly, but it seems that the type is using a float to hold a bit mask, maybe this is not so well behaved in all arches.
This breaks dh_md5summs in the mentioned arches, producing a number of ftbfs's, and probably many other things, thus the severity.
With the addition of multiple types in one -type option, the args union of the predicate struct has grown and the new space is not being initialized. (The initialization of args is done as a args.str = NULL, but args.types is a bool types[FTYPE_COUNT]; with count being 8, that's 32 bytes vs 4 that are currently initialized in a 32 bits arch.
Replacing the xmalloc invocation by a xzalloc one "fixes" the issue as it initializes all of the predicate components.
I'm attaching a patch that does this.Sadly, findutils also fails to build from source due this findutils issue, so the build should be done either against an older version of findutils or tweak the PATH so that debhelper uses the recently built find.
P.S. After following the code I noticed that the rate variable wasn't used as a bitmask sorry for the confussion, a comment in the code lead me to think that it was.
-- "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." -- Edsger W. Dijkstra Saludos /\/\ /\ >< `/
Description: Replace xmalloc with xzalloc Author: Maximiliano Curia <m...@debian.org> --- findutils-4.6.0+git+20160517.orig/find/tree.c +++ findutils-4.6.0+git+20160517/find/tree.c @@ -865,7 +865,7 @@ set_new_parent (struct predicate *curr, { struct predicate *new_parent; - new_parent = xmalloc (sizeof (struct predicate)); + new_parent = xzalloc (sizeof (struct predicate)); new_parent->p_type = BI_OP; new_parent->p_prec = high_prec; new_parent->need_stat = false; @@ -1491,12 +1491,12 @@ get_new_pred (const struct parser_table if (predicates == NULL) { predicates = (struct predicate *) - xmalloc (sizeof (struct predicate)); + xzalloc (sizeof (struct predicate)); last_pred = predicates; } else { - new_pred = xmalloc (sizeof (struct predicate)); + new_pred = xzalloc (sizeof (struct predicate)); last_pred->pred_next = new_pred; last_pred = new_pred; }
signature.asc
Description: Digital signature