lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160306220841.GA27960@birch.djwong.org>
Date:	Sun, 6 Mar 2016 14:08:41 -0800
From:	"Darrick J. Wong" <darrick.wong@...cle.com>
To:	"Theodore Ts'o" <tytso@....edu>
Cc:	linux-ext4@...r.kernel.org, Darren Hart <dvhart@...ux.intel.com>,
	Richard Purdie <richard.purdie@...uxfoundation.org>
Subject: Re: [PATCH 9/9] libext2fs: sort keys for xattr blocks

On Sat, Mar 05, 2016 at 10:55:14PM -0500, Theodore Ts'o wrote:
> On Sat, Feb 13, 2016 at 02:38:24PM -0800, Darrick J. Wong wrote:
> > Richard Purdie reports that libext2fs doesn't sort attribute keys in
> > the xattr block correctly, causing the kernel to return -ENODATA when
> > querying attributes that should be there.  Therefore, sort attributes
> > so that whatever ends up in the xattr block is sorted according to
> > what the kernel expects.
> > 
> > Cc: Darren Hart <dvhart@...ux.intel.com>
> > Reported-by: Richard Purdie <richard.purdie@...uxfoundation.org>
> > Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>
> 
> Applied, with one minor change.  You should never use something like
> /tmp/b in a test script becuase it's possible that /tmp/b might
> already exist, and might be not even owned by the user.  (In my case
> /tmp/b was a root owned file that was sufficiently big that it it
> caused ea_set command to fail with a "out of space" error.)
> 
> If /tmp/b was writable by the user and was something previous, then
> the developer might get after the test script executes "rm -rf /tmp/b".

Oops, my bad.  Thank you for fixing this. :)

--D

> 
> 						- Ted
> 
> diff --git a/tests/d_xattr_sorting/script b/tests/d_xattr_sorting/script
> index 30c189a..30187f1 100644
> --- a/tests/d_xattr_sorting/script
> +++ b/tests/d_xattr_sorting/script
> @@ -17,16 +17,18 @@ $MKE2FS -Fq $TMPFILE 512 > /dev/null 2>&1
>  status=$?
>  echo Exit status is $status >> $OUT
>  
> -perl -e 'print "x" x 256;' > /tmp/b
> +B=$(mktemp ${TMPDIR:-/tmp}/b.XXXXXX)
> +
> +perl -e 'print "x" x 256;' > $B
>  
>  echo "ea_set / security.SMEG64 -f /tmp/b" > $OUT.new
> -$DEBUGFS -w -R "ea_set / security.SMEG64 -f /tmp/b" $TMPFILE >> $OUT.new 2>&1
> +$DEBUGFS -w -R "ea_set / security.SMEG64 -f $B" $TMPFILE >> $OUT.new 2>&1
>  status=$?
>  echo Exit status is $status >> $OUT.new
>  sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
>  
>  echo "ea_set / security.imb -f /tmp/b" > $OUT.new
> -$DEBUGFS -w -R "ea_set / security.imb -f /tmp/b" $TMPFILE >> $OUT.new 2>&1
> +$DEBUGFS -w -R "ea_set / security.imb -f $B" $TMPFILE >> $OUT.new 2>&1
>  status=$?
>  echo Exit status is $status >> $OUT.new
>  sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
> @@ -37,7 +39,8 @@ status=$?
>  echo Exit status is $status >> $OUT.new
>  sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
>  
> -rm -rf /tmp/b
> +rm -f $B
> +unset B
>  
>  echo "ea_list /" > $OUT.new
>  $DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ