[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#647248: pu: package rng-tools/2-unofficial-mt.14-1~60squeeze1



On Sat, 05 Nov 2011, Adam D. Barratt wrote:
> On Mon, 2011-10-31 at 23:57 -0200, Henrique de Moraes Holschuh wrote:
> > This is a request for an upload to stable of the rng-tools package.
> > The upload will fix two important bugs in stable: #609289, #630771.
> [...]
> > There's a lot of noise because autogenerated files are removed by the
> > build on the newer packages in unstable.  I can provide a diff with the
> > noise removed if you want.
> 
> Confirming what the diff will look like when rebuilt on stable (as the
> package for upload should be) would be good so, yes, please.

Ok.  The diff previously attached is the result of:

debdiff rng-tools_2-unofficial-mt.13-3.dsc \
   rng-tools_2-unofficial-mt.14-1~60squeeze1.dsc

Therefore, it is the full diff of the proposed upload (built on stable)
against the current stable package.

The noise is there because I screwed up in the 2-unofficial-mt.14
*upstream* tarball, and somehow shipped it without the autoconf output.
The large diff is recording the fact that config.sub/config.guess/
aclocal.m4/configure are missing in the upstream tarball.

That stuff is regenerated in the Debian build anyway, so it doesn't matter
at all for the Debian packages.  I don't think anyone but Debian and
Ubuntu uses this fork of rng-tools, so nobody complained and I did not
notice the problem until very recently.

Here's a diff with the noise removed.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
diff -Nru rng-tools-2-unofficial-mt.13/ChangeLog rng-tools-2-unofficial-mt.14/ChangeLog
--- rng-tools-2-unofficial-mt.13/ChangeLog	2010-05-06 22:25:05.000000000 -0300
+++ rng-tools-2-unofficial-mt.14/ChangeLog	2011-06-18 00:06:56.000000000 -0300
@@ -1,3 +1,7 @@
+Fri Jun 17 2011  Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+	* Work around CPU errata: Nano xstore corrupts memory
+	* Support kernels 3.0 and later
+
 Sun May 02 2010  Henrique de Moraes Holschuh <hmh@hmh.eng.br>
 	* enable LARGE_FILE support, otherwise the VIA Padlock code
 	  won't work, thanks to Janis Hamme <anmeldung37@arcor.de>
diff -Nru rng-tools-2-unofficial-mt.13/configure.ac rng-tools-2-unofficial-mt.14/configure.ac
--- rng-tools-2-unofficial-mt.13/configure.ac	2010-05-06 22:25:05.000000000 -0300
+++ rng-tools-2-unofficial-mt.14/configure.ac	2011-06-18 00:06:56.000000000 -0300
@@ -17,7 +17,7 @@
 dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-AC_INIT([rng-tools], [2-unofficial-mt.13], [rng-tools@packages.debian.org])
+AC_INIT([rng-tools], [2-unofficial-mt.14], [rng-tools@packages.debian.org])
 AC_PREREQ([2.59])
 AC_CONFIG_SRCDIR([rngd.c])
 AC_CANONICAL_HOST
diff -Nru rng-tools-2-unofficial-mt.13/debian/changelog rng-tools-2-unofficial-mt.14/debian/changelog
--- rng-tools-2-unofficial-mt.13/debian/changelog	2010-05-13 23:25:01.000000000 -0300
+++ rng-tools-2-unofficial-mt.14/debian/changelog	2011-09-14 11:18:24.000000000 -0300
@@ -1,3 +1,19 @@
+rng-tools (2-unofficial-mt.14-1~60squeeze1) stable; urgency=low
+
+  * Debian 6.0 (Squeeze) backport to fix important bugs in Debian stable
+    (closes: #609289, #630771)
+    + No changes from 2-unofficial-mt.14-1
+
+ -- Henrique de Moraes Holschuh <hmh@debian.org>  Wed, 14 Sep 2011 11:16:19 -0300
+
+rng-tools (2-unofficial-mt.14-1) unstable; urgency=low
+
+  * New upstream version:
+    + Work around VIA Nano xstore bug (closes: #609289)
+    + Add support for Linux 3.0 (closes: #630771)
+
+ -- Henrique de Moraes Holschuh <hmh@debian.org>  Sat, 18 Jun 2011 00:12:54 -0300
+
 rng-tools (2-unofficial-mt.13-3) unstable; urgency=low
 
   * Re-upload to fix problem caused by a bad i386 chroot on the -2 build
diff -Nru rng-tools-2-unofficial-mt.13/.gitignore rng-tools-2-unofficial-mt.14/.gitignore
--- rng-tools-2-unofficial-mt.13/.gitignore	1969-12-31 21:00:00.000000000 -0300
+++ rng-tools-2-unofficial-mt.14/.gitignore	2011-06-18 00:06:56.000000000 -0300
@@ -0,0 +1,4 @@
+config.sub
+config.guess
+aclocal.m4
+configure
diff -Nru rng-tools-2-unofficial-mt.13/util.c rng-tools-2-unofficial-mt.14/util.c
--- rng-tools-2-unofficial-mt.13/util.c	2010-05-06 22:25:05.000000000 -0300
+++ rng-tools-2-unofficial-mt.14/util.c	2011-06-18 00:06:56.000000000 -0300
@@ -59,15 +59,22 @@
 	long i;
 	char *p, *q;
 
-	if (uname(&buf)) return KERNEL_UNSUPPORTED;
+	if (uname(&buf))
+		return KERNEL_UNSUPPORTED;
+
 	if (!strncmp(buf.sysname, "Linux", 6)) {
 		i = strtol(buf.release, &p, 10); /* Major version */
-		if ((i != 2) || *p != '.') return KERNEL_UNSUPPORTED;
+		if ((i < 2) || *p != '.')
+			return KERNEL_UNSUPPORTED;
+		if (i > 2)
+			return KERNEL_LINUX_26;
 		p++;
 		q = p;
 		i = strtol(p, &q, 10);	/* Minor version */
-		if (p == q || *q != '.' || i < 4) return KERNEL_UNSUPPORTED;
-		if (i < 6) return KERNEL_LINUX_24;
+		if (p == q || *q != '.' || i < 4)
+			return KERNEL_UNSUPPORTED;
+		if (i < 6)
+			return KERNEL_LINUX_24;
 		return KERNEL_LINUX_26;
 	}
 	return KERNEL_UNSUPPORTED;
diff -Nru rng-tools-2-unofficial-mt.13/viapadlock_engine.c rng-tools-2-unofficial-mt.14/viapadlock_engine.c
--- rng-tools-2-unofficial-mt.13/viapadlock_engine.c	2010-05-06 22:25:05.000000000 -0300
+++ rng-tools-2-unofficial-mt.14/viapadlock_engine.c	2011-06-18 00:06:56.000000000 -0300
@@ -475,7 +475,17 @@
  */
 ssize_t viapadlock_rng_read(void* buf, size_t size)
 {
-	static uint64_t xstore_buffer;	/* cannot be in the stack */
+	/*
+	 * Some VIA CPUs can write too much data to the buffer,
+	 * overruning data.  This is an absurdly dangerous bug,
+	 * so better alocate an entire cacheline or two in case
+	 * VIA will screw this up again even worse.
+	 *
+	 * Needs 16-byte alignment, must be static, must be at least
+	 * 16-byte long.
+	 */
+	static uint64_t xstore_buffer[16] __attribute__((aligned (16)));
+
 	size_t bytes_read = 0;
 	uint32_t xstore_divisor, xstore_flags;
 	unsigned int s, i;
@@ -501,7 +511,7 @@
 	while (size > 0) {
 		for (i = 0; i < 2; i++) {
 			/* Use XSTORE to get RNG data and current config */
-			xstore_flags = via_xstore(&xstore_buffer, 
+			xstore_flags = via_xstore(xstore_buffer,
 					xstore_divisor);
 
 			/* Make sure no one messed with the RNG */

Reply to: