Skip to contentSkip to conversation

miscellaneous patches

PATCH In review Kai Kang 3 participants 8 messages Apr 1, 2014 – Apr 2, 2014

lore
Share & tools
lore

Kai Kang

author
#0 lore raw

cover miscellaneous patches

The following changes since commit dee07bee84361eb58cdc0e267b22d71155b89b65:

beaglebone: fix typo in the U-Boot config name (2014-03-31 23:04:36 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib kangkai/misc
http://git.yoctoproject.org/cgit.cgi//log/?h=kangkai/misc

Kai Kang (1):
xorg: Fix for CVE-2013-6424

Li Wang (1):
cmake: follow ptest output format

yanjun.zhu (1):
util-linux-native: Remove SYS_setns system call in linux kernel 2.6.x

 meta/recipes-core/util-linux/util-linux.inc        |   6 ++
 meta/recipes-devtools/cmake/cmake.inc              |   1 +
 .../cmake/cmake/follow_ptest_output_format.patch   | 118 +++++++++++++++++++++
 .../xserver-xorg/xorg-CVE-2013-6424.patch          |  31 ++++++
 .../xorg-xserver/xserver-xorg_1.15.0.bb            |   1 +
 5 files changed, 157 insertions(+)
 create mode 100644 meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
 create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/xorg-CVE-2013-6424.patch
Signature · 1 line
1.8.1.2
author
#1 lore raw

PATCH 1/3 xorg: Fix for CVE-2013-6424

Integer underflow in the xTrapezoidValid macro in render/picture.h in X.Org allows context-dependent attackers to cause a denial of service (crash) via a negative bottom value.

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-6424

---
 .../xserver-xorg/xorg-CVE-2013-6424.patch          | 31 ++++++++++++++++++++++
 .../xorg-xserver/xserver-xorg_1.15.0.bb            |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/xorg-CVE-2013-6424.patch
meta/recipes-graphics/xorg-xserver/xserver-xorg/xorg-CVE-2013-6424.patch new file +31 -0
new file mode 100644
index 0000000..7c61530
@@ -0,0 +1,31 @@
+This patch comes from:
+http://lists.x.org/archives/xorg-devel/2013-October/037996.html
+
+Upstream-Status: Backport
+
+Signed-off-by: Baogen shang <[email protected]>
+diff -Naur xorg-server-1.14.0-orig/exa/exa_render.c xorg-server-1.14.0/exa/exa_render.c
+--- xorg-server-1.14.0-orig/exa/exa_render.c	2014-02-27 14:32:38.000000000 +0800
++++ xorg-server-1.14.0/exa/exa_render.c	2014-02-27 15:46:59.000000000 +0800
+@@ -1141,7 +1141,8 @@
+ 
+         exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
+         for (; ntrap; ntrap--, traps++)
+-            (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1);
++            if (xTrapezoidValid(traps))
++                (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1);
+         exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
+ 
+         xRel = bounds.x1 + xSrc - xDst;
+diff -Naur xorg-server-1.14.0-orig/render/picture.h xorg-server-1.14.0/render/picture.h
+--- xorg-server-1.14.0-orig/render/picture.h	2014-02-27 14:32:26.000000000 +0800
++++ xorg-server-1.14.0/render/picture.h	2014-02-27 15:48:13.000000000 +0800
+@@ -211,7 +211,7 @@
+ /* whether 't' is a well defined not obviously empty trapezoid */
+ #define xTrapezoidValid(t)  ((t)->left.p1.y != (t)->left.p2.y && \
+ 			     (t)->right.p1.y != (t)->right.p2.y && \
+-			     (int) ((t)->bottom - (t)->top) > 0)
++			     ((t)->bottom > (t)->top))
+ 
+ /*
+  * Standard NTSC luminance conversions:
meta/recipes-graphics/xorg-xserver/xserver-xorg_1.15.0.bb +1 -0
index a4dda4e..1f9fa04 100644
@@ -5,6 +5,7 @@ SRC_URI += "file://crosscompile.patch \
             file://fix_open_max_preprocessor_error.patch \
             file://mips64-compiler.patch \
             file://aarch64.patch \
+            file://xorg-CVE-2013-6424.patch \
            "
 
 SRC_URI[md5sum] = "c2ace3697b32414094cf8c597c39d7d9"
Signature · 1 line
1.8.1.2
author
#2 lore raw

PATCH 2/3 cmake: follow ptest output format

In reply to Kai Kang

From: Li Wang <[email protected]>

ptest output format is incorrect, according to yocto Development Manual
(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)

The test generates output in the format used by Automake:
<result>: <testname>
where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.

So we should change the test result format to match yocto ptest rules.

---
 meta/recipes-devtools/cmake/cmake.inc              |   1 +
 .../cmake/cmake/follow_ptest_output_format.patch   | 118 +++++++++++++++++++++
 2 files changed, 119 insertions(+)
 create mode 100644 meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
meta/recipes-devtools/cmake/cmake.inc +1 -0
index 1d5303f..254af45 100644
@@ -17,6 +17,7 @@ SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz
            file://aarch64-kwsys.patch \
            file://qt4-fail-silent.patch \
            file://cmake-2.8.11.2-FindFreetype.patch \
+           file://follow_ptest_output_format.patch \
            "
 
 inherit autotools-brokensep
meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch new file +118 -0

118 lines not on this page · raw message

Signature · 1 line
1.8.1.2
author
#6 lore raw

PATCH 3/3 util-linux-native: Remove SYS_setns system call in linux kernel 2.6.x

In reply to Kai Kang

From: "yanjun.zhu" <[email protected]>

__NR_setns is not defined in linux kernel 2.6.x. To linux kernel 3.0, this variable is defined. It has been shown that no native tools use this syscall, so it is safe to make this substitution

---
 meta/recipes-core/util-linux/util-linux.inc | 6 ++++++
 1 file changed, 6 insertions(+)
meta/recipes-core/util-linux/util-linux.inc +6 -0
index ad7aac7..0f065b4 100644
@@ -112,6 +112,12 @@ RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linu
 SYSTEMD_PACKAGES = "${PN}-uuidd"
 SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.service"
 
+do_compile_prepend_class-native() {
+	if [ `uname -r | grep "2.6."` ]; then
+		sed -i 's:return syscall(SYS_setns:fprintf(stderr,"Kernel does not support setns");\n\treturn 1;\n//return syscall(:g' ${S}/include/namespace.h
+	fi
+}
+
 do_compile () {
 	set -e
 	install ${WORKDIR}/MCONFIG ${S}/MCONFIG
Signature · 1 line
1.8.1.2
#7 lore raw

Re: [PATCH 3/3] util-linux-native: Remove SYS_setns system call in linux kernel 2.6.x

Quoted 6 lines · Kai Kang

From: "yanjun.zhu" <[email protected]>

__NR_setns is not defined in linux kernel 2.6.x. To linux kernel 3.0, this variable is defined. It has been shown that no native tools use this syscall, so it is safe to make this substitution

Quoted 6 lines
---
 meta/recipes-core/util-linux/util-linux.inc | 6 ++++++
 1 file changed, 6 insertions(+)

This is horrible. Firstly "no native tools use this syscall" - how did you check that? I suspect you perhaps mean "no native tools in OE-Core at this time"? How would we know when one is added?

Secondly, this should not be done as a sed, it should be a patch with a description. This means when we upgrade util-linux, it doesn't silently stop working or do something unintended.

Cheers,

Richard

Quoted 20 lines
meta/recipes-core/util-linux/util-linux.inc +6 -0
index ad7aac7..0f065b4 100644
@@ -112,6 +112,12 @@ RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linu
 SYSTEMD_PACKAGES = "${PN}-uuidd"
 SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.service"
 
+do_compile_prepend_class-native() {
+	if [ `uname -r | grep "2.6."` ]; then
+		sed -i 's:return syscall(SYS_setns:fprintf(stderr,"Kernel does not support setns");\n\treturn 1;\n//return syscall(:g' ${S}/include/namespace.h
+	fi
+}
+
 do_compile () {
 	set -e
 	install ${WORKDIR}/MCONFIG ${S}/MCONFIG
Signature · 1 line
1.8.1.2
#3 lore raw

Re: [PATCH 2/3] cmake: follow ptest output format

In reply to Kai Kang
Quoted 39 lines · Kai Kang

From: Li Wang <[email protected]>

ptest output format is incorrect, according to yocto Development Manual
(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)

The test generates output in the format used by Automake:
<result>: <testname>
where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.

So we should change the test result format to match yocto ptest rules.

---
 meta/recipes-devtools/cmake/cmake.inc              |   1 +
 .../cmake/cmake/follow_ptest_output_format.patch   | 118 +++++++++++++++++++++
 2 files changed, 119 insertions(+)
 create mode 100644 meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
meta/recipes-devtools/cmake/cmake.inc +1 -0
index 1d5303f..254af45 100644
@@ -17,6 +17,7 @@ SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz
            file://aarch64-kwsys.patch \
            file://qt4-fail-silent.patch \
            file://cmake-2.8.11.2-FindFreetype.patch \
+           file://follow_ptest_output_format.patch \
            "
 
 inherit autotools-brokensep
meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch new file +1 -0
new file mode 100644
index 0000000..5428df2
@@ -0,0 +1,118 @@
+cmake: follow ptest output format

meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch line 11

Quoted 10 lines
meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch new file +10 -0
+
+ptest output format is incorrect, according to yocto Development Manual
+(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
+5.10.6. Testing Packages With ptest
+The test generates output in the format used by Automake:
+<result>: <testname>
+where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.
+So we should change the test result format to match yocto ptest rules.
+
+Signed-off-by: Li Wang <[email protected]>

No upstream status. Is there any chance of this going upstream? Might we be better off postprocessing the output with a script to put it into the right format?

Cheers,

Richard

Quoted 110 lines
meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch new file +107 -0
+---
+--- a/Source/CTest/cmCTestRunTest.cxx
++++ b/Source/CTest/cmCTestRunTest.cxx
+@@ -145,8 +145,8 @@
+     this->CompressOutput();
+     }
+ 
+-  this->WriteLogOutputTop(completed, total);
+   std::string reason;
++  std::string result;
+   bool passed = true;
+   int res = started ? this->TestProcess->GetProcessStatus()
+                     : cmsysProcess_State_Error;
+@@ -208,57 +208,58 @@
+       || (!success && this->TestProperties->WillFail))
+       {
+       this->TestResult.Status = cmCTestTestHandler::COMPLETED;
+-      cmCTestLog(this->CTest, HANDLER_OUTPUT, "   Passed  " );
++      result = "           ";
+       }
+     else
+       {
+       this->TestResult.Status = cmCTestTestHandler::FAILED;
+-      cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Failed  " << reason );
++      result = "           " + reason;
+       outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
+       }
+     }
+   else if ( res == cmsysProcess_State_Expired )
+     {
+-    cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Timeout ");
++    result = "***Timeout ";
+     this->TestResult.Status = cmCTestTestHandler::TIMEOUT;
+     outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
+     }
+   else if ( res == cmsysProcess_State_Exception )
+     {
+     outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
+-    cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Exception: ");
++    result = "***Exception: ";
+     switch(this->TestProcess->GetExitException())
+       {
+       case cmsysProcess_Exception_Fault:
+-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "SegFault");
++        result += "SegFault";
+         this->TestResult.Status = cmCTestTestHandler::SEGFAULT;
+         break;
+       case cmsysProcess_Exception_Illegal:
+-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Illegal");
++        result += "Illegal";
+         this->TestResult.Status = cmCTestTestHandler::ILLEGAL;
+         break;
+       case cmsysProcess_Exception_Interrupt:
+-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Interrupt");
++        result += "Interrupt";
+         this->TestResult.Status = cmCTestTestHandler::INTERRUPT;
+         break;
+       case cmsysProcess_Exception_Numerical:
+-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Numerical");
++        result += "Numerical";
+         this->TestResult.Status = cmCTestTestHandler::NUMERICAL;
+         break;
+       default:
+-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Other");
++        result += "Other";
+         this->TestResult.Status = cmCTestTestHandler::OTHER_FAULT;
+       }
+     }
+   else //cmsysProcess_State_Error
+     {
+-    cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Not Run ");
++    result = "***Not Run ";
+     }
+ 
+   passed = this->TestResult.Status == cmCTestTestHandler::COMPLETED;
+   char buf[1024];
+   sprintf(buf, "%6.2f sec", this->TestProcess->GetTotalTime());
+-  cmCTestLog(this->CTest, HANDLER_OUTPUT, buf << "\n" );
++  this->WriteLogOutputTop(completed, total);
++  cmCTestLog(this->CTest, HANDLER_OUTPUT, result << buf << "\n" );
+ 
+   if ( outputTestErrorsToConsole )
+     {
+@@ -398,6 +399,7 @@
+ // Starts the execution of a test.  Returns once it has started
+ bool cmCTestRunTest::StartTest(size_t total)
+ {
++  cmCTestLog(this->CTest, HANDLER_OUTPUT, "      ");
+   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(2*getNumWidth(total) + 8)
+     << "Start "
+     << std::setw(getNumWidth(this->TestHandler->GetMaxIndex()))
+@@ -679,6 +681,15 @@
+ 
+ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
+ {
++  if ( this->TestResult.Status == cmCTestTestHandler::COMPLETED )
++    {
++    cmCTestLog(this->CTest, HANDLER_OUTPUT, "PASS: " );
++    }
++  else
++    {
++    cmCTestLog(this->CTest, HANDLER_OUTPUT, "FAIL: " );
++    }
++
+   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total))
+              << completed << "/");
+   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total))
Signature · 1 line
1.8.1.2
#4 lore raw

Re: [PATCH 2/3] cmake: follow ptest output format

Hello,

Quoted 46 lines · Richard Purdie
Quoted 45 lines · Kai Kang

From: Li Wang <[email protected]>

ptest output format is incorrect, according to yocto Development Manual
(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)

The test generates output in the format used by Automake:
<result>: <testname>
where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.

So we should change the test result format to match yocto ptest rules.

---
 meta/recipes-devtools/cmake/cmake.inc              |   1 +
 .../cmake/cmake/follow_ptest_output_format.patch   | 118 +++++++++++++++++++++
 2 files changed, 119 insertions(+)
 create mode 100644 meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
meta/recipes-devtools/cmake/cmake.inc +1 -0
index 1d5303f..254af45 100644
@@ -17,6 +17,7 @@ SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz
            file://aarch64-kwsys.patch \
            file://qt4-fail-silent.patch \
            file://cmake-2.8.11.2-FindFreetype.patch \
+           file://follow_ptest_output_format.patch \
            "
 
 inherit autotools-brokensep
meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch new file +7 -0
new file mode 100644
index 0000000..5428df2
@@ -0,0 +1,118 @@
+cmake: follow ptest output format
+
+ptest output format is incorrect, according to yocto Development Manual
+(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
+5.10.6. Testing Packages With ptest
+The test generates output in the format used by Automake:
+<result>: <testname>
Quoted 8 lines

meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch line 11

Quoted 4 lines
meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch new file +4 -0
+where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.
+So we should change the test result format to match yocto ptest rules.
+
+Signed-off-by: Li Wang <[email protected]>

No upstream status. Is there any chance of this going upstream? Might we be better off postprocessing the output with a script to put it into the right format?

I agree with both remarks. It'd be good to try to get it somehow integrated upstream and for OE-Core interim solution would be better to 'convert' using an external script. This may break external tests tools people may be using as it changes the format without allowing to 'revert' for normal format.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
author
#5 lore raw

Re: [PATCH 2/3] cmake: follow ptest output format

Quoted 57 lines · Otavio Salvador

Hello,

Quoted 45 lines · Richard Purdie
Quoted 44 lines · Kai Kang

From: Li Wang <[email protected]>

ptest output format is incorrect, according to yocto Development Manual
(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)

The test generates output in the format used by Automake:
<result>: <testname>
where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.

So we should change the test result format to match yocto ptest rules.

---
  meta/recipes-devtools/cmake/cmake.inc              |   1 +
  .../cmake/cmake/follow_ptest_output_format.patch   | 118 +++++++++++++++++++++
  2 files changed, 119 insertions(+)

create mode 100644 meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch

meta/recipes-devtools/cmake/cmake.inc +1 -0
index 1d5303f..254af45 100644
@@ -17,6 +17,7 @@ SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz
             file://aarch64-kwsys.patch \
             file://qt4-fail-silent.patch \
             file://cmake-2.8.11.2-FindFreetype.patch \
+           file://follow_ptest_output_format.patch \
             "
 
  inherit autotools-brokensep
meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch new file +6 -0
new file mode 100644
index 0000000..5428df2
@@ -0,0 +1,118 @@
+cmake: follow ptest output format
+
+ptest output format is incorrect, according to yocto Development Manual
+(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
+5.10.6. Testing Packages With ptest
+The test generates output in the format used by Automake:
Quoted 8 lines

meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch line 11

Quoted 5 lines
meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch new file +5 -0
+<result>: <testname>
+where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.
+So we should change the test result format to match yocto ptest rules.
+
+Signed-off-by: Li Wang <[email protected]>

No upstream status. Is there any chance of this going upstream? Might we be better off postprocessing the output with a script to put it into the right format?

Quoted 6 lines

I agree with both remarks. It'd be good to try to get it somehow integrated upstream and for OE-Core interim solution would be better to 'convert' using an external script. This may break external tests tools people may be using as it changes the format without allowing to 'revert' for normal format.

OK. I'll send it upstream and see what's going on.

Signature · 2 lines
Regards,
Neil | Kai Kang