[OE-Core][kirkstone][PATCH] systemd: Fix vlan qos mapping

2024-04-16 Thread sana kazi
Drop unnecessary restriction for QoS mapping.
Also adds tests for vlan QoS mapping.

Link: 
https://github.com/systemd/systemd/commit/fe830b84d4002582e7aefb16e5e09fd0195f21c8.patch
PR: https://github.com/systemd/systemd/pull/27761

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 .../systemd/fix-vlan-qos-mapping.patch| 140 ++
 meta/recipes-core/systemd/systemd_250.5.bb|   1 +
 2 files changed, 141 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/fix-vlan-qos-mapping.patch

diff --git a/meta/recipes-core/systemd/systemd/fix-vlan-qos-mapping.patch 
b/meta/recipes-core/systemd/systemd/fix-vlan-qos-mapping.patch
new file mode 100644
index 00..c530de7f50
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/fix-vlan-qos-mapping.patch
@@ -0,0 +1,140 @@
+From 4d13d175f8454df63843a880c78badd4f6d720ca Mon Sep 17 00:00:00 2001
+From: Yu Watanabe 
+Date: Wed, 24 May 2023 11:02:36 +0900
+Subject: [PATCH 1/3] network/vlan: drop unnecessary restriction for QoS
+ mapping
+
+Fixes #27460.
+
+Upstream-Status: Backport 
[https://github.com/systemd/systemd/commit/fe830b84d4002582e7aefb16e5e09fd0195f21c8.patch]
+Signed-off-by: Sana Kazi 
+---
+ src/network/netdev/vlan.c | 5 -
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/network/netdev/vlan.c b/src/network/netdev/vlan.c
+index a3d961dac3ca4..d61e9486abc47 100644
+--- a/src/network/netdev/vlan.c
 b/src/network/netdev/vlan.c
+@@ -165,11 +165,6 @@ int config_parse_vlan_qos_maps(
+ continue;
+ }
+ 
+-if (m->to > m->from || m->to == 0 || m->from == 0) {
+-log_syntax(unit, LOG_WARNING, filename, line, 0, 
"Invalid %s, ignoring: %s", lvalue, w);
+-continue;
+-}
+-
+ r = set_ensure_consume(s, _qos_maps_hash_ops, 
TAKE_PTR(m));
+ if (r < 0) {
+ log_syntax(unit, LOG_WARNING, filename, line, r, 
"Failed to store %s, ignoring: %s", lvalue, w);
+
+From 4194478af861f80a73905d1f9e570a09862f91a7 Mon Sep 17 00:00:00 2001
+From: Yu Watanabe 
+Date: Wed, 24 May 2023 11:06:35 +0900
+Subject: [PATCH 2/3] network/vlan: paranoia about type safety
+
+No functional change, as the struct is defined as the following:
+```
+struct ifla_vlan_qos_mapping {
+  __u32 from;
+  __u32 to;
+};
+```
+---
+ src/network/netdev/vlan.c | 16 +++-
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/network/netdev/vlan.c b/src/network/netdev/vlan.c
+index d61e9486abc47..5eb36ef6801f3 100644
+--- a/src/network/netdev/vlan.c
 b/src/network/netdev/vlan.c
+@@ -144,6 +144,7 @@ int config_parse_vlan_qos_maps(
+ for (const char *p = rvalue;;) {
+ _cleanup_free_ struct ifla_vlan_qos_mapping *m = NULL;
+ _cleanup_free_ char *w = NULL;
++unsigned from, to;
+ 
+ r = extract_first_word(, , NULL, 
EXTRACT_CUNESCAPE|EXTRACT_UNQUOTE);
+ if (r == -ENOMEM)
+@@ -155,16 +156,21 @@ int config_parse_vlan_qos_maps(
+ if (r == 0)
+ return 0;
+ 
+-m = new0(struct ifla_vlan_qos_mapping, 1);
+-if (!m)
+-return log_oom();
+-
+-r = parse_range(w, >from, >to);
++r = parse_range(w, , );
+ if (r < 0) {
+ log_syntax(unit, LOG_WARNING, filename, line, r, 
"Failed to parse %s, ignoring: %s", lvalue, w);
+ continue;
+ }
+ 
++m = new(struct ifla_vlan_qos_mapping, 1);
++if (!m)
++return log_oom();
++
++*m = (struct ifla_vlan_qos_mapping) {
++.from = from,
++.to = to,
++};
++
+ r = set_ensure_consume(s, _qos_maps_hash_ops, 
TAKE_PTR(m));
+ if (r < 0) {
+ log_syntax(unit, LOG_WARNING, filename, line, r, 
"Failed to store %s, ignoring: %s", lvalue, w);
+
+From 73d24e45f8ac18eaaebf1df2b1f055c14179c6ff Mon Sep 17 00:00:00 2001
+From: Yu Watanabe 
+Date: Wed, 24 May 2023 11:15:44 +0900
+Subject: [PATCH 3/3] test-network: add tests for vlan QoS mapping
+
+---
+ .../conf/21-vlan.netdev.d/override.conf| 10 ++
+ test/test-network/systemd-networkd-tests.py| 14 --
+ 2 files changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/test/test-network/conf/21-vlan.netdev.d/override.conf 
b/test/test-network/conf/21-vlan.netdev.d/override.conf
+index 3b8d47d9b1db5..c71077d274a69 100644
+--- a/test/test-network/conf/21-vlan.netdev.d/override.conf
 b/test/test-network/conf/21-vlan.netdev.d/override.conf
+@@ -3,7 +3,9 @@ MTUBytes=2000
+ 
+ [VLAN]
+ Id=99
+-GVRP=true
+-MVRP=true
+-LooseBind

[OE-Core][kirkstone][PATCH] openssh: Add CVE-2023-51767 to CVE_CHECK_IGNORE

2024-04-03 Thread sana kazi
From: Sana Kazi 

Add CVE-2023-51767 to CVE_CHECK_IGNORE to avoid in cve-check reports
as upstream does not consider CVE-2023-51767 a bug underlying in
OpenSSH and does not intent to address it in OpenSSH.

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 meta/recipes-connectivity/openssh/openssh_8.9p1.bb | 5 +
 1 file changed, 5 insertions(+)

diff --git a/meta/recipes-connectivity/openssh/openssh_8.9p1.bb 
b/meta/recipes-connectivity/openssh/openssh_8.9p1.bb
index bc8e2d81b8..6411a64eff 100644
--- a/meta/recipes-connectivity/openssh/openssh_8.9p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_8.9p1.bb
@@ -49,6 +49,11 @@ CVE_CHECK_IGNORE += "CVE-2014-9278"
 # CVE only applies to some distributed RHEL binaries
 CVE_CHECK_IGNORE += "CVE-2008-3844"
 
+# Upstream does not consider CVE-2023-51767 a bug underlying in OpenSSH and
+# does not intent to address it in OpenSSH
+# https://security-tracker.debian.org/tracker/CVE-2023-51767
+CVE_CHECK_IGNORE += "CVE-2023-51767"
+
 PAM_SRC_URI = "file://sshd"
 
 inherit manpages useradd update-rc.d update-alternatives systemd
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197946): 
https://lists.openembedded.org/g/openembedded-core/message/197946
Mute This Topic: https://lists.openembedded.org/mt/105324404/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [meta][dunfell][PATCH] sqlite3: Fix CVE-2021-20223

2022-09-21 Thread Sana Kazi via lists.openembedded.org
From: Sana Kazi 

Fix CVE-2021-20223 for sqlite3
Link: 
https://github.com/sqlite/sqlite/commit/d1d43efa4fb0f2098c0e2c5bf2e807c58d5ec05b.patch

Signed-off-by: Sana Kazi 
---
 .../sqlite/files/CVE-2021-20223.patch | 23 +++
 meta/recipes-support/sqlite/sqlite3_3.31.1.bb |  1 +
 2 files changed, 24 insertions(+)
 create mode 100644 meta/recipes-support/sqlite/files/CVE-2021-20223.patch

diff --git a/meta/recipes-support/sqlite/files/CVE-2021-20223.patch 
b/meta/recipes-support/sqlite/files/CVE-2021-20223.patch
new file mode 100644
index 00..65e914c2c6
--- /dev/null
+++ b/meta/recipes-support/sqlite/files/CVE-2021-20223.patch
@@ -0,0 +1,23 @@
+From d1d43efa4fb0f2098c0e2c5bf2e807c58d5ec05b Mon Sep 17 00:00:00 2001
+From: dan 
+Date: Mon, 26 Oct 2020 13:24:36 +
+Subject: [PATCH] Prevent fts5 tokenizer unicode61 from considering '\0' to be
+ a token characters, even if other characters of class "Cc" are.
+
+FossilOrigin-Name: 
b7b7bde9b7a03665e3691c6d51118965f216d2dfb1617f138b9f9e60e418ed2f
+
+CVE: CVE-2021-20223
+Upstream-Status: Backport 
[https://github.com/sqlite/sqlite/commit/d1d43efa4fb0f2098c0e2c5bf2e807c58d5ec05b.patch]
+Comment: Removed manifest, manifest.uuid and fts5tok1.test as these files are 
not present in the amalgamated source code
+Signed-Off-by: sana.k...@kpit.com
+---
+--- a/sqlite3.c2022-09-09 13:54:30.010768197 +0530
 b/sqlite3.c2022-09-09 13:56:25.458769142 +0530
+@@ -227114,6 +227114,7 @@
+ }
+ iTbl++;
+   }
++  aAscii[0] = 0;  /* 0x00 is never a token character */
+ }
+
+ /*
diff --git a/meta/recipes-support/sqlite/sqlite3_3.31.1.bb 
b/meta/recipes-support/sqlite/sqlite3_3.31.1.bb
index 3440bf4913..04eb3683ec 100644
--- a/meta/recipes-support/sqlite/sqlite3_3.31.1.bb
+++ b/meta/recipes-support/sqlite/sqlite3_3.31.1.bb
@@ -14,6 +14,7 @@ SRC_URI = 
"http://www.sqlite.org/2020/sqlite-autoconf-${SQLITE_PV}.tar.gz \
file://CVE-2020-13631.patch \
file://CVE-2020-13632.patch \
file://CVE-2022-35737.patch \
+   file://CVE-2021-20223.patch \
"
 SRC_URI[md5sum] = "2d0a553534c521504e3ac3ad3b90f125"
 SRC_URI[sha256sum] = 
"62284efebc05a76f909c580ffa5c008a7d22a1287285d68b7825a2b6b51949ae"
--
2.17.1

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient, you are not 
authorized to read, print, retain copy, disseminate, distribute, or use this 
message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message. KPIT 
Technologies Ltd. does not accept any liability for virus infected mails.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170945): 
https://lists.openembedded.org/g/openembedded-core/message/170945
Mute This Topic: https://lists.openembedded.org/mt/93823840/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [meta][dunfell][PATCH] curl: Fix CVEs for curl

2022-07-08 Thread Sana Kazi via lists.openembedded.org
Fix below listed CVEs for curl:

1.CVE-2022-32206
Link: 
http://archive.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.81.0-1ubuntu1.3.debian.tar.xz

2.CVE-2022-32207
Linkh: 
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/curl/7.74.0-1.3ubuntu2.3/curl_7.74.0-1.3ubuntu2.3.debian.tar.xz

3.CVE-2022-32208
Link: 
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/curl/7.68.0-1ubuntu2.12/curl_7.68.0-1ubuntu2.12.debian.tar.xz

Signed-off-by: Sana.Kazi 
---
 .../curl/curl/CVE-2022-32206.patch|  49 +++
 .../curl/curl/CVE-2022-32207.patch| 288 ++
 .../curl/curl/CVE-2022-32208.patch|  29 ++
 meta/recipes-support/curl/curl_7.69.1.bb  |   3 +
 4 files changed, 369 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2022-32206.patch
 create mode 100644 meta/recipes-support/curl/curl/CVE-2022-32207.patch
 create mode 100644 meta/recipes-support/curl/curl/CVE-2022-32208.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2022-32206.patch 
b/meta/recipes-support/curl/curl/CVE-2022-32206.patch
new file mode 100644
index 00..d3b015e435
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2022-32206.patch
@@ -0,0 +1,49 @@
+From 7035676c3daa4f1c3766095561f12e7a0e82c736 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg 
+Date: Mon, 16 May 2022 16:28:13 +0200
+Subject: [PATCH] content_encoding: return error on too many compression steps
+
+The max allowed steps is arbitrarily set to 5.
+---
+ lib/content_encoding.c | 9 +
+ 1 file changed, 9 insertions(+)
+
+CVE: CVE-2022-32206
+Upstream-Status: Backport 
[http://archive.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.81.0-1ubuntu1.3.debian.tar.xz]
+Comment: Refreshed hunks to fix patch fuzz
+Signed-off-by: Sana Kazi 
+
+Index: curl-7.83.1/lib/content_encoding.c
+===
+--- curl-7.83.1.orig/lib/content_encoding.c
 curl-7.83.1/lib/content_encoding.c
+@@ -934,6 +934,9 @@
+   return NULL;
+ }
+
++/* allow no more than 5 "chained" compression steps */
++#define MAX_ENCODE_STACK 5
++
+ /* Set-up the unencoding stack from the Content-Encoding header value.
+  * See RFC 7231 section 3.1.2.2. */
+ CURLcode Curl_build_unencoding_stack(struct connectdata *conn,
+@@ -941,6 +944,7 @@
+ {
+   struct Curl_easy *data = conn->data;
+   struct SingleRequest *k = >req;
++  int counter = 0;
+
+   do {
+ const char *name;
+@@ -975,6 +979,11 @@
+   if(!encoding)
+ encoding = _encoding;  /* Defer error at stack use. */
+
++  if(++counter >= MAX_ENCODE_STACK) {
++failf(data, "Reject response due to %u content encodings",
++  counter);
++return CURLE_BAD_CONTENT_ENCODING;
++  }
+   /* Stack the unencoding stage. */
+   writer = new_unencoding_writer(conn, encoding, k->writer_stack);
+   if(!writer)
diff --git a/meta/recipes-support/curl/curl/CVE-2022-32207.patch 
b/meta/recipes-support/curl/curl/CVE-2022-32207.patch
new file mode 100644
index 00..8435dfaed0
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2022-32207.patch
@@ -0,0 +1,288 @@
+Backported of:
+
+From 3782dfda5fc4f45a19b1ce1b01ecf7206a3d304a Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg 
+Date: Wed, 25 May 2022 10:09:53 +0200
+Subject: [PATCH 1/3] fopen: add Curl_fopen() for better overwriting of files
+
+---
+ lib/Makefile.inc |   4 +-
+ lib/altsvc.c |  22 +++---
+ lib/cookie.c |  16 ++-
+ lib/fopen.c  | 106 +++
+ lib/fopen.h  |  28 +
+ 6 files changed, 152 insertions(+), 46 deletions(-)
+ create mode 100644 lib/fopen.c
+ create mode 100644 lib/fopen.h
+
+CVE: CVE-2022-32207
+Upstream-Status: Backport 
[https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/curl/7.74.0-1.3ubuntu2.3/curl_7.74.0-1.3ubuntu2.3.debian.tar.xz]
+Comment: Removed hsts.c as it is not present in source code and refreshed 
other hunks to fix the patch fuzz
+Signed-off-by: Sana Kazi 
+
+diff --git a/lib/Makefile.inc b/lib/Makefile.inc
+index 6d35704..7dac605 100644
+--- a/lib/Makefile.inc
 b/lib/Makefile.inc
+@@ -60,7 +60,7 @@
+   openldap.c curl_gethostname.c gopher.c idn_win32.c\
+   http_proxy.c non-ascii.c asyn-ares.c asyn-thread.c curl_gssapi.c  \
+   http_ntlm.c curl_ntlm_wb.c curl_ntlm_core.c curl_sasl.c rand.c\
+-  curl_multibyte.c hostcheck.c conncache.c dotdot.c \
++  curl_multibyte.c hostcheck.c conncache.c dotdot.c fopen.c   
 \
+   x509asn1.c http2.c smb.c curl_endian.c curl_des.c system_win32.c  \
+   mime.c sha256.c setopt.c curl_path.c curl_ctype.c curl_range.c psl.c  \
+   doh.c urlapi.c curl_get_line.c altsvc.c socketpair.c rename.c
+@@ -79,7 +79,7 @@
+   rtsp.h curl_threads.h warnless.h curl_hmac.h curl_rtmp.h  \
+   curl_gethostname.h gopher.h http_proxy.h non-ascii.h asyn.h   \
+   http_ntl

[OE-core] [poky][dunfell][PATCH] curl: Fix CVEs for curl

2022-05-16 Thread sana kazi
From: Sana Kazi 

Fix below listed CVEs:
CVE-2022-22576
Link: 
https://github.com/curl/curl/commit/852aa5ad351ea53e5f01d2f44b5b4370c2bf5425.patch

CVE-2022-27775
Link: 
https://github.com/curl/curl/commit/058f98dc3fe595f21dc26a5b9b1699e519ba5705.patch

CVE-2022-27776
Link: 
https://github.com/curl/curl/commit/6e659993952aa5f90f48864be84a1bbb047fc258.patch

Signed-off-by: Sana.Kazi 
Signed-off-by: Sana Kazi 
---
 .../curl/curl/CVE-2022-22576.patch| 148 ++
 .../curl/curl/CVE-2022-27775.patch|  39 +
 .../curl/curl/CVE-2022-27776.patch| 114 ++
 meta/recipes-support/curl/curl_7.69.1.bb  |   3 +
 4 files changed, 304 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2022-22576.patch
 create mode 100644 meta/recipes-support/curl/curl/CVE-2022-27775.patch
 create mode 100644 meta/recipes-support/curl/curl/CVE-2022-27776.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2022-22576.patch 
b/meta/recipes-support/curl/curl/CVE-2022-22576.patch
new file mode 100644
index 00..13479e7f0e
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2022-22576.patch
@@ -0,0 +1,148 @@
+From 852aa5ad351ea53e5f01d2f44b5b4370c2bf5425 Mon Sep 17 00:00:00 2001
+From: Patrick Monnerat 
+Date: Mon, 25 Apr 2022 11:44:05 +0200
+Subject: [PATCH] url: check sasl additional parameters for connection reuse.
+
+Also move static function safecmp() as non-static Curl_safecmp() since
+its purpose is needed at several places.
+
+Bug: https://curl.se/docs/CVE-2022-22576.html
+
+CVE-2022-22576
+
+Closes #8746
+---
+ lib/strcase.c   | 10 ++
+ lib/strcase.h   |  2 ++
+ lib/url.c   | 13 -
+ lib/urldata.h   |  1 +
+ lib/vtls/vtls.c | 21 ++---
+ 5 files changed, 31 insertions(+), 16 deletions(-)
+
+CVE: CVE-2022-22576
+Upstream-Status: Backport 
[https://github.com/curl/curl/commit/852aa5ad351ea53e5f01d2f44b5b4370c2bf5425.patch]
+Comment: Refreshed patch
+Signed-off-by: Sana.Kazi 
+
+diff --git a/lib/strcase.c b/lib/strcase.c
+index dd46ca1ba0e5..692a3f14aee7 100644
+--- a/lib/strcase.c
 b/lib/strcase.c
+@@ -251,6 +251,16 @@
+   } while(*src++ && --n);
+ }
+ 
++/* Compare case-sensitive NUL-terminated strings, taking care of possible
++ * null pointers. Return true if arguments match.
++ */
++bool Curl_safecmp(char *a, char *b)
++{
++  if(a && b)
++return !strcmp(a, b);
++  return !a && !b;
++}
++
+ /* --- public functions --- */
+ 
+ int curl_strequal(const char *first, const char *second)
+diff --git a/lib/strcase.h b/lib/strcase.h
+index b234d3815220..2635f5117e99 100644
+--- a/lib/strcase.h
 b/lib/strcase.h
+@@ -48,4 +48,6 @@
+ void Curl_strntoupper(char *dest, const char *src, size_t n);
+ void Curl_strntolower(char *dest, const char *src, size_t n);
+ 
++bool Curl_safecmp(char *a, char *b);
++
+ #endif /* HEADER_CURL_STRCASE_H */
+diff --git a/lib/url.c b/lib/url.c
+index 9a988b4d58d8..e1647b133854 100644
+--- a/lib/url.c
 b/lib/url.c
+@@ -730,6 +730,7 @@
+   Curl_safefree(conn->allocptr.host);
+   Curl_safefree(conn->allocptr.cookiehost);
+   Curl_safefree(conn->allocptr.rtsp_transport);
++  Curl_safefree(conn->oauth_bearer);  
+   Curl_safefree(conn->trailer);
+   Curl_safefree(conn->host.rawalloc); /* host name buffer */
+   Curl_safefree(conn->conn_to_host.rawalloc); /* host name buffer */
+@@ -1251,7 +1252,9 @@
+ /* This protocol requires credentials per connection,
+so verify that we're using the same name and password as well */
+ if(strcmp(needle->user, check->user) ||
+-   strcmp(needle->passwd, check->passwd)) {
++   strcmp(needle->passwd, check->passwd) ||
++   !Curl_safecmp(needle->sasl_authzid, check->sasl_authzid) ||
++   !Curl_safecmp(needle->oauth_bearer, check->oauth_bearer)) {

+   /* one of them was different */
+   continue;
+ }
+@@ -3392,6 +3395,14 @@
+   result = CURLE_OUT_OF_MEMORY;
+   goto out;
+ }
++  }
++
++  if(data->set.str[STRING_BEARER]) {
++conn->oauth_bearer = strdup(data->set.str[STRING_BEARER]);
++if(!conn->oauth_bearer) {
++  result = CURLE_OUT_OF_MEMORY;
++  goto out;
++}
+   }
+ 
+ #ifdef USE_UNIX_SOCKETS
+diff --git a/lib/urldata.h b/lib/urldata.h
+index 07eb19b87034..1d89b8d7fa68 100644
+--- a/lib/urldata.h
 b/lib/urldata.h
+@@ -949,6 +949,8 @@
+ 
+   char *sasl_authzid; /* authorisation identity string, allocated */
+ 
++  char *oauth_bearer; /* OAUTH2 bearer, allocated */
++
+   int httpversion;/* the HTTP version*10 reported by the server */
+   int rtspversion;/* the RTSP version*10 reported by the server */
+ 
+diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
+index 03b85ba065e5..a40ac06f684f 100644
+--- a/lib/vtls/vtls.c
 b/lib/vtls/vtls.c
+@@ -82,15 +82,6 @@
+   else   

[OE-core] [poky][dunfell][PATCH] tiff: Fix CVE-2022-0891

2022-04-21 Thread sana kazi
Fix CVE-2022-0891 for tiff

Link: 
https://sources.debian.org/src/tiff/4.1.0+git191117-2%7Edeb10u4/debian/patches/CVE-2022-0891.patch/

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 .../libtiff/files/CVE-2022-0891.patch | 217 ++
 meta/recipes-multimedia/libtiff/tiff_4.1.0.bb |   1 +
 2 files changed, 218 insertions(+)
 create mode 100644 meta/recipes-multimedia/libtiff/files/CVE-2022-0891.patch

diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2022-0891.patch 
b/meta/recipes-multimedia/libtiff/files/CVE-2022-0891.patch
new file mode 100644
index 00..e2f1bd3056
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/CVE-2022-0891.patch
@@ -0,0 +1,217 @@
+From 232282fd8f9c21eefe8d2d2b96cdbbb172fe7b7c Mon Sep 17 00:00:00 2001
+From: Su Laus 
+Date: Tue, 8 Mar 2022 17:02:44 +
+Subject: [PATCH] tiffcrop: fix issue #380 and #382 heap buffer overflow in
+ extractImageSection
+
+CVE: CVE-2022-0891
+Upstream-Status: Backport 
[https://sources.debian.org/src/tiff/4.1.0+git191117-2%7Edeb10u4/debian/patches/CVE-2022-0891.patch/]
+Comment: No change in any hunk
+Signed-off-by: Sana Kazi 
+---
+ tools/tiffcrop.c | 92 +++-
+ 1 file changed, 36 insertions(+), 56 deletions(-)
+
+diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
+index f2e5474a..e62bcc71 100644
+--- a/tools/tiffcrop.c
 b/tools/tiffcrop.c
+@@ -105,8 +105,8 @@
+  *of messages to monitor progess without enabling dump logs.
+  */
+ 
+-static   char tiffcrop_version_id[] = "2.4";
+-static   char tiffcrop_rev_date[] = "12-13-2010";
++static   char tiffcrop_version_id[] = "2.4.1";
++static   char tiffcrop_rev_date[] = "03-03-2010";
+ 
+ #include "tif_config.h"
+ #include "tiffiop.h"
+@@ -6670,10 +6670,10 @@ extractImageSection(struct image_data *image, struct 
pageseg *section,
+ #ifdef DEVELMODE
+   uint32img_length;
+ #endif
+-  uint32j, shift1, shift2, trailing_bits;
++  uint32j, shift1, trailing_bits;
+   uint32row, first_row, last_row, first_col, last_col;
+   uint32src_offset, dst_offset, row_offset, col_offset;
+-  uint32offset1, offset2, full_bytes;
++  uint32offset1, full_bytes;
+   uint32sect_width;
+ #ifdef DEVELMODE
+   uint32sect_length;
+@@ -6683,7 +6683,6 @@ extractImageSection(struct image_data *image, struct 
pageseg *section,
+ #ifdef DEVELMODE
+   int  k;
+   unsigned char bitset;
+-  static char *bitarray = NULL;
+ #endif
+ 
+   img_width = image->width;
+@@ -6701,17 +6700,12 @@ extractImageSection(struct image_data *image, struct 
pageseg *section,
+   dst_offset = 0;
+ 
+ #ifdef DEVELMODE
+-  if (bitarray == NULL)
+-{
+-if ((bitarray = (char *)malloc(img_width)) == NULL)
+-  {
+-  TIFFError ("", "DEBUG: Unable to allocate debugging bitarray");
+-  return (-1);
+-  }
+-}
++  char bitarray[39];
+ #endif
+ 
+-  /* rows, columns, width, length are expressed in pixels */
++  /* rows, columns, width, length are expressed in pixels
++   * first_row, last_row, .. are index into image array starting at 0 to 
width-1,
++   * last_col shall be also extracted.  */
+   first_row = section->y1;
+   last_row  = section->y2;
+   first_col = section->x1;
+@@ -6721,9 +6715,14 @@ extractImageSection(struct image_data *image, struct 
pageseg *section,
+ #ifdef DEVELMODE
+   sect_length = last_row - first_row + 1;
+ #endif
+-  img_rowsize = ((img_width * bps + 7) / 8) * spp;
+-  full_bytes = (sect_width * spp * bps) / 8;   /* number of COMPLETE bytes 
per row in section */
+-  trailing_bits = (sect_width * bps) % 8;
++/* The read function loadImage() used copy separate plane data into a 
buffer as interleaved
++ * samples rather than separate planes so the same logic works to extract 
regions
++ * regardless of the way the data are organized in the input file.
++ * Furthermore, bytes and bits are arranged in buffer according to 
COMPRESSION=1 and FILLORDER=1 
++ */
++img_rowsize = (((img_width * spp * bps) + 7) / 8);/* row size in full 
bytes of source image */
++full_bytes = (sect_width * spp * bps) / 8;/* number of 
COMPLETE bytes per row in section */
++trailing_bits = (sect_width * spp * bps) % 8; /* trailing bits 
within the last byte of destination buffer */
+ 
+ #ifdef DEVELMODE
+ TIFFError ("", "First row: %d, last row: %d, First col: %d, last col: 
%d\n",
+@@ -6736,10 +6735,9 @@ extractImageSection(struct image_data *image, struct 
pageseg *section,
+ 
+   if ((bps % 8) == 0)
+ {
+-col_offset = first_col * spp * bps / 8;
++col_offset = (first_col * spp * bps) / 8;
+ for (row = first_row; row <= last_row; row++)
+   {
+-  /* row_offset = row * img_width * spp * bps / 8; */
+   row_offset = row * img_rowsize;
+   src_offset = row_offset + col_offset;
+ 
+@@ -6752,14 

[OE-core] [poky][dunfell][PATCH] binutils: Whitelist CVEs

2022-03-22 Thread sana kazi
CVE-2020-16590 CVE-2020-16591 CVE-2020-16599 CVE-2021-20294 does
not affect binutils_2.34 and the contents of the patch are not
present in the source code. Therefore, whitelist it.

Links:
https://nvd.nist.gov/vuln/detail/CVE-2020-16590
https://nvd.nist.gov/vuln/detail/CVE-2020-16591
https://nvd.nist.gov/vuln/detail/CVE-2020-16599
https://nvd.nist.gov/vuln/detail/CVE-2021-20294

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 meta/recipes-devtools/binutils/binutils-2.34.inc | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/meta/recipes-devtools/binutils/binutils-2.34.inc 
b/meta/recipes-devtools/binutils/binutils-2.34.inc
index 6a55de2d45..990c5fa8f1 100644
--- a/meta/recipes-devtools/binutils/binutils-2.34.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.34.inc
@@ -54,3 +54,18 @@ SRC_URI = "\
  file://0001-CVE-2021-45078.patch \
 "
 S  = "${WORKDIR}/git"
+
+# CVE-2020-16590 CVE-2020-16591 CVE-2020-16599 CVE-2021-20294 does not affect
+# binutils_2.34 and the contents of the patch are not
+# present in the source code. Therefore, whitelist it.
+# https://nvd.nist.gov/vuln/detail/CVE-2020-16590
+# https://nvd.nist.gov/vuln/detail/CVE-2020-16591
+# https://nvd.nist.gov/vuln/detail/CVE-2020-16599
+# https://nvd.nist.gov/vuln/detail/CVE-2021-20294
+
+CVE_CHECK_WHITELIST += " \
+CVE-2020-16590 \
+CVE-2020-16591 \
+CVE-2020-16599 \
+CVE-2021-20294 \
+"
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#163545): 
https://lists.openembedded.org/g/openembedded-core/message/163545
Mute This Topic: https://lists.openembedded.org/mt/89949489/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [poky][dunfell][PATCH] tiff: Add backports for two CVEs from upstream

2022-03-09 Thread sana kazi
(From OE-Core rev: 6ae14b4ff7a655b48c6d99ac565d12bf8825414f)

Signed-off-by: Richard Purdie 
(cherry picked from commit e600227b136aa21b54f16e218858d640c8942f73)
Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 ...99c99f987dc32ae110370cfdd7df7975586b.patch | 28 +
 ...0712f4c3a5b449f70c57988260a667ddbdef.patch | 30 +++
 meta/recipes-multimedia/libtiff/tiff_4.1.0.bb |  2 ++
 3 files changed, 60 insertions(+)
 create mode 100644 
meta/recipes-multimedia/libtiff/tiff/561599c99f987dc32ae110370cfdd7df7975586b.patch
 create mode 100644 
meta/recipes-multimedia/libtiff/tiff/eecb0712f4c3a5b449f70c57988260a667ddbdef.patch

diff --git 
a/meta/recipes-multimedia/libtiff/tiff/561599c99f987dc32ae110370cfdd7df7975586b.patch
 
b/meta/recipes-multimedia/libtiff/tiff/561599c99f987dc32ae110370cfdd7df7975586b.patch
new file mode 100644
index 00..01ed5dcd24
--- /dev/null
+++ 
b/meta/recipes-multimedia/libtiff/tiff/561599c99f987dc32ae110370cfdd7df7975586b.patch
@@ -0,0 +1,28 @@
+From 561599c99f987dc32ae110370cfdd7df7975586b Mon Sep 17 00:00:00 2001
+From: Even Rouault 
+Date: Sat, 5 Feb 2022 20:36:41 +0100
+Subject: [PATCH] TIFFReadDirectory(): avoid calling memcpy() with a null
+ source pointer and size of zero (fixes #362)
+
+Upstream-Status: Backport
+CVE: CVE-2022-0562
+Signed-off-by: Sana Kazi 
+Comment: Refreshed patch
+---
+ libtiff/tif_dirread.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
+index 2bbc4585..23194ced 100644
+--- a/libtiff/tif_dirread.c
 b/libtiff/tif_dirread.c
+@@ -4126,7 +4126,8 @@
+ goto bad;
+ }
+ 
+-memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, 
old_extrasamples * sizeof(uint16));
++if (old_extrasamples > 0)
++memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, 
old_extrasamples * sizeof(uint16));
+ _TIFFsetShortArray(>tif_dir.td_sampleinfo, 
new_sampleinfo, tif->tif_dir.td_extrasamples);
+ _TIFFfree(new_sampleinfo);
+ }
diff --git 
a/meta/recipes-multimedia/libtiff/tiff/eecb0712f4c3a5b449f70c57988260a667ddbdef.patch
 
b/meta/recipes-multimedia/libtiff/tiff/eecb0712f4c3a5b449f70c57988260a667ddbdef.patch
new file mode 100644
index 00..fc5d0ab5f4
--- /dev/null
+++ 
b/meta/recipes-multimedia/libtiff/tiff/eecb0712f4c3a5b449f70c57988260a667ddbdef.patch
@@ -0,0 +1,30 @@
+From eecb0712f4c3a5b449f70c57988260a667ddbdef Mon Sep 17 00:00:00 2001
+From: Even Rouault 
+Date: Sun, 6 Feb 2022 13:08:38 +0100
+Subject: [PATCH] TIFFFetchStripThing(): avoid calling memcpy() with a null
+ source pointer and size of zero (fixes #362)
+
+Upstream-Status: Backport
+CVE: CVE-2022-0561
+Signed-off-by: Sana Kazi 
+Comment: Refreshed patch
+---
+ libtiff/tif_dirread.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
+index 23194ced..50ebf8ac 100644
+--- a/libtiff/tif_dirread.c
 b/libtiff/tif_dirread.c
+@@ -5683,8 +5682,9 @@
+   _TIFFfree(data);
+   return(0);
+   }
+-
_TIFFmemcpy(resizeddata,data,(uint32)dir->tdir_count*sizeof(uint64));
+-
_TIFFmemset(resizeddata+(uint32)dir->tdir_count,0,(nstrips-(uint32)dir->tdir_count)*sizeof(uint64));
++   if( dir->tdir_count )
++   _TIFFmemcpy(resizeddata,data, (uint32)dir->tdir_count 
* sizeof(uint64));
++   _TIFFmemset(resizeddata+(uint32)dir->tdir_count, 0, (nstrips - 
(uint32)dir->tdir_count) * sizeof(uint64));
+   _TIFFfree(data);
+   data=resizeddata;
+   }
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.1.0.bb 
b/meta/recipes-multimedia/libtiff/tiff_4.1.0.bb
index 0948bb4e2f..9db247ecc7 100644
--- a/meta/recipes-multimedia/libtiff/tiff_4.1.0.bb
+++ b/meta/recipes-multimedia/libtiff/tiff_4.1.0.bb
@@ -16,6 +16,8 @@ SRC_URI = 
"http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \

file://002_support_patch_for_CVE-2020-35521_and_CVE-2020-35522.patch \
file://CVE-2020-35521_and_CVE-2020-35522.patch \

file://0001-tiffset-fix-global-buffer-overflow-for-ASCII-tags-wh.patch \
+   file://561599c99f987dc32ae110370cfdd7df7975586b.patch \
+   file://eecb0712f4c3a5b449f70c57988260a667ddbdef.patch \
   "
 SRC_URI[md5sum] = "2165e7aba557463acc0664e71a3ed424"
 SRC_URI[sha256sum] = 
"5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634"
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#162958): 
https://lists.openembedded.org/g/openembedded-core/message/162958
Mute This Topic: https://lists.openembedded.org/mt/89660166/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https

Re: [OE-core] [poky][master][PATCHv2] buildhistory.bbclass: Enable exporting more recipe and package data

2022-02-09 Thread sana kazi
Hi Richard,

I need all the variables but am also interested in additional information
like CVE_PRODUCT or MAINTAINER. Prepared these changes so that any project
specific additional information like that can be added by appending them in
a recipe or distro specific conf.

Regards,
Sana Kazi

On Wed, 9 Feb 2022 at 17:53, Richard Purdie <
richard.pur...@linuxfoundation.org> wrote:

> On Wed, 2022-02-09 at 14:59 +0530, sana kazi wrote:
> > Used BUILDHISTORY_EXPORT_RECIPE_VARIABLES and
> > BUILDHISTORY_EXPORT_PACKAGE_VARIABLES to export recipe and package
> > data to the latest file of buildhistory and sorted it alphabetically.
> >
> > This makes extending data in buildhistory git tree simple and avoids
> > patches to it for users who care about things like SRC_URI and like
> > to track it in buildhistory git tree.
> >
> > Now we can add additional information as per our requirement to the
> > buildhistory like LICENSE, SRC_URI AND MAINTAINER to the buildhistory
> > by appending them in a recipe or distro specific conf file as follows:
> >
> > BUILDHISTORY_EXPORT_RECIPE_VARIABLES += "MAINTAINER"
> > BUILDHISTORY_EXPORT_PACKAGE_VARIABLES += "MAINTAINER"
> >
> > Signed-off-by: Sana Kazi 
> > Signed-off-by: Sana Kazi 
> > ---
> >  meta/classes/buildhistory.bbclass | 111 --
> >  1 file changed, 73 insertions(+), 38 deletions(-)
> >
> > diff --git a/meta/classes/buildhistory.bbclass
> b/meta/classes/buildhistory.bbclass
> > index daa96f3b63..377b325518 100644
> > --- a/meta/classes/buildhistory.bbclass
> > +++ b/meta/classes/buildhistory.bbclass
> > @@ -69,6 +69,11 @@ BUILDHISTORY_PRESERVE = "latest latest_srcrev sysroot"
> >  PATCH_GIT_USER_EMAIL ?= "buildhistory@oe"
> >  PATCH_GIT_USER_NAME ?= "OpenEmbedded"
> >
> > +# Set BUILDHISTORY_EXPORT_RECIPE_VARIABLES and
> BUILDHISTORY_EXPORT_PACKAGE_VARIABLES
> > +# to export recipe and package data to the latest file of buildhistory
> > +BUILDHISTORY_EXPORT_RECIPE_VARIABLES ?= "PR PV PE LAYER DEPENDS
> PACKAGES SRC_URI LICENSE CONFIG"
> > +BUILDHISTORY_EXPORT_PACKAGE_VARIABLES ?= "PE PV PR PKG PKGE PKGV PKGR
> RPROVIDES RDEPENDS RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS PKGSIZE FILES
> FILELIST"
> > +
> >  #
> >  # Write out the contents of the sysroot
> >  #
> > @@ -264,12 +269,11 @@ python buildhistory_emit_pkghistory() {
> >  rcpinfo.pe = pe
> >  rcpinfo.pv = pv
> >  rcpinfo.pr = pr
> > -rcpinfo.depends =
> sortlist(oe.utils.squashspaces(d.getVar('DEPENDS') or ""))
> >  rcpinfo.packages = packages
> >  rcpinfo.layer = layer
> > -rcpinfo.license = license
> >  rcpinfo.config =
> sortlist(oe.utils.squashspaces(d.getVar('PACKAGECONFIG') or ""))
> > -rcpinfo.src_uri = oe.utils.squashspaces(d.getVar('SRC_URI') or "")
> > +export_recipe_variables =
> d.getVar('BUILDHISTORY_EXPORT_RECIPE_VARIABLES') or ''
> > +rcpinfo.export_recipe_variables = export_recipe_variables
> >  write_recipehistory(rcpinfo, d)
> >
> >  bb.build.exec_func("read_subpackage_metadata", d)
> > @@ -323,6 +327,9 @@ python buildhistory_emit_pkghistory() {
> >
> >  pkginfo.size = int(localdata.getVar('PKGSIZE') or '0')
> >
> > +export_package_variables =
> d.getVar('BUILDHISTORY_EXPORT_PACKAGE_VARIABLES') or ''
> > +pkginfo.export_package_variables = export_package_variables
> > +
> >  write_pkghistory(pkginfo, d)
> >
> >  oe.qa.exit_if_errors(d)
> > @@ -370,17 +377,22 @@ def write_recipehistory(rcpinfo, d):
> >  pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
> >
> >  infofile = os.path.join(pkghistdir, "latest")
> > +export_recipe_variables =
> set(rcpinfo.export_recipe_variables.split())
> > +ret = []
> >  with open(infofile, "w") as f:
> > -if rcpinfo.pe != "0":
> > -f.write(u"PE = %s\n" %  rcpinfo.pe)
> > -f.write(u"PV = %s\n" %  rcpinfo.pv)
> > -f.write(u"PR = %s\n" %  rcpinfo.pr)
> > -f.write(u"DEPENDS = %s\n" %  rcpinfo.depends)
> > -f.write(u"PACKAGES = %s\n" %  rcpinfo.packages)
> > -f.write(u"LAYER = %s\n" %  rcpinfo.layer)
> > -f.write(u"LICENSE = %s\n" %  rcpinfo.license)
> > -f.write(u"CONFIG = %s\n" %  rcpinfo.config)
> > -f.write(u"SRC_URI = %

[OE-core] [poky][master][PATCHv2] buildhistory.bbclass: Enable exporting more recipe and package data

2022-02-09 Thread sana kazi
Used BUILDHISTORY_EXPORT_RECIPE_VARIABLES and
BUILDHISTORY_EXPORT_PACKAGE_VARIABLES to export recipe and package
data to the latest file of buildhistory and sorted it alphabetically.

This makes extending data in buildhistory git tree simple and avoids
patches to it for users who care about things like SRC_URI and like
to track it in buildhistory git tree.

Now we can add additional information as per our requirement to the
buildhistory like LICENSE, SRC_URI AND MAINTAINER to the buildhistory
by appending them in a recipe or distro specific conf file as follows:

BUILDHISTORY_EXPORT_RECIPE_VARIABLES += "MAINTAINER"
BUILDHISTORY_EXPORT_PACKAGE_VARIABLES += "MAINTAINER"

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 meta/classes/buildhistory.bbclass | 111 --
 1 file changed, 73 insertions(+), 38 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass 
b/meta/classes/buildhistory.bbclass
index daa96f3b63..377b325518 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -69,6 +69,11 @@ BUILDHISTORY_PRESERVE = "latest latest_srcrev sysroot"
 PATCH_GIT_USER_EMAIL ?= "buildhistory@oe"
 PATCH_GIT_USER_NAME ?= "OpenEmbedded"
 
+# Set BUILDHISTORY_EXPORT_RECIPE_VARIABLES and 
BUILDHISTORY_EXPORT_PACKAGE_VARIABLES
+# to export recipe and package data to the latest file of buildhistory
+BUILDHISTORY_EXPORT_RECIPE_VARIABLES ?= "PR PV PE LAYER DEPENDS PACKAGES 
SRC_URI LICENSE CONFIG"
+BUILDHISTORY_EXPORT_PACKAGE_VARIABLES ?= "PE PV PR PKG PKGE PKGV PKGR 
RPROVIDES RDEPENDS RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS PKGSIZE FILES 
FILELIST"
+
 #
 # Write out the contents of the sysroot
 #
@@ -264,12 +269,11 @@ python buildhistory_emit_pkghistory() {
 rcpinfo.pe = pe
 rcpinfo.pv = pv
 rcpinfo.pr = pr
-rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS') or 
""))
 rcpinfo.packages = packages
 rcpinfo.layer = layer
-rcpinfo.license = license
 rcpinfo.config = sortlist(oe.utils.squashspaces(d.getVar('PACKAGECONFIG') 
or ""))
-rcpinfo.src_uri = oe.utils.squashspaces(d.getVar('SRC_URI') or "")
+export_recipe_variables = d.getVar('BUILDHISTORY_EXPORT_RECIPE_VARIABLES') 
or ''
+rcpinfo.export_recipe_variables = export_recipe_variables
 write_recipehistory(rcpinfo, d)
 
 bb.build.exec_func("read_subpackage_metadata", d)
@@ -323,6 +327,9 @@ python buildhistory_emit_pkghistory() {
 
 pkginfo.size = int(localdata.getVar('PKGSIZE') or '0')
 
+export_package_variables = 
d.getVar('BUILDHISTORY_EXPORT_PACKAGE_VARIABLES') or ''
+pkginfo.export_package_variables = export_package_variables
+
 write_pkghistory(pkginfo, d)
 
 oe.qa.exit_if_errors(d)
@@ -370,17 +377,22 @@ def write_recipehistory(rcpinfo, d):
 pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
 
 infofile = os.path.join(pkghistdir, "latest")
+export_recipe_variables = set(rcpinfo.export_recipe_variables.split())
+ret = []
 with open(infofile, "w") as f:
-if rcpinfo.pe != "0":
-f.write(u"PE = %s\n" %  rcpinfo.pe)
-f.write(u"PV = %s\n" %  rcpinfo.pv)
-f.write(u"PR = %s\n" %  rcpinfo.pr)
-f.write(u"DEPENDS = %s\n" %  rcpinfo.depends)
-f.write(u"PACKAGES = %s\n" %  rcpinfo.packages)
-f.write(u"LAYER = %s\n" %  rcpinfo.layer)
-f.write(u"LICENSE = %s\n" %  rcpinfo.license)
-f.write(u"CONFIG = %s\n" %  rcpinfo.config)
-f.write(u"SRC_URI = %s\n" %  rcpinfo.src_uri)
+for var in export_recipe_variables:
+if var == "PE":
+if rcpinfo.pe != "0":
+ret.append("%s = %s" % (var, rcpinfo.pe))
+elif var == "LAYER":
+ret.append("%s = %s" % (var, rcpinfo.layer))
+elif var == "CONFIG":
+ret.append("%s = %s" % (var, rcpinfo.config))
+else:
+ret.append("%s = %s" % (var," 
".join((str(d.getVar(var)).split()
+ret.sort()
+for element in ret:
+f.write(element + "\n")
 
 write_latest_srcrev(d, pkghistdir)
 
@@ -394,32 +406,55 @@ def write_pkghistory(pkginfo, d):
 bb.utils.mkdirhier(pkgpath)
 
 infofile = os.path.join(pkgpath, "latest")
+export_package_variables = set(pkginfo.export_package_variables.split())
+ret = []
 with open(infofile, "w") as f:
-if pkginfo.pe != "0":
-f.write(u"PE = %s\n" %  pkginfo.pe)
-f.write(u"PV = %s\n" %  pkginfo.pv)
-f.write(u"PR = %s\n" %  pkginfo.pr)
-
-if 

[OE-core] [poky][master][PATCH 2/2] test_buildhistory: Add test to verify that LICENSE is added

2022-02-09 Thread sana kazi
Added test case which uses BUILDHISTORY_EXPORT_RECIPE_VARIABLES
and BUILDHISTORY_EXPORT_PACKAGE_VARIABLES to add LICENSE for glibc as a
sample recipe to buildhistory and the test verifies that expected
license value is written in latest file.

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 .../recipes-test/glibc/glibc_%.bbappend   |  2 +
 .../oeqa/selftest/cases/test_buildhistory.py  | 50 +++
 2 files changed, 52 insertions(+)
 create mode 100644 meta-selftest/recipes-test/glibc/glibc_%.bbappend
 create mode 100644 meta/lib/oeqa/selftest/cases/test_buildhistory.py

diff --git a/meta-selftest/recipes-test/glibc/glibc_%.bbappend 
b/meta-selftest/recipes-test/glibc/glibc_%.bbappend
new file mode 100644
index 00..205720982c
--- /dev/null
+++ b/meta-selftest/recipes-test/glibc/glibc_%.bbappend
@@ -0,0 +1,2 @@
+# This bbappend is used to alter the recipe using the test_recipe.inc file 
created by tests.
+include test_recipe.inc
diff --git a/meta/lib/oeqa/selftest/cases/test_buildhistory.py 
b/meta/lib/oeqa/selftest/cases/test_buildhistory.py
new file mode 100644
index 00..5b0ce4be24
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/test_buildhistory.py
@@ -0,0 +1,50 @@
+import unittest
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.selftest.cases.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import bitbake, get_bb_var
+
+class BuildhistoryTests(BuildhistoryBase):
+
+def test_write_license_to_latest_recipe(self):
+target = 'glibc'
+recipe_variables = []
+self.write_recipeinc(target, 'BUILDHISTORY_EXPORT_RECIPE_VARIABLES += 
\"LICENSE\"')
+self.run_buildhistory_operation(target)
+add_buildhistory_config = 'PACKAGE_CLASSES = \"package_ipk\"'
+self.append_config(add_buildhistory_config)
+self.assertTrue(os.path.isdir(get_bb_var('BUILDHISTORY_DIR')), 
"buildhistory dir was not created.")
+pkghistdir = get_bb_var('BUILDHISTORY_DIR')
+PACKAGE_ARCH = get_bb_var('MULTIMACH_TARGET_SYS')
+bitbake('-c package_write_ipk -f %s' % target)
+infofile = "{}/packages/{}/{}/latest".format(pkghistdir, PACKAGE_ARCH, 
target)
+expected = "LICENSE = GPLv2 & LGPLv2.1"
+result = False
+with open(infofile, "r") as f:
+for line in f:
+if line.strip() == expected:
+result = True
+break
+if not result:
+raise AssertionError("Expected License not found")
+
+def test_write_license_to_latest_package(self):
+target = 'glibc'
+recipe_variables = []
+self.write_recipeinc(target, 'BUILDHISTORY_EXPORT_PACKAGE_VARIABLES += 
\"LICENSE\"')
+self.run_buildhistory_operation(target)
+add_buildhistory_config = 'PACKAGE_CLASSES = \"package_ipk\"'
+self.append_config(add_buildhistory_config)
+self.assertTrue(os.path.isdir(get_bb_var('BUILDHISTORY_DIR')), 
"buildhistory dir was not created.")
+bitbake('-c package_write_ipk -f %s' % target)
+pkghistdir = get_bb_var('BUILDHISTORY_DIR')
+PACKAGE_ARCH = get_bb_var('MULTIMACH_TARGET_SYS')
+infofile = "{}/packages/{}/{}/{}-dbg/latest".format(pkghistdir, 
PACKAGE_ARCH, target, target)
+expected = "LICENSE = GPLv2 & LGPLv2.1"
+result = False
+with open(infofile, "r") as f:
+for line in f:
+if line.strip() == expected:
+result = True
+break
+if not result:
+raise AssertionError("Expected License not found")
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161539): 
https://lists.openembedded.org/g/openembedded-core/message/161539
Mute This Topic: https://lists.openembedded.org/mt/89017597/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [poky][master][PATCH 1/2] buildhistory.bbclass: Enable exporting more recipe and package data

2022-02-09 Thread sana kazi
Used BUILDHISTORY_EXPORT_RECIPE_VARIABLES and
BUILDHISTORY_EXPORT_PACKAGE_VARIABLES to export recipe and package
data to the latest file of buildhistory and sorted it alphabetically.

This makes extending data in buildhistory git tree simple and avoids
patches to it for users who care about things like SRC_URI and like
to track it in buildhistory git tree.

Now we can add additional information as per our requirement to the
buildhistory like LICENSE, SRC_URI AND MAINTAINER to the buildhistory
by appending them in a recipe or distro specific conf file as follows:

BUILDHISTORY_EXPORT_RECIPE_VARIABLES += "MAINTAINER"
BUILDHISTORY_EXPORT_PACKAGE_VARIABLES += "MAINTAINER"

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 meta-poky/conf/distro/poky.conf   |   2 +
 meta/classes/buildhistory.bbclass | 106 +++---
 2 files changed, 70 insertions(+), 38 deletions(-)

diff --git a/meta-poky/conf/distro/poky.conf b/meta-poky/conf/distro/poky.conf
index 2dc3606ae5..c382493dbc 100644
--- a/meta-poky/conf/distro/poky.conf
+++ b/meta-poky/conf/distro/poky.conf
@@ -72,3 +72,5 @@ INHERIT += "uninative"
 
 BB_SIGNATURE_HANDLER ?= "OEEquivHash"
 BB_HASHSERVE ??= "auto"
+BUILDHISTORY_EXPORT_RECIPE_VARIABLES ?= "PR PV PE LAYER DEPENDS PACKAGES 
SRC_URI LICENSE CONFIG"
+BUILDHISTORY_EXPORT_PACKAGE_VARIABLES ?= "PE PV PR PKG PKGE PKGV PKGR 
RPROVIDES RDEPENDS RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS PKGSIZE FILES 
FILELIST"
diff --git a/meta/classes/buildhistory.bbclass 
b/meta/classes/buildhistory.bbclass
index daa96f3b63..04837cafc4 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -264,12 +264,11 @@ python buildhistory_emit_pkghistory() {
 rcpinfo.pe = pe
 rcpinfo.pv = pv
 rcpinfo.pr = pr
-rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS') or 
""))
 rcpinfo.packages = packages
 rcpinfo.layer = layer
-rcpinfo.license = license
 rcpinfo.config = sortlist(oe.utils.squashspaces(d.getVar('PACKAGECONFIG') 
or ""))
-rcpinfo.src_uri = oe.utils.squashspaces(d.getVar('SRC_URI') or "")
+export_recipe_variables = d.getVar('BUILDHISTORY_EXPORT_RECIPE_VARIABLES') 
or ''
+rcpinfo.export_recipe_variables = export_recipe_variables
 write_recipehistory(rcpinfo, d)
 
 bb.build.exec_func("read_subpackage_metadata", d)
@@ -323,6 +322,9 @@ python buildhistory_emit_pkghistory() {
 
 pkginfo.size = int(localdata.getVar('PKGSIZE') or '0')
 
+export_package_variables = 
d.getVar('BUILDHISTORY_EXPORT_PACKAGE_VARIABLES') or ''
+pkginfo.export_package_variables = export_package_variables
+
 write_pkghistory(pkginfo, d)
 
 oe.qa.exit_if_errors(d)
@@ -370,17 +372,22 @@ def write_recipehistory(rcpinfo, d):
 pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
 
 infofile = os.path.join(pkghistdir, "latest")
+export_recipe_variables = set(rcpinfo.export_recipe_variables.split())
+ret = []
 with open(infofile, "w") as f:
-if rcpinfo.pe != "0":
-f.write(u"PE = %s\n" %  rcpinfo.pe)
-f.write(u"PV = %s\n" %  rcpinfo.pv)
-f.write(u"PR = %s\n" %  rcpinfo.pr)
-f.write(u"DEPENDS = %s\n" %  rcpinfo.depends)
-f.write(u"PACKAGES = %s\n" %  rcpinfo.packages)
-f.write(u"LAYER = %s\n" %  rcpinfo.layer)
-f.write(u"LICENSE = %s\n" %  rcpinfo.license)
-f.write(u"CONFIG = %s\n" %  rcpinfo.config)
-f.write(u"SRC_URI = %s\n" %  rcpinfo.src_uri)
+for var in export_recipe_variables:
+if var == "PE":
+if rcpinfo.pe != "0":
+ret.append("%s = %s" % (var, rcpinfo.pe))
+elif var == "LAYER":
+ret.append("%s = %s" % (var, rcpinfo.layer))
+elif var == "CONFIG":
+ret.append("%s = %s" % (var, rcpinfo.config))
+else:
+ret.append("%s = %s" % (var," 
".join((str(d.getVar(var)).split()
+ret.sort()
+for element in ret:
+f.write(element + "\n")
 
 write_latest_srcrev(d, pkghistdir)
 
@@ -394,32 +401,55 @@ def write_pkghistory(pkginfo, d):
 bb.utils.mkdirhier(pkgpath)
 
 infofile = os.path.join(pkgpath, "latest")
+export_package_variables = set(pkginfo.export_package_variables.split())
+ret = []
 with open(infofile, "w") as f:
-if pkginfo.pe != "0":
-f.write(u"PE = %s\n" %  pkginfo.pe)
-f.write(u"PV = %s\n" %  pkginfo.pv)
-f.write(u"PR = %s\n" %  pkginfo.pr)
-
-if pkginfo.pkg != pkginfo

[OE-core] [poky][dunfell][PATCH 2/2] openssh: Whitelist CVE-2016-20012

2021-12-16 Thread sana kazi
Whitelist CVE-2016-20012 as the upstream OpenSSH developers
see this as an important security feature and do not intend to
'fix' it.
Link: https://security-tracker.debian.org/tracker/CVE-2016-20012
https://ubuntu.com/security/CVE-2016-20012

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 meta/recipes-connectivity/openssh/openssh_8.2p1.bb | 9 +
 1 file changed, 9 insertions(+)

diff --git a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb 
b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
index e903ec487d..ddc9ed0b32 100644
--- a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
@@ -51,6 +51,15 @@ CVE_CHECK_WHITELIST += "CVE-2020-15778"
 # https://www.securityfocus.com/bid/30794
 CVE_CHECK_WHITELIST += "CVE-2008-3844"
 
+# openssh-ssh1 is provided for compatibility with old devices that
+# cannot be upgraded to modern protocols. Thus they may not provide security
+# support for this package because doing so would prevent access to equipment.
+# The upstream OpenSSH developers see this as an important
+# security feature and do not intend to 'fix' it.
+# https://security-tracker.debian.org/tracker/CVE-2016-20012
+# https://ubuntu.com/security/CVE-2016-20012
+CVE_CHECK_WHITELIST += "CVE-2016-20012"
+
 PAM_SRC_URI = "file://sshd"
 
 inherit manpages useradd update-rc.d update-alternatives systemd
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159818): 
https://lists.openembedded.org/g/openembedded-core/message/159818
Mute This Topic: https://lists.openembedded.org/mt/87784964/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [poky][dunfell][PATCH 1/2] openssh: Fix CVE-2021-41617

2021-12-16 Thread sana kazi
Add patch to fix CVE-2021-41617
Link: https://bugzilla.suse.com/attachment.cgi?id=854015

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 .../openssh/openssh/CVE-2021-41617.patch  | 52 +++
 .../openssh/openssh_8.2p1.bb  |  1 +
 2 files changed, 53 insertions(+)
 create mode 100644 
meta/recipes-connectivity/openssh/openssh/CVE-2021-41617.patch

diff --git a/meta/recipes-connectivity/openssh/openssh/CVE-2021-41617.patch 
b/meta/recipes-connectivity/openssh/openssh/CVE-2021-41617.patch
new file mode 100644
index 00..bda896f581
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/CVE-2021-41617.patch
@@ -0,0 +1,52 @@
+From a6414400ec94a17871081f7df24f910a6ee01b8b Mon Sep 17 00:00:00 2001
+From: Ali Abdallah 
+Date: Wed, 24 Nov 2021 13:33:39 +0100
+Subject: [PATCH] CVE-2021-41617 fix
+
+backport of the following two upstream commits
+
+f3cbe43e28fe71427d41cfe3a17125b972710455
+bf944e3794eff5413f2df1ef37cddf96918c6bde
+
+CVE-2021-41617 failed to correctly initialise supplemental groups
+when executing an AuthorizedKeysCommand or AuthorizedPrincipalsCommand,
+where a AuthorizedKeysCommandUser or AuthorizedPrincipalsCommandUser
+directive has been set to run the command as a different user. Instead
+these commands would inherit the groups that sshd(8) was started with.
+---
+ auth.c | 8 
+ 1 file changed, 8 insertions(+)
+
+CVE: CVE-2021-41617
+Upstream-Status: Backport [https://bugzilla.suse.com/attachment.cgi?id=854015]
+Comment: No change in any hunk
+Signed-off-by: Sana Kazi 
+
+diff --git a/auth.c b/auth.c
+index 163038f..a47b267 100644
+--- a/auth.c
 b/auth.c
+@@ -52,6 +52,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ 
+ #include "xmalloc.h"
+ #include "match.h"
+@@ -851,6 +852,13 @@ subprocess(const char *tag, struct passwd *pw, const char 
*command,
+   }
+   closefrom(STDERR_FILENO + 1);
+ 
++  if (geteuid() == 0 &&
++  initgroups(pw->pw_name, pw->pw_gid) == -1) {
++  error("%s: initgroups(%s, %u): %s", tag,
++  pw->pw_name, (u_int)pw->pw_gid, strerror(errno));
++  _exit(1);
++  }
++
+   /* Don't use permanently_set_uid() here to avoid fatal() */
+   if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1) {
+   error("%s: setresgid %u: %s", tag, (u_int)pw->pw_gid,
+-- 
+2.26.2
diff --git a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb 
b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
index b60d1a6bd4..e903ec487d 100644
--- a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
@@ -26,6 +26,7 @@ SRC_URI = 
"http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
file://add-test-support-for-busybox.patch \
file://CVE-2020-14145.patch \
file://CVE-2021-28041.patch \
+   file://CVE-2021-41617.patch \
"
 SRC_URI[md5sum] = "3076e6413e8dbe56d33848c1054ac091"
 SRC_URI[sha256sum] = 
"43925151e6cf6cee1450190c0e9af4dc36b41c12737619edff8bcebdff64e671"
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159817): 
https://lists.openembedded.org/g/openembedded-core/message/159817
Mute This Topic: https://lists.openembedded.org/mt/87784954/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [poky][dunfell][PATCH] busybox: Fix multiple security issues in awk

2021-12-08 Thread sana kazi
CVE-2021-423xx-awk.patch fixes below listed CVEs for busybox:
CVE-2021-42378, CVE-2021-42379, CVE-2021-42380, CVE-2021-42381,
CVE-2021-42382, CVE-2021-42384, CVE-2021-42385, CVE-2021-42386

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 meta/recipes-core/busybox/busybox_1.31.1.bb   |   1 +
 .../busybox/files/CVE-2021-423xx-awk.patch| 203 ++
 2 files changed, 204 insertions(+)
 create mode 100644 meta/recipes-core/busybox/files/CVE-2021-423xx-awk.patch

diff --git a/meta/recipes-core/busybox/busybox_1.31.1.bb 
b/meta/recipes-core/busybox/busybox_1.31.1.bb
index d9d5f4f96b..1bb0c028ac 100644
--- a/meta/recipes-core/busybox/busybox_1.31.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.31.1.bb
@@ -52,6 +52,7 @@ SRC_URI = 
"https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
file://0001-hwclock-make-glibc-2.31-compatible.patch \
file://0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch \
file://0001-mktemp-add-tmpdir-option.patch \
+   file://CVE-2021-423xx-awk.patch \
"
 SRC_URI_append_libc-musl = " file://musl.cfg "
 
diff --git a/meta/recipes-core/busybox/files/CVE-2021-423xx-awk.patch 
b/meta/recipes-core/busybox/files/CVE-2021-423xx-awk.patch
new file mode 100644
index 00..49296354cb
--- /dev/null
+++ b/meta/recipes-core/busybox/files/CVE-2021-423xx-awk.patch
@@ -0,0 +1,203 @@
+Description: fix multiple security issues in awk
+Origin: backported awk.c from busybox 1.34.1
+
+CVE: CVE-2021-42378
+CVE: CVE-2021-42379
+CVE: CVE-2021-42380
+CVE: CVE-2021-42381
+CVE: CVE-2021-42382
+CVE: CVE-2021-42384
+CVE: CVE-2021-42385
+CVE: CVE-2021-42386
+
+Upstream-Status: Backport 
[https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/busybox/1:1.30.1-6ubuntu3.1/busybox_1.30.1-6ubuntu3.1.debian.tar.xz]
+
+Comment: Refreshed first hunk and removed few hunks as they are already 
present in source.
+
+Signed-off-by: Sana Kazi 
+
+--- a/editors/awk.c
 b/editors/awk.c
+@@ -272,7 +272,8 @@
+ /* if previous token class is CONCAT1 and next is CONCAT2, concatenation */
+ /* operator is inserted between them */
+ #define   TC_CONCAT1 (TC_VARIABLE | TC_ARRTERM | TC_SEQTERM \
+-   | TC_STRING | TC_NUMBER | TC_UOPPOST)
++   | TC_STRING | TC_NUMBER | TC_UOPPOST \
++   | TC_LENGTH)
+ #define   TC_CONCAT2 (TC_OPERAND | TC_UOPPRE)
+ 
+ #define   OF_RES1 0x01
+@@ -401,7 +405,7 @@ static const char tokenlist[] ALIGN1 =
+ 
+ #define OC_B  OC_BUILTINCVE-2021-423xx-awk.patch
+ 
+-static const uint32_t tokeninfo[] = {
++static const uint32_t tokeninfo[] ALIGN4 = {
+   0,
+   0,
+   OC_REGEXP
+@@ -1067,8 +1071,10 @@ static uint32_t next_token(uint32_t expe
+   const uint32_t *ti;
+ 
+   if (t_rollback) {
++  debug_printf_parse("%s: using rolled-back token\n", __func__);
+   t_rollback = FALSE;
+   } else if (concat_inserted) {
++  debug_printf_parse("%s: using concat-inserted token\n", 
__func__);
+   concat_inserted = FALSE;
+   t_tclass = save_tclass;
+   t_info = save_info;
+@@ -1197,7 +1203,11 @@ static uint32_t next_token(uint32_t expe
+   goto readnext;
+ 
+   /* insert concatenation operator when needed */
+-  if ((ltclass & TC_CONCAT1) && (tc & TC_CONCAT2) && (expected & 
TC_BINOP)) {
++  debug_printf_parse("%s: %x %x %x concat_inserted?\n", __func__,
++  (ltclass & TC_CONCAT1), (tc & TC_CONCAT2), (expected & 
TC_BINOP));
++  if ((ltclass & TC_CONCAT1) && (tc & TC_CONCAT2) && (expected & 
TC_BINOP)
++   && !(ltclass == TC_LENGTH && tc == TC_SEQSTART) /* but not for 
"length(..." */
++  ) {
+   concat_inserted = TRUE;
+   save_tclass = tc;
+   save_info = t_info;
+@@ -1205,6 +1215,7 @@ static uint32_t next_token(uint32_t expe
+   t_info = OC_CONCAT | SS | P(35);
+   }
+ 
++  debug_printf_parse("%s: t_tclass=tc=%x\n", __func__, t_tclass);
+   t_tclass = tc;
+   }
+   ltclass = t_tclass;
+@@ -1215,6 +1226,7 @@ static uint32_t next_token(uint32_t expe
+   EMSG_UNEXP_EOS : EMSG_UNEXP_TOKEN);
+   }
+ 
++  debug_printf_parse("%s: returning, ltclass:%x t_double:%f\n", __func__, 
ltclass, t_double);
+   return ltclass;
+ #undef concat_inserted
+ #undef save_tclass
+@@ -1279,7 +1291,7 @@ static node *parse_expr(uint32_t iexp)
+   glptr = NULL;
+ 
+   } else if (tc & (TC_BINOP | TC_UOPPOST)) {
+-  debug_printf_parse("%s: TC_BINOP | TC_UOPPOST\n", 
__func__);

[OE-core] [poky][dunfell][PATCH] systemd: add packageconfig for wheel-group

2021-11-25 Thread sana kazi
From: Peter Bergin 

If the distro does not include the group 'wheel' systemd will
complain when trying to parse ACL rules for tmpfiles.d.

  systemd-tmpfiles[273]: Failed to parse ACL 
"d:group:adm:r-x,d:group:wheel:r-x": Invalid argument. Ignoring

Systemd has a configuration parameter to avoid using 'wheel'
group in the standard config files for tmpfiles. Add this as
a PACKAGECONFIG and enable it by default to keep default.

(From OE-Core rev: 1b5648e6aeb9837cb807ce086c26fbfaa16f6f8b)

Signed-off-by: Peter Bergin 
Signed-off-by: Richard Purdie 
(cherry picked from commit 457cc45f51e78a532930d0347de271f24ae0a2ee)

Upstream-Status: Backport
Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 meta/recipes-core/systemd/systemd_244.5.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd_244.5.bb 
b/meta/recipes-core/systemd/systemd_244.5.bb
index bf33b8d6a1..b6f5a47d63 100644
--- a/meta/recipes-core/systemd/systemd_244.5.bb
+++ b/meta/recipes-core/systemd/systemd_244.5.bb
@@ -96,6 +96,7 @@ PACKAGECONFIG ??= " \
 timesyncd \
 utmp \
 vconsole \
+wheel-group \
 xz \
 "
 
@@ -188,6 +189,7 @@ PACKAGECONFIG[sbinmerge] = 
"-Dsplit-bin=false,-Dsplit-bin=true"
 PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
 PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
 PACKAGECONFIG[vconsole] = 
"-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
+PACKAGECONFIG[wheel-group] = "-Dwheel-group=true, -Dwheel-group=false"
 # Verify keymaps on locale change
 PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
 PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#158823): 
https://lists.openembedded.org/g/openembedded-core/message/158823
Mute This Topic: https://lists.openembedded.org/mt/87314316/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [meta-oe][dunfell][PATCH 3/3] dovecot: Fix CVE-2020-12674

2021-10-07 Thread sana kazi
Added patch for CVE-2020-12674

Link: 
http://archive.ubuntu.com/ubuntu/pool/main/d/dovecot/dovecot_2.2.33.2-1ubuntu4.7.debian.tar.xz

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 ...uth-mech-rpa-Fail-on-zero-len-buffer.patch | 30 +++
 .../dovecot/dovecot_2.2.36.4.bb   |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0001-auth-mech-rpa-Fail-on-zero-len-buffer.patch

diff --git 
a/meta-networking/recipes-support/dovecot/dovecot/0001-auth-mech-rpa-Fail-on-zero-len-buffer.patch
 
b/meta-networking/recipes-support/dovecot/dovecot/0001-auth-mech-rpa-Fail-on-zero-len-buffer.patch
new file mode 100644
index 0..5580cd409
--- /dev/null
+++ 
b/meta-networking/recipes-support/dovecot/dovecot/0001-auth-mech-rpa-Fail-on-zero-len-buffer.patch
@@ -0,0 +1,30 @@
+From bd9d2fe7da833f0e4705a8280efc56930371806b Mon Sep 17 00:00:00 2001
+From: Aki Tuomi 
+Date: Wed, 6 May 2020 13:40:36 +0300
+Subject: [PATCH 1/3] auth: mech-rpa - Fail on zero len buffer
+
+---
+ src/auth/mech-rpa.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Signed-off-by: Sana Kazi 
+
+CVE: CVE-2020-12674
+Upstream-Status: Backport 
[http://archive.ubuntu.com/ubuntu/pool/main/d/dovecot/dovecot_2.2.33.2-1ubuntu4.7.debian.tar.xz]
+Comment: No change in any hunk
+
+diff --git a/src/auth/mech-rpa.c b/src/auth/mech-rpa.c
+index 08298ebdd6..2de8705b4f 100644
+--- a/src/auth/mech-rpa.c
 b/src/auth/mech-rpa.c
+@@ -224,7 +224,7 @@ rpa_read_buffer(pool_t pool, const unsigned char **data,
+   return 0;
+ 
+   len = *p++;
+-  if (p + len > end)
++  if (p + len > end || len == 0)
+   return 0;
+ 
+   *buffer = p_malloc(pool, len);
+-- 
+2.11.0
diff --git a/meta-networking/recipes-support/dovecot/dovecot_2.2.36.4.bb 
b/meta-networking/recipes-support/dovecot/dovecot_2.2.36.4.bb
index e36e51c28..29905196b 100644
--- a/meta-networking/recipes-support/dovecot/dovecot_2.2.36.4.bb
+++ b/meta-networking/recipes-support/dovecot/dovecot_2.2.36.4.bb
@@ -25,6 +25,7 @@ SRC_URI = 
"http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \
file://0013-lib-mail-Fix-parse_too_many_nested_mime_parts.patch \
file://buffer_free_fix.patch \
file://0002-lib-ntlm-Check-buffer-length-on-responses.patch \
+   file://0001-auth-mech-rpa-Fail-on-zero-len-buffer.patch \
"
 
 SRC_URI[md5sum] = "66c4d71858b214afee5b390ee602dee2"
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156724): 
https://lists.openembedded.org/g/openembedded-core/message/156724
Mute This Topic: https://lists.openembedded.org/mt/86145193/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [meta-oe][dunfell][PATCH 2/3] dovecot: Fix CVE-2020-12673

2021-10-07 Thread sana kazi
Added patch for CVE-2020-12673

Link: 
http://archive.ubuntu.com/ubuntu/pool/main/d/dovecot/dovecot_2.2.33.2-1ubuntu4.7.debian.tar.xz

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 ...tlm-Check-buffer-length-on-responses.patch | 37 +++
 .../dovecot/dovecot_2.2.36.4.bb   |  1 +
 2 files changed, 38 insertions(+)
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0002-lib-ntlm-Check-buffer-length-on-responses.patch

diff --git 
a/meta-networking/recipes-support/dovecot/dovecot/0002-lib-ntlm-Check-buffer-length-on-responses.patch
 
b/meta-networking/recipes-support/dovecot/dovecot/0002-lib-ntlm-Check-buffer-length-on-responses.patch
new file mode 100644
index 0..81aead8aa
--- /dev/null
+++ 
b/meta-networking/recipes-support/dovecot/dovecot/0002-lib-ntlm-Check-buffer-length-on-responses.patch
@@ -0,0 +1,37 @@
+Backport of:
+
+From 1c6405d3026e5ceae3d214d63945bba85251af4c Mon Sep 17 00:00:00 2001
+From: Aki Tuomi 
+Date: Mon, 18 May 2020 12:33:39 +0300
+Subject: [PATCH 2/3] lib-ntlm: Check buffer length on responses
+
+Add missing check for buffer length.
+
+If this is not checked, it is possible to send message which
+causes read past buffer bug.
+
+Broken in c7480644202e5451fbed448508ea29a25cffc99c
+---
+ src/lib-ntlm/ntlm-message.c | 5 +
+ 1 file changed, 5 insertions(+)
+
+Signed-off-by: Sana Kazi 
+
+CVE: CVE-2020-12673
+Upstream-Status: Backport 
[http://archive.ubuntu.com/ubuntu/pool/main/d/dovecot/dovecot_2.2.33.2-1ubuntu4.7.debian.tar.xz]
+Comment: No change in any hunk
+
+--- a/src/lib-ntlm/ntlm-message.c
 b/src/lib-ntlm/ntlm-message.c
+@@ -184,6 +184,11 @@ static int ntlmssp_check_buffer(const st
+   if (length == 0 && space == 0)
+   return 1;
+ 
++  if (length > data_size) {
++  *error = "buffer length out of bounds";
++  return 0;
++  }
++
+   if (offset >= data_size) {
+   *error = "buffer offset out of bounds";
+   return 0;
diff --git a/meta-networking/recipes-support/dovecot/dovecot_2.2.36.4.bb 
b/meta-networking/recipes-support/dovecot/dovecot_2.2.36.4.bb
index 407604c81..e36e51c28 100644
--- a/meta-networking/recipes-support/dovecot/dovecot_2.2.36.4.bb
+++ b/meta-networking/recipes-support/dovecot/dovecot_2.2.36.4.bb
@@ -24,6 +24,7 @@ SRC_URI = 
"http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \
file://0012-lib-mail-Fix-handling-trailing-in-MIME-boundaries.patch 
\
file://0013-lib-mail-Fix-parse_too_many_nested_mime_parts.patch \
file://buffer_free_fix.patch \
+   file://0002-lib-ntlm-Check-buffer-length-on-responses.patch \
"
 
 SRC_URI[md5sum] = "66c4d71858b214afee5b390ee602dee2"
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156723): 
https://lists.openembedded.org/g/openembedded-core/message/156723
Mute This Topic: https://lists.openembedded.org/mt/86145189/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [meta-oe][dunfell][PATCH 1/3] dovecot: Fix CVE-2020-12100

2021-10-07 Thread sana kazi
Added patches to fix CVE-2020-12100

Link: 
http://archive.ubuntu.com/ubuntu/pool/main/d/dovecot/dovecot_2.2.33.2-1ubuntu4.7.debian.tar.xz

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 ...-parser-Add-a-message_part_finish-he.patch |  76 +++
 ...-parser-Change-message_part_append-t.patch |  71 +++
 ...-parser-Optimize-updating-children_c.patch |  49 +
 ...-parser-Optimize-appending-new-part-.patch |  88 
 ...-parser-Minor-code-cleanup-to-findin.patch |  45 +
 ...-parser-Truncate-excessively-long-MI.patch | 163 +++
 ...-parser-Optimize-boundary-lookups-wh.patch |  72 +++
 ...-parser-Add-boundary_remove_until-he.patch |  50 +
 ...-parser-Don-t-use-memory-pool-for-pa.patch | 169 
 ...-parser-Support-limiting-max-number-.patch | 188 ++
 ...-parser-Support-limiting-max-number-.patch |  87 
 ...handling-trailing-in-MIME-boundaries.patch | 133 +
 ...Fix-parse_too_many_nested_mime_parts.patch |  32 +++
 .../dovecot/dovecot/buffer_free_fix.patch |  27 +++
 .../dovecot/dovecot_2.2.36.4.bb   |  14 ++
 15 files changed, 1264 insertions(+)
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0001-lib-mail-message-parser-Add-a-message_part_finish-he.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0002-lib-mail-message-parser-Change-message_part_append-t.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0003-lib-mail-message-parser-Optimize-updating-children_c.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0004-lib-mail-message-parser-Optimize-appending-new-part-.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0005-lib-mail-message-parser-Minor-code-cleanup-to-findin.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0006-lib-mail-message-parser-Truncate-excessively-long-MI.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0007-lib-mail-message-parser-Optimize-boundary-lookups-wh.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0008-lib-mail-message-parser-Add-boundary_remove_until-he.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0009-lib-mail-message-parser-Don-t-use-memory-pool-for-pa.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0010-lib-mail-message-parser-Support-limiting-max-number-.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0011-lib-mail-message-parser-Support-limiting-max-number-.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0012-lib-mail-Fix-handling-trailing-in-MIME-boundaries.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/0013-lib-mail-Fix-parse_too_many_nested_mime_parts.patch
 create mode 100644 
meta-networking/recipes-support/dovecot/dovecot/buffer_free_fix.patch

diff --git 
a/meta-networking/recipes-support/dovecot/dovecot/0001-lib-mail-message-parser-Add-a-message_part_finish-he.patch
 
b/meta-networking/recipes-support/dovecot/dovecot/0001-lib-mail-message-parser-Add-a-message_part_finish-he.patch
new file mode 100644
index 0..583f71ca5
--- /dev/null
+++ 
b/meta-networking/recipes-support/dovecot/dovecot/0001-lib-mail-message-parser-Add-a-message_part_finish-he.patch
@@ -0,0 +1,76 @@
+From 667d353b0f217372e8cc43ea4fe13466689c7ed0 Mon Sep 17 00:00:00 2001
+From: Timo Sirainen 
+Date: Thu, 23 Apr 2020 11:33:31 +0300
+Subject: [PATCH 01/13] lib-mail: message-parser - Add a message_part_finish()
+ helper function
+
+---
+ src/lib-mail/message-parser.c | 25 -
+ 1 file changed, 12 insertions(+), 13 deletions(-)
+
+Signed-off-by: Sana Kazi 
+
+CVE: CVE-2020-12100
+Upstream-Status: Backport 
[http://archive.ubuntu.com/ubuntu/pool/main/d/dovecot/dovecot_2.2.33.2-1ubuntu4.7.debian.tar.xz]
+Comment: No change in any hunk
+
+diff --git a/src/lib-mail/message-parser.c b/src/lib-mail/message-parser.c
+index b1de1950a..aaa8dd8b7 100644
+--- a/src/lib-mail/message-parser.c
 b/src/lib-mail/message-parser.c
+@@ -195,6 +195,13 @@ message_part_append(pool_t pool, struct message_part 
*parent)
+   return part;
+ }
+ 
++static void message_part_finish(struct message_parser_ctx *ctx)
++{
++  message_size_add(>part->parent->body_size, >part->body_size);
++  message_size_add(>part->parent->body_size, 
>part->header_size);
++  ctx->part = ctx->part->parent;
++}
++
+ static void parse_next_body_multipart_init(struct message_parser_ctx *ctx)
+ {
+   struct message_boundary *b;
+@@ -312,19 +319,16 @@ static int parse_part_finish(struct message_parser_ctx 
*ctx,
+struct message_boundary *boundary,
+struct message_block *block_r, bool first_line)
+ {
+-  struct message_part *part;
+   size_t line_size;
+ 
+   

[OE-core] [poky][dunfell][PATCH] openssh: Fix CVE-2021-28041

2021-09-30 Thread sana kazi
Added patch to fix CVE-2021-28041.

Link:
http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_8.2p1-4ubuntu0.3.debian.tar.xz

Signed-off-by: Sana Kazi 
Signed-off-by: Sana Kazi 
---
 .../openssh/openssh/CVE-2021-28041.patch  | 20 +++
 .../openssh/openssh_8.2p1.bb  |  1 +
 2 files changed, 21 insertions(+)
 create mode 100644 
meta/recipes-connectivity/openssh/openssh/CVE-2021-28041.patch

diff --git a/meta/recipes-connectivity/openssh/openssh/CVE-2021-28041.patch 
b/meta/recipes-connectivity/openssh/openssh/CVE-2021-28041.patch
new file mode 100644
index 00..9fd7e932d1
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/CVE-2021-28041.patch
@@ -0,0 +1,20 @@
+Description: fix double-free memory corruption in ssh-agent
+Author: Marc Deslauriers 
+Origin: minimal fix for 
https://github.com/openssh/openssh-portable/commit/e04fd6dde16de1cdc5a4d9946397ff60d96568db
+
+Signed-off-by: Sana Kazi 
+
+CVE: CVE-2021-28041
+Upstream-Status: Backport 
[http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_8.2p1-4ubuntu0.3.debian.tar.xz]
+Comment: No change in any hunk
+
+--- a/ssh-agent.c
 b/ssh-agent.c
+@@ -496,6 +496,7 @@ process_add_identity(SocketEntry *e)
+   goto err;
+   }
+   free(ext_name);
++  ext_name = NULL;
+   break;
+   default:
+   error("%s: Unknown constraint %d", __func__, ctype);
diff --git a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb 
b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
index 64a0a72a8f..5f03bdc877 100644
--- a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
@@ -25,6 +25,7 @@ SRC_URI = 
"http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
file://sshd_check_keys \
file://add-test-support-for-busybox.patch \
file://CVE-2020-14145.patch \
+   file://CVE-2021-28041.patch \
"
 SRC_URI[md5sum] = "3076e6413e8dbe56d33848c1054ac091"
 SRC_URI[sha256sum] = 
"43925151e6cf6cee1450190c0e9af4dc36b41c12737619edff8bcebdff64e671"
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156485): 
https://lists.openembedded.org/g/openembedded-core/message/156485
Mute This Topic: https://lists.openembedded.org/mt/85968798/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [poky][master][PATCH] test_buildhistory: Add test to verify that LICENSE is added

2021-08-09 Thread sana kazi
Hi,

Could you please review below patch?

Regards,
Sana Kazi

On Mon, 26 Jul 2021 at 09:16, Sana Kazi  wrote:

> From: Sana Kazi 
>
> Added test case which uses BUILDHISTORY_EXPORT_RECIPE_VARIABLES
> and BUILDHISTORY_EXPORT_PACKAGE_VARIABLES to add LICENSE for glibc as a
> sample recipe to buildhistory and the test verifies that expected
> license value is written in latest file.
>
> Signed-off-by: Sana Kazi 
> ---
>  .../recipes-test/glibc/glibc_%.bbappend   |  2 +
>  .../oeqa/selftest/cases/test_buildhistory.py  | 48 +++
>  2 files changed, 50 insertions(+)
>  create mode 100644 meta-selftest/recipes-test/glibc/glibc_%.bbappend
>  create mode 100644 meta/lib/oeqa/selftest/cases/test_buildhistory.py
>
> diff --git a/meta-selftest/recipes-test/glibc/glibc_%.bbappend
> b/meta-selftest/recipes-test/glibc/glibc_%.bbappend
> new file mode 100644
> index 00..205720982c
> --- /dev/null
> +++ b/meta-selftest/recipes-test/glibc/glibc_%.bbappend
> @@ -0,0 +1,2 @@
> +# This bbappend is used to alter the recipe using the test_recipe.inc
> file created by tests.
> +include test_recipe.inc
> diff --git a/meta/lib/oeqa/selftest/cases/test_buildhistory.py
> b/meta/lib/oeqa/selftest/cases/test_buildhistory.py
> new file mode 100644
> index 00..2f1bd54599
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/cases/test_buildhistory.py
> @@ -0,0 +1,48 @@
> +import unittest
> +from oeqa.selftest.case import OESelftestTestCase
> +from oeqa.selftest.cases.buildhistory import BuildhistoryBase
> +from oeqa.utils.commands import bitbake, get_bb_var
> +
> +class BuildhistoryTests(BuildhistoryBase):
> +
> +def test_write_license_to_latest_recipe(self):
> +target = 'glibc'
> +recipe_variables = []
> +self.write_recipeinc(target,
> 'BUILDHISTORY_EXPORT_RECIPE_VARIABLES += \"LICENSE\"')
> +self.run_buildhistory_operation(target)
> +add_buildhistory_config = 'PACKAGE_CLASSES = \"package_ipk\"'
> +self.append_config(add_buildhistory_config)
> +pkghistdir = get_bb_var('BUILDHISTORY_DIR')
> +PACKAGE_ARCH = get_bb_var('MULTIMACH_TARGET_SYS')
> +bitbake('-c package_write_ipk -f %s' % target)
> +infofile = "{}/packages/{}/{}/latest".format(pkghistdir,
> PACKAGE_ARCH, target)
> +expected = "LICENSE = GPLv2 & LGPLv2.1"
> +result = False
> +with open(infofile, "r") as f:
> +for line in f:
> +if line.strip() == expected:
> +result = True
> +break
> +if not result:
> +raise AssertionError("Expected License not found")
> +
> +def test_write_license_to_latest_package(self):
> +target = 'glibc'
> +recipe_variables = []
> +self.write_recipeinc(target,
> 'BUILDHISTORY_EXPORT_PACKAGE_VARIABLES += \"LICENSE\"')
> +self.run_buildhistory_operation(target)
> +add_buildhistory_config = 'PACKAGE_CLASSES = \"package_ipk\"'
> +self.append_config(add_buildhistory_config)
> +bitbake('-c package_write_ipk -f %s' % target)
> +pkghistdir = get_bb_var('BUILDHISTORY_DIR')
> +PACKAGE_ARCH = get_bb_var('MULTIMACH_TARGET_SYS')
> +infofile = "{}/packages/{}/{}/{}-dbg/latest".format(pkghistdir,
> PACKAGE_ARCH, target, target)
> +expected = "LICENSE = GPLv2 & LGPLv2.1"
> +result = False
> +with open(infofile, "r") as f:
> +for line in f:
> +if line.strip() == expected:
> +result = True
> +break
> +if not result:
> +raise AssertionError("Expected License not found")
> --
> 2.17.1
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154602): 
https://lists.openembedded.org/g/openembedded-core/message/154602
Mute This Topic: https://lists.openembedded.org/mt/84451836/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [poky][master][PATCH] buildhistory.bbclass: Enable exporting more recipe and package data

2021-08-09 Thread sana kazi
Hi,

Could you please review the patch for master branch to enable exporting
more recipe and package data?

Regards,
Sana Kazi

On Mon, 26 Jul 2021 at 09:15, Sana Kazi  wrote:

> From: Sana Kazi 
>
> Used BUILDHISTORY_EXPORT_RECIPE_VARIABLES and
> BUILDHISTORY_EXPORT_PACKAGE_VARIABLES to export recipe and package
> data to the latest file of buildhistory and sorted it alphabetically.
>
> This makes extending data in buildhistory git tree simple and avoids
> patches to it for users who care about things like SRC_URI and like
> to track it in buildhistory git tree.
>
> Now we can add additional information as per our requirement to the
> buildhistory like LICENSE, SRC_URI AND MAINTAINER to the buildhistory
> by appending them in a recipe or distro specific conf file as follows:
>
> BUILDHISTORY_EXPORT_RECIPE_VARIABLES += "MAINTAINER"
> BUILDHISTORY_EXPORT_PACKAGE_VARIABLES += "MAINTAINER"
>
> Signed-off-by: Sana Kazi 
> ---
>  meta-poky/conf/distro/poky.conf   |   3 +
>  meta/classes/buildhistory.bbclass | 107 +++---
>  2 files changed, 71 insertions(+), 39 deletions(-)
>
> diff --git a/meta-poky/conf/distro/poky.conf
> b/meta-poky/conf/distro/poky.conf
> index 522cc92f74..2280e95569 100644
> --- a/meta-poky/conf/distro/poky.conf
> +++ b/meta-poky/conf/distro/poky.conf
> @@ -76,3 +76,6 @@ INHERIT += "reproducible_build"
>
>  BB_SIGNATURE_HANDLER ?= "OEEquivHash"
>  BB_HASHSERVE ??= "auto"
> +
> +BUILDHISTORY_EXPORT_RECIPE_VARIABLES ?= "PR PV PE LAYER DEPENDS PACKAGES
> LICENSE SRC_URI CONFIG"
> +BUILDHISTORY_EXPORT_PACKAGE_VARIABLES ?= "PE PV PR PKG PKGE PKGV PKGR
> RPROVIDES RDEPENDS RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS PKGSIZE FILES
> FILELIST"
> diff --git a/meta/classes/buildhistory.bbclass
> b/meta/classes/buildhistory.bbclass
> index 55b12d7893..9b1542643e 100644
> --- a/meta/classes/buildhistory.bbclass
> +++ b/meta/classes/buildhistory.bbclass
> @@ -220,7 +220,6 @@ python buildhistory_emit_pkghistory() {
>  pv = d.getVar('PV')
>  pr = d.getVar('PR')
>  layer = bb.utils.get_file_layer(d.getVar('FILE'), d)
> -license = d.getVar('LICENSE')
>
>  pkgdata_dir = d.getVar('PKGDATA_DIR')
>  packages = ""
> @@ -258,12 +257,11 @@ python buildhistory_emit_pkghistory() {
>  rcpinfo.pe = pe
>  rcpinfo.pv = pv
>  rcpinfo.pr = pr
> -rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS')
> or ""))
>  rcpinfo.packages = packages
>  rcpinfo.layer = layer
> -rcpinfo.license = license
>  rcpinfo.config =
> sortlist(oe.utils.squashspaces(d.getVar('PACKAGECONFIG') or ""))
> -rcpinfo.src_uri = oe.utils.squashspaces(d.getVar('SRC_URI') or "")
> +export_recipe_variables =
> d.getVar('BUILDHISTORY_EXPORT_RECIPE_VARIABLES') or ''
> +rcpinfo.export_recipe_variables = export_recipe_variables
>  write_recipehistory(rcpinfo, d)
>
>  bb.build.exec_func("read_subpackage_metadata", d)
> @@ -317,6 +315,9 @@ python buildhistory_emit_pkghistory() {
>
>  pkginfo.size = int(localdata.getVar('PKGSIZE') or '0')
>
> +export_package_variables =
> d.getVar('BUILDHISTORY_EXPORT_PACKAGE_VARIABLES') or ''
> +pkginfo.export_package_variables = export_package_variables
> +
>  write_pkghistory(pkginfo, d)
>
>  # Create files-in-.txt files containing a list of files
> of each recipe's package
> @@ -365,17 +366,22 @@ def write_recipehistory(rcpinfo, d):
>  pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
>
>  infofile = os.path.join(pkghistdir, "latest")
> +export_recipe_variables = set(rcpinfo.export_recipe_variables.split())
> +ret = []
>  with open(infofile, "w") as f:
> -if rcpinfo.pe != "0":
> -f.write(u"PE = %s\n" %  rcpinfo.pe)
> -f.write(u"PV = %s\n" %  rcpinfo.pv)
> -f.write(u"PR = %s\n" %  rcpinfo.pr)
> -f.write(u"DEPENDS = %s\n" %  rcpinfo.depends)
> -f.write(u"PACKAGES = %s\n" %  rcpinfo.packages)
> -f.write(u"LAYER = %s\n" %  rcpinfo.layer)
> -f.write(u"LICENSE = %s\n" %  rcpinfo.license)
> -f.write(u"CONFIG = %s\n" %  rcpinfo.config)
> -f.write(u"SRC_URI = %s\n" %  rcpinfo.src_uri)
> +for var in export_recipe_variables:
> +if var == "PE":
> +if rcpinfo.pe != "0":
> +ret.append("%s = %s" % (var, rcpinfo.pe))
> +elif var == "LAYER":
> +

[OE-core] [poky][master][PATCH] test_buildhistory: Add test to verify that LICENSE is added

2021-07-25 Thread sana kazi
From: Sana Kazi 

Added test case which uses BUILDHISTORY_EXPORT_RECIPE_VARIABLES
and BUILDHISTORY_EXPORT_PACKAGE_VARIABLES to add LICENSE for glibc as a
sample recipe to buildhistory and the test verifies that expected
license value is written in latest file.

Signed-off-by: Sana Kazi 
---
 .../recipes-test/glibc/glibc_%.bbappend   |  2 +
 .../oeqa/selftest/cases/test_buildhistory.py  | 48 +++
 2 files changed, 50 insertions(+)
 create mode 100644 meta-selftest/recipes-test/glibc/glibc_%.bbappend
 create mode 100644 meta/lib/oeqa/selftest/cases/test_buildhistory.py

diff --git a/meta-selftest/recipes-test/glibc/glibc_%.bbappend 
b/meta-selftest/recipes-test/glibc/glibc_%.bbappend
new file mode 100644
index 00..205720982c
--- /dev/null
+++ b/meta-selftest/recipes-test/glibc/glibc_%.bbappend
@@ -0,0 +1,2 @@
+# This bbappend is used to alter the recipe using the test_recipe.inc file 
created by tests.
+include test_recipe.inc
diff --git a/meta/lib/oeqa/selftest/cases/test_buildhistory.py 
b/meta/lib/oeqa/selftest/cases/test_buildhistory.py
new file mode 100644
index 00..2f1bd54599
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/test_buildhistory.py
@@ -0,0 +1,48 @@
+import unittest
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.selftest.cases.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import bitbake, get_bb_var
+
+class BuildhistoryTests(BuildhistoryBase):
+
+def test_write_license_to_latest_recipe(self):
+target = 'glibc'
+recipe_variables = []
+self.write_recipeinc(target, 'BUILDHISTORY_EXPORT_RECIPE_VARIABLES += 
\"LICENSE\"')
+self.run_buildhistory_operation(target)
+add_buildhistory_config = 'PACKAGE_CLASSES = \"package_ipk\"'
+self.append_config(add_buildhistory_config)
+pkghistdir = get_bb_var('BUILDHISTORY_DIR')
+PACKAGE_ARCH = get_bb_var('MULTIMACH_TARGET_SYS')
+bitbake('-c package_write_ipk -f %s' % target)
+infofile = "{}/packages/{}/{}/latest".format(pkghistdir, PACKAGE_ARCH, 
target)
+expected = "LICENSE = GPLv2 & LGPLv2.1"
+result = False
+with open(infofile, "r") as f:
+for line in f:
+if line.strip() == expected:
+result = True
+break
+if not result:
+raise AssertionError("Expected License not found")
+
+def test_write_license_to_latest_package(self):
+target = 'glibc'
+recipe_variables = []
+self.write_recipeinc(target, 'BUILDHISTORY_EXPORT_PACKAGE_VARIABLES += 
\"LICENSE\"')
+self.run_buildhistory_operation(target)
+add_buildhistory_config = 'PACKAGE_CLASSES = \"package_ipk\"'
+self.append_config(add_buildhistory_config)
+bitbake('-c package_write_ipk -f %s' % target)
+pkghistdir = get_bb_var('BUILDHISTORY_DIR')
+PACKAGE_ARCH = get_bb_var('MULTIMACH_TARGET_SYS')
+infofile = "{}/packages/{}/{}/{}-dbg/latest".format(pkghistdir, 
PACKAGE_ARCH, target, target)
+expected = "LICENSE = GPLv2 & LGPLv2.1"
+result = False
+with open(infofile, "r") as f:
+for line in f:
+if line.strip() == expected:
+result = True
+break
+if not result:
+raise AssertionError("Expected License not found")
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154136): 
https://lists.openembedded.org/g/openembedded-core/message/154136
Mute This Topic: https://lists.openembedded.org/mt/84451836/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [poky][master][PATCH] buildhistory.bbclass: Enable exporting more recipe and package data

2021-07-25 Thread sana kazi
From: Sana Kazi 

Used BUILDHISTORY_EXPORT_RECIPE_VARIABLES and
BUILDHISTORY_EXPORT_PACKAGE_VARIABLES to export recipe and package
data to the latest file of buildhistory and sorted it alphabetically.

This makes extending data in buildhistory git tree simple and avoids
patches to it for users who care about things like SRC_URI and like
to track it in buildhistory git tree.

Now we can add additional information as per our requirement to the
buildhistory like LICENSE, SRC_URI AND MAINTAINER to the buildhistory
by appending them in a recipe or distro specific conf file as follows:

BUILDHISTORY_EXPORT_RECIPE_VARIABLES += "MAINTAINER"
BUILDHISTORY_EXPORT_PACKAGE_VARIABLES += "MAINTAINER"

Signed-off-by: Sana Kazi 
---
 meta-poky/conf/distro/poky.conf   |   3 +
 meta/classes/buildhistory.bbclass | 107 +++---
 2 files changed, 71 insertions(+), 39 deletions(-)

diff --git a/meta-poky/conf/distro/poky.conf b/meta-poky/conf/distro/poky.conf
index 522cc92f74..2280e95569 100644
--- a/meta-poky/conf/distro/poky.conf
+++ b/meta-poky/conf/distro/poky.conf
@@ -76,3 +76,6 @@ INHERIT += "reproducible_build"
 
 BB_SIGNATURE_HANDLER ?= "OEEquivHash"
 BB_HASHSERVE ??= "auto"
+
+BUILDHISTORY_EXPORT_RECIPE_VARIABLES ?= "PR PV PE LAYER DEPENDS PACKAGES 
LICENSE SRC_URI CONFIG"
+BUILDHISTORY_EXPORT_PACKAGE_VARIABLES ?= "PE PV PR PKG PKGE PKGV PKGR 
RPROVIDES RDEPENDS RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS PKGSIZE FILES 
FILELIST"
diff --git a/meta/classes/buildhistory.bbclass 
b/meta/classes/buildhistory.bbclass
index 55b12d7893..9b1542643e 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -220,7 +220,6 @@ python buildhistory_emit_pkghistory() {
 pv = d.getVar('PV')
 pr = d.getVar('PR')
 layer = bb.utils.get_file_layer(d.getVar('FILE'), d)
-license = d.getVar('LICENSE')
 
 pkgdata_dir = d.getVar('PKGDATA_DIR')
 packages = ""
@@ -258,12 +257,11 @@ python buildhistory_emit_pkghistory() {
 rcpinfo.pe = pe
 rcpinfo.pv = pv
 rcpinfo.pr = pr
-rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS') or 
""))
 rcpinfo.packages = packages
 rcpinfo.layer = layer
-rcpinfo.license = license
 rcpinfo.config = sortlist(oe.utils.squashspaces(d.getVar('PACKAGECONFIG') 
or ""))
-rcpinfo.src_uri = oe.utils.squashspaces(d.getVar('SRC_URI') or "")
+export_recipe_variables = d.getVar('BUILDHISTORY_EXPORT_RECIPE_VARIABLES') 
or ''
+rcpinfo.export_recipe_variables = export_recipe_variables
 write_recipehistory(rcpinfo, d)
 
 bb.build.exec_func("read_subpackage_metadata", d)
@@ -317,6 +315,9 @@ python buildhistory_emit_pkghistory() {
 
 pkginfo.size = int(localdata.getVar('PKGSIZE') or '0')
 
+export_package_variables = 
d.getVar('BUILDHISTORY_EXPORT_PACKAGE_VARIABLES') or ''
+pkginfo.export_package_variables = export_package_variables
+
 write_pkghistory(pkginfo, d)
 
 # Create files-in-.txt files containing a list of files of 
each recipe's package
@@ -365,17 +366,22 @@ def write_recipehistory(rcpinfo, d):
 pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
 
 infofile = os.path.join(pkghistdir, "latest")
+export_recipe_variables = set(rcpinfo.export_recipe_variables.split())
+ret = []
 with open(infofile, "w") as f:
-if rcpinfo.pe != "0":
-f.write(u"PE = %s\n" %  rcpinfo.pe)
-f.write(u"PV = %s\n" %  rcpinfo.pv)
-f.write(u"PR = %s\n" %  rcpinfo.pr)
-f.write(u"DEPENDS = %s\n" %  rcpinfo.depends)
-f.write(u"PACKAGES = %s\n" %  rcpinfo.packages)
-f.write(u"LAYER = %s\n" %  rcpinfo.layer)
-f.write(u"LICENSE = %s\n" %  rcpinfo.license)
-f.write(u"CONFIG = %s\n" %  rcpinfo.config)
-f.write(u"SRC_URI = %s\n" %  rcpinfo.src_uri)
+for var in export_recipe_variables:
+if var == "PE":
+if rcpinfo.pe != "0":
+ret.append("%s = %s" % (var, rcpinfo.pe))
+elif var == "LAYER":
+ret.append("%s = %s" % (var, rcpinfo.layer))
+elif var == "CONFIG":
+ret.append("%s = %s" % (var, rcpinfo.config))
+else:
+ret.append("%s = %s" % (var," 
".join((str(d.getVar(var)).split()
+ret.sort()
+for element in ret:
+f.write(element + "\n")
 
 write_latest_srcrev(d, pkghistdir)
 
@@ -389,32 +395,55 @@ def write_pkghistory(pkginfo, d):
 bb.utils.mkdirhier(pkgpath)
 
 infofile = os.path.join(pkgpath, "latest")
+export_package_variables = set(pkg

[OE-core] [poky][dunfell][PATCH] test_buildhistory: Add test to verify that LICENSE is added

2021-07-19 Thread sana kazi
From: Sana Kazi 

Added test case which uses BUILDHISTORY_EXPORT_RECIPE_VARIABLES
and BUILDHISTORY_EXPORT_PACKAGE_VARIABLES to add LICENSE for glibc as a
sample recipe to buildhistory and the test verifies that expected
license value is written in latest file.

Signed-off-by: Sana Kazi 
---
 .../recipes-test/glibc/glibc_%.bbappend   |  2 +
 .../oeqa/selftest/cases/test_buildhistory.py  | 46 +++
 2 files changed, 48 insertions(+)
 create mode 100644 meta-selftest/recipes-test/glibc/glibc_%.bbappend
 create mode 100644 meta/lib/oeqa/selftest/cases/test_buildhistory.py

diff --git a/meta-selftest/recipes-test/glibc/glibc_%.bbappend 
b/meta-selftest/recipes-test/glibc/glibc_%.bbappend
new file mode 100644
index 00..205720982c
--- /dev/null
+++ b/meta-selftest/recipes-test/glibc/glibc_%.bbappend
@@ -0,0 +1,2 @@
+# This bbappend is used to alter the recipe using the test_recipe.inc file 
created by tests.
+include test_recipe.inc
diff --git a/meta/lib/oeqa/selftest/cases/test_buildhistory.py 
b/meta/lib/oeqa/selftest/cases/test_buildhistory.py
new file mode 100644
index 00..c6a2aad54e
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/test_buildhistory.py
@@ -0,0 +1,46 @@
+import unittest
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.selftest.cases.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import bitbake, get_bb_var
+
+class BuildhistoryTests(BuildhistoryBase):
+
+def test_write_license_to_latest_recipe(self):
+target = 'glibc'
+self.write_recipeinc(target, 'BUILDHISTORY_EXPORT_RECIPE_VARIABLES += 
\"LICENSE\"')
+self.run_buildhistory_operation(target)
+add_buildhistory_config = 'PACKAGE_CLASSES = \"package_ipk\"'
+self.append_config(add_buildhistory_config)
+pkghistdir = get_bb_var('BUILDHISTORY_DIR')
+PACKAGE_ARCH = get_bb_var('MULTIMACH_TARGET_SYS')
+bitbake('-c package_write_ipk -f %s' % target)
+infofile = "{}/packages/{}/{}/latest".format(pkghistdir, PACKAGE_ARCH, 
target)
+expected = "LICENSE = GPLv2 & LGPLv2.1"
+result = False
+with open(infofile, "r") as f:
+for line in f:
+if line.strip() == expected:
+result = True
+break
+if not result:
+raise AssertionError("Expected License not found")
+
+def test_write_license_to_latest_package(self):
+target = 'glibc'
+self.write_recipeinc(target, 'BUILDHISTORY_EXPORT_PACKAGE_VARIABLES += 
\"LICENSE\"')
+self.run_buildhistory_operation(target)
+add_buildhistory_config = 'PACKAGE_CLASSES = \"package_ipk\"'
+self.append_config(add_buildhistory_config)
+bitbake('-c package_write_ipk -f %s' % target)
+pkghistdir = get_bb_var('BUILDHISTORY_DIR')
+PACKAGE_ARCH = get_bb_var('MULTIMACH_TARGET_SYS')
+infofile = "{}/packages/{}/{}/{}-dbg/latest".format(pkghistdir, 
PACKAGE_ARCH, target, target)
+expected = "LICENSE = GPLv2 & LGPLv2.1"
+result = False
+with open(infofile, "r") as f:
+for line in f:
+if line.strip() == expected:
+result = True
+break
+if not result:
+raise AssertionError("Expected License not found")
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#153991): 
https://lists.openembedded.org/g/openembedded-core/message/153991
Mute This Topic: https://lists.openembedded.org/mt/84305643/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [poky][dunfell][PATCH] buildhistory.bbclass: Enable exporting more recipe and package data

2021-07-19 Thread sana kazi
From: Sana Kazi 

Used BUILDHISTORY_EXPORT_RECIPE_VARIABLES and
BUILDHISTORY_EXPORT_PACKAGE_VARIABLES to export recipe and package
data to the latest file of buildhistory and sorted it alphabetically.

This makes extending data in buildhistory git tree simple and avoids
patches to it for users who care about things like SRC_URI and like
to track it in buildhistory git tree.

Now we can add additional information as per our requirement to the
buildhistory like LICENSE, SRC_URI AND MAINTAINER to the buildhistory
by appending them in a recipe or distro specific conf file as follows:

BUILDHISTORY_EXPORT_RECIPE_VARIABLES += "LICENSE MAINTAINER SRC_URI"
BUILDHISTORY_EXPORT_PACKAGE_VARIABLES += "LICENSE MAINTAINER"

Signed-off-by: Sana Kazi 
---
 meta-poky/conf/distro/poky.conf   |  2 +
 meta/classes/buildhistory.bbclass | 98 +--
 2 files changed, 68 insertions(+), 32 deletions(-)

diff --git a/meta-poky/conf/distro/poky.conf b/meta-poky/conf/distro/poky.conf
index 92e9ba5477..d766d4b1f5 100644
--- a/meta-poky/conf/distro/poky.conf
+++ b/meta-poky/conf/distro/poky.conf
@@ -89,3 +89,5 @@ INHERIT += "reproducible_build"
 
 BB_SIGNATURE_HANDLER ?= "OEEquivHash"
 BB_HASHSERVE ??= "auto"
+BUILDHISTORY_EXPORT_RECIPE_VARIABLES ?= "PR PV PE LAYER DEPENDS PACKAGES"
+BUILDHISTORY_EXPORT_PACKAGE_VARIABLES ?= "PE PV PR PKG PKGE PKGV PKGR 
RPROVIDES RDEPENDS RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS PKGSIZE FILES 
FILELIST"
diff --git a/meta/classes/buildhistory.bbclass 
b/meta/classes/buildhistory.bbclass
index 44a66df962..a2888666d9 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -254,6 +254,8 @@ python buildhistory_emit_pkghistory() {
 rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS') or 
""))
 rcpinfo.packages = packages
 rcpinfo.layer = layer
+export_recipe_variables = d.getVar('BUILDHISTORY_EXPORT_RECIPE_VARIABLES') 
or ''
+rcpinfo.export_recipe_variables = export_recipe_variables
 write_recipehistory(rcpinfo, d)
 
 pkgdest = d.getVar('PKGDEST')
@@ -312,6 +314,9 @@ python buildhistory_emit_pkghistory() {
 
 pkginfo.size = int(pkgdata['PKGSIZE'])
 
+export_package_variables = 
d.getVar('BUILDHISTORY_EXPORT_PACKAGE_VARIABLES') or ''
+pkginfo.export_package_variables = export_package_variables
+
 write_pkghistory(pkginfo, d)
 
 # Create files-in-.txt files containing a list of files of 
each recipe's package
@@ -360,14 +365,20 @@ def write_recipehistory(rcpinfo, d):
 pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
 
 infofile = os.path.join(pkghistdir, "latest")
+export_recipe_variables = set(rcpinfo.export_recipe_variables.split())
+ret = []
 with open(infofile, "w") as f:
-if rcpinfo.pe != "0":
-f.write(u"PE = %s\n" %  rcpinfo.pe)
-f.write(u"PV = %s\n" %  rcpinfo.pv)
-f.write(u"PR = %s\n" %  rcpinfo.pr)
-f.write(u"DEPENDS = %s\n" %  rcpinfo.depends)
-f.write(u"PACKAGES = %s\n" %  rcpinfo.packages)
-f.write(u"LAYER = %s\n" %  rcpinfo.layer)
+for var in export_recipe_variables:
+if var == "PE":
+if rcpinfo.pe != "0":
+ret.append("%s = %s" % (var, rcpinfo.pe))
+elif var == "LAYER":
+ret.append("%s = %s" % (var, rcpinfo.layer))
+else:
+ret.append("%s = %s" % (var," 
".join((str(d.getVar(var)).split()
+ret.sort()
+for element in ret:
+f.write(element + "\n")
 
 write_latest_srcrev(d, pkghistdir)
 
@@ -381,32 +392,55 @@ def write_pkghistory(pkginfo, d):
 bb.utils.mkdirhier(pkgpath)
 
 infofile = os.path.join(pkgpath, "latest")
+export_package_variables = set(pkginfo.export_package_variables.split())
+ret = []
 with open(infofile, "w") as f:
-if pkginfo.pe != "0":
-f.write(u"PE = %s\n" %  pkginfo.pe)
-f.write(u"PV = %s\n" %  pkginfo.pv)
-f.write(u"PR = %s\n" %  pkginfo.pr)
-
-if pkginfo.pkg != pkginfo.name:
-f.write(u"PKG = %s\n" % pkginfo.pkg)
-if pkginfo.pkge != pkginfo.pe:
-f.write(u"PKGE = %s\n" % pkginfo.pkge)
-if pkginfo.pkgv != pkginfo.pv:
-f.write(u"PKGV = %s\n" % pkginfo.pkgv)
-if pkginfo.pkgr != pkginfo.pr:
-f.write(u"PKGR = %s\n" % pkginfo.pkgr)
-f.write(u"RPROVIDES = %s\n" %  pkginfo.rprovides)
-f.write(u"RDEPENDS = %s\n" %  pkginfo.rdepends)
-f.write(u"RRECOMMENDS = %s\n" %  pkginfo.rrecommends)
- 

Re: [OE-core] [poky][dunfell][PATCH] openssh: Whitelist CVE-2008-3844 and CVE-2020-15778

2021-04-05 Thread Sana Kazi
Hi Steve,

Whitelisted CVE-2020-15778 because it is reflected in recent CVE metrics which 
you mailed on Sunday.

 Thanks & Regards,

 Sana Kazi
 KPIT Technologies Limited


From: Steve Sakoman 
Sent: Tuesday, April 6, 2021 4:05 AM
To: Sana Kazi 
Cc: Patches and discussions about the oe-core layer 
; Khem Raj ; 
Nisha Parrakat ; Purushottam Choudhary 
; Harpritkaur Bhandari 

Subject: Re: [OE-core] [poky][dunfell][PATCH] openssh: Whitelist CVE-2008-3844 
and CVE-2020-15778

On Mon, Apr 5, 2021 at 3:30 AM Sana Kazi  wrote:
>
> Whitelisted below CVEs reported for openssh:
>
> CVE-2008-3844 was reported in OpenSSH on Red Hat Enterprise Linux
> and certain packages may have been compromised and has been fixed
> by Red Hat. This CVE is not applicable as our source is OpenBSD.
> Hence, this CVE  is not reported for other distros and
> can be whitelisted.
> Links:
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsecuritytracker.com%2Fid%3F1020730data=04%7C01%7CSana.Kazi%40kpit.com%7C8b8ab31f2f0142adf52e08d8f88323ea%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637532589452091655%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=AGj3kr88jZBCf2UPTYmok1x2orsmrY6AuLMBoTAmKSI%3Dreserved=0
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.securityfocus.com%2Fbid%2F30794data=04%7C01%7CSana.Kazi%40kpit.com%7C8b8ab31f2f0142adf52e08d8f88323ea%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637532589452091655%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=CNOSXhh%2BTAlkWkrnEpxS3v2p7JTwQH%2BL5idJyir1GOE%3Dreserved=0
>
> For CVE-2020-15778 OpenSSH through 8.3p1 is affected.
> Hence, it can be whitelisted for 8.2p1

This explanation doesn't make sense to me!  If 8.2p1 is affected, why
are you proposing to whitelist it?

Steve

> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnvd.nist.gov%2Fvuln%2Fdetail%2FCVE-2020-15778data=04%7C01%7CSana.Kazi%40kpit.com%7C8b8ab31f2f0142adf52e08d8f88323ea%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637532589452091655%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=OwC%2Flt6FcUUdt6aCUIk7mxk8a0QSC5%2F%2BLCX99yqZG2w%3Dreserved=0
>
> Signed-off-by: Sana Kazi 
> ---
>  meta/recipes-connectivity/openssh/openssh_8.2p1.bb | 14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb 
> b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
> index fe94f30503..f8037db986 100644
> --- a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
> +++ b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
> @@ -32,6 +32,20 @@ SRC_URI[sha256sum] = 
> "43925151e6cf6cee1450190c0e9af4dc36b41c12737619edff8bcebdff
>  # and when running in a Kerberos environment. As such it is not relevant to 
> OpenEmbedded
>  CVE_CHECK_WHITELIST += "CVE-2014-9278"
>
> +# CVE-2008-3844 was reported in OpenSSH on Red Hat Enterprise Linux
> +# and certain packages may have been compromised and has been fixed
> +# by Red Hat. This CVE is not applicable as our source is OpenBSD.
> +# Hence, this CVE  is not reported for other distros
> +# and can be marked whitelisted.
> +# 
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsecuritytracker.com%2Fid%3F1020730data=04%7C01%7CSana.Kazi%40kpit.com%7C8b8ab31f2f0142adf52e08d8f88323ea%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637532589452091655%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=AGj3kr88jZBCf2UPTYmok1x2orsmrY6AuLMBoTAmKSI%3Dreserved=0
> +# 
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.securityfocus.com%2Fbid%2F30794data=04%7C01%7CSana.Kazi%40kpit.com%7C8b8ab31f2f0142adf52e08d8f88323ea%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637532589452091655%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=CNOSXhh%2BTAlkWkrnEpxS3v2p7JTwQH%2BL5idJyir1GOE%3Dreserved=0
> +CVE_CHECK_WHITELIST += "CVE-2008-3844"
> +
> +# For CVE-2020-15778 OpenSSH through 8.3p1 is affected.
> +# Hence, it can be whitelisted for 8.2p1
> +# 
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnvd.nist.gov%2Fvuln%2Fdetail%2FCVE-2020-15778data=04%7C01%7CSana.Kazi%40kpit.com%7C8b8ab31f2f0142adf52e08d8f88323ea%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637532589452091655%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=OwC%2Flt6FcUUdt6aCUIk7mxk8a0QSC5%2F%2BLCX99yqZG2w%3Dreserved=0
> +CVE_CHECK_WHITELIST += "CVE-2020-15778"
> +
>  PAM_SRC_URI = "file://sshd"
>
>  inherit manpages userad

[OE-core] [poky][dunfell][PATCH] openssh: Whitelist CVE-2008-3844 and CVE-2020-15778

2021-04-05 Thread Sana Kazi
Whitelisted below CVEs reported for openssh:

CVE-2008-3844 was reported in OpenSSH on Red Hat Enterprise Linux
and certain packages may have been compromised and has been fixed
by Red Hat. This CVE is not applicable as our source is OpenBSD.
Hence, this CVE  is not reported for other distros and
can be whitelisted.
Links:
https://securitytracker.com/id?1020730
https://www.securityfocus.com/bid/30794

For CVE-2020-15778 OpenSSH through 8.3p1 is affected.
Hence, it can be whitelisted for 8.2p1
https://nvd.nist.gov/vuln/detail/CVE-2020-15778

Signed-off-by: Sana Kazi 
---
 meta/recipes-connectivity/openssh/openssh_8.2p1.bb | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb 
b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
index fe94f30503..f8037db986 100644
--- a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
@@ -32,6 +32,20 @@ SRC_URI[sha256sum] = 
"43925151e6cf6cee1450190c0e9af4dc36b41c12737619edff8bcebdff
 # and when running in a Kerberos environment. As such it is not relevant to 
OpenEmbedded
 CVE_CHECK_WHITELIST += "CVE-2014-9278"

+# CVE-2008-3844 was reported in OpenSSH on Red Hat Enterprise Linux
+# and certain packages may have been compromised and has been fixed
+# by Red Hat. This CVE is not applicable as our source is OpenBSD.
+# Hence, this CVE  is not reported for other distros
+# and can be marked whitelisted.
+# https://securitytracker.com/id?1020730
+# https://www.securityfocus.com/bid/30794
+CVE_CHECK_WHITELIST += "CVE-2008-3844"
+
+# For CVE-2020-15778 OpenSSH through 8.3p1 is affected.
+# Hence, it can be whitelisted for 8.2p1
+# https://nvd.nist.gov/vuln/detail/CVE-2020-15778
+CVE_CHECK_WHITELIST += "CVE-2020-15778"
+
 PAM_SRC_URI = "file://sshd"

 inherit manpages useradd update-rc.d update-alternatives systemd
--
2.17.1

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient, you are not 
authorized to read, print, retain copy, disseminate, distribute, or use this 
message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message. KPIT 
Technologies Ltd. does not accept any liability for virus infected mails.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#150210): 
https://lists.openembedded.org/g/openembedded-core/message/150210
Mute This Topic: https://lists.openembedded.org/mt/81863467/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [poky][dunfell][PATCHv2] openssh: fix CVE-2020-14145

2021-04-01 Thread Sana Kazi
Hi Steve,

I have verified the patch on dunfell branch and it builds successfully.
Please refer the attached do_patch log.

Thanks & Regards,

Sana Kazi
KPIT Technologies Limited



From: Steve Sakoman 
Sent: Wednesday, March 31, 2021 11:31 PM
To: Sana Kazi 
Cc: Patches and discussions about the oe-core layer 
; Khem Raj ; 
Nisha Parrakat ; Purushottam Choudhary 
; Harpritkaur Bhandari 

Subject: Re: [OE-core] [poky][dunfell][PATCHv2] openssh: fix CVE-2020-14145

V2 also fails to build:

ERROR: openssh-8.2p1-r0 do_patch: Command Error: 'quilt --quiltrc
/home/steve/builds/poky-contrib/build/tmp/work/core2-64-poky-linux/openssh/8.2p1-r0/recipe-sysroot-native/etc/quiltrc
push' exited with 0  Output:
Applying patch CVE-2020-14145.patch
patching file sshconnect2.c
Hunk #1 FAILED at 102.
Hunk #2 FAILED at 119.
Hunk #3 FAILED at 159.
3 out of 3 hunks FAILED -- rejects in file sshconnect2.c
Patch CVE-2020-14145.patch does not apply (enforce with -f)

Before submitting please verify that your patches both apply to the
head of the dunfell branch, and build as well!

Steve


On Wed, Mar 31, 2021 at 7:21 AM Sana Kazi  wrote:
>
> From: Lee Chee Yang 
>
> (From OE-Core rev: 38482edf1a31ed0735b746cf0ab3e1adda4199d1)
>
> Signed-off-by: Lee Chee Yang 
> Signed-off-by: Anuj Mittal 
> Signed-off-by: Richard Purdie 
> Signed-off-by: Sana Kazi 
> ---
>  .../openssh/openssh/CVE-2020-14145.patch  | 90 +++
>  .../openssh/openssh_8.2p1.bb  |  1 +
>  2 files changed, 91 insertions(+)
>  create mode 100644 
> meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch
>
> diff --git a/meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch 
> b/meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch
> new file mode 100644
> index 00..0046ee1a51
> --- /dev/null
> +++ b/meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch
> @@ -0,0 +1,90 @@
> +From b3855ff053f5078ec3d3c653cdaedefaa5fc362d Mon Sep 17 00:00:00 2001
> +From: "d...@openbsd.org" 
> +Date: Fri, 18 Sep 2020 05:23:03 +
> +Subject: [PATCH] upstream: tweak the client hostkey preference ordering
> + algorithm to
> +
> +prefer the default ordering if the user has a key that matches the
> +best-preference default algorithm.
> +
> +feedback and ok markus@
> +
> +OpenBSD-Commit-ID: a92dd7d7520ddd95c0a16786a7519e6d0167d35f
> +
> +Upstream-Status: Backport
> +[https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopenssh%2Fopenssh-portable%2Fcommit%2Fb3855ff053f5078ec3d3c653cdaedefaa5fc362ddata=04%7C01%7CSana.Kazi%40kpit.com%7C4b74e63f0ba745d0e18608d8f46f0bd8%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637528105076588451%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=FEdHjP9Fp%2BlrVEtby1zBa5W%2BlrkVHHFVJgMOk%2BvDusY%3Dreserved=0]
> +CVE: CVE-2020-14145
> +Signed-off-by: Chee Yang Lee 
> +
> +---
> + sshconnect2.c | 41 ++---
> + 1 file changed, 37 insertions(+), 2 deletions(-)
> +
> +diff --git a/sshconnect2.c b/sshconnect2.c
> +index 347e348c60..f64aae66af 100644
> +--- a/sshconnect2.c
>  b/sshconnect2.c
> +@@ -102,12 +102,25 @@ verify_host_key_callback(struct sshkey *hostkey, 
> struct ssh *ssh)
> +   return 0;
> + }
> +
> ++/* Returns the first item from a comma-separated algorithm list */
> ++static char *
> ++first_alg(const char *algs)
> ++{
> ++  char *ret, *cp;
> ++
> ++  ret = xstrdup(algs);
> ++  if ((cp = strchr(ret, ',')) != NULL)
> ++  *cp = '\0';
> ++  return ret;
> ++}
> ++
> + static char *
> + order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port)
> + {
> +-  char *oavail, *avail, *first, *last, *alg, *hostname, *ret;
> ++  char *oavail = NULL, *avail = NULL, *first = NULL, *last = NULL;
> ++  char *alg = NULL, *hostname = NULL, *ret = NULL, *best = NULL;
> +   size_t maxlen;
> +-  struct hostkeys *hostkeys;
> ++  struct hostkeys *hostkeys = NULL;
> +   int ktype;
> +   u_int i;
> +
> +@@ -119,6 +132,26 @@ order_hostkeyalgs(char *host, struct sockaddr 
> *hostaddr, u_short port)
> +   for (i = 0; i < options.num_system_hostfiles; i++)
> +   load_hostkeys(hostkeys, hostname, 
> options.system_hostfiles[i]);
> +
> ++  /*
> ++   * If a plain public key exists that matches the type of the best
> ++   * preference HostkeyAlgorithms, then use the whole list as is.
> ++   * Note that we ignore whether the best preference algorithm is a
> ++   * certificate type, as sshconnect.c will downgrade certs to
> ++   * plain keys if necessary.
> ++

[OE-core] [poky][dunfell][PATCHv2] openssh: fix CVE-2020-14145

2021-03-31 Thread Sana Kazi
From: Lee Chee Yang 

(From OE-Core rev: 38482edf1a31ed0735b746cf0ab3e1adda4199d1)

Signed-off-by: Lee Chee Yang 
Signed-off-by: Anuj Mittal 
Signed-off-by: Richard Purdie 
Signed-off-by: Sana Kazi 
---
 .../openssh/openssh/CVE-2020-14145.patch  | 90 +++
 .../openssh/openssh_8.2p1.bb  |  1 +
 2 files changed, 91 insertions(+)
 create mode 100644 
meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch

diff --git a/meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch 
b/meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch
new file mode 100644
index 00..0046ee1a51
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch
@@ -0,0 +1,90 @@
+From b3855ff053f5078ec3d3c653cdaedefaa5fc362d Mon Sep 17 00:00:00 2001
+From: "d...@openbsd.org" 
+Date: Fri, 18 Sep 2020 05:23:03 +
+Subject: [PATCH] upstream: tweak the client hostkey preference ordering
+ algorithm to
+
+prefer the default ordering if the user has a key that matches the
+best-preference default algorithm.
+
+feedback and ok markus@
+
+OpenBSD-Commit-ID: a92dd7d7520ddd95c0a16786a7519e6d0167d35f
+
+Upstream-Status: Backport
+[https://github.com/openssh/openssh-portable/commit/b3855ff053f5078ec3d3c653cdaedefaa5fc362d]
+CVE: CVE-2020-14145
+Signed-off-by: Chee Yang Lee 
+
+---
+ sshconnect2.c | 41 ++---
+ 1 file changed, 37 insertions(+), 2 deletions(-)
+
+diff --git a/sshconnect2.c b/sshconnect2.c
+index 347e348c60..f64aae66af 100644
+--- a/sshconnect2.c
 b/sshconnect2.c
+@@ -102,12 +102,25 @@ verify_host_key_callback(struct sshkey *hostkey, struct 
ssh *ssh)
+   return 0;
+ }
+
++/* Returns the first item from a comma-separated algorithm list */
++static char *
++first_alg(const char *algs)
++{
++  char *ret, *cp;
++
++  ret = xstrdup(algs);
++  if ((cp = strchr(ret, ',')) != NULL)
++  *cp = '\0';
++  return ret;
++}
++
+ static char *
+ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port)
+ {
+-  char *oavail, *avail, *first, *last, *alg, *hostname, *ret;
++  char *oavail = NULL, *avail = NULL, *first = NULL, *last = NULL;
++  char *alg = NULL, *hostname = NULL, *ret = NULL, *best = NULL;
+   size_t maxlen;
+-  struct hostkeys *hostkeys;
++  struct hostkeys *hostkeys = NULL;
+   int ktype;
+   u_int i;
+
+@@ -119,6 +132,26 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, 
u_short port)
+   for (i = 0; i < options.num_system_hostfiles; i++)
+   load_hostkeys(hostkeys, hostname, options.system_hostfiles[i]);
+
++  /*
++   * If a plain public key exists that matches the type of the best
++   * preference HostkeyAlgorithms, then use the whole list as is.
++   * Note that we ignore whether the best preference algorithm is a
++   * certificate type, as sshconnect.c will downgrade certs to
++   * plain keys if necessary.
++   */
++  best = first_alg(options.hostkeyalgorithms);
++  if (lookup_key_in_hostkeys_by_type(hostkeys,
++  sshkey_type_plain(sshkey_type_from_name(best)), NULL)) {
++  debug3("%s: have matching best-preference key type %s, "
++  "using HostkeyAlgorithms verbatim", __func__, best);
++  ret = xstrdup(options.hostkeyalgorithms);
++  goto out;
++  }
++
++  /*
++   * Otherwise, prefer the host key algorithms that match known keys
++   * while keeping the ordering of HostkeyAlgorithms as much as possible.
++   */
+   oavail = avail = xstrdup(options.hostkeyalgorithms);
+   maxlen = strlen(avail) + 1;
+   first = xmalloc(maxlen);
+@@ -159,6 +192,8 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, 
u_short port)
+   if (*first != '\0')
+   debug3("%s: prefer hostkeyalgs: %s", __func__, first);
+
++ out:
++  free(best);
+   free(first);
+   free(last);
+   free(hostname);
diff --git a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb 
b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
index fe94f30503..17965557a7 100644
--- a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
@@ -24,6 +24,7 @@ SRC_URI = 
"http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \
file://sshd_check_keys \
file://add-test-support-for-busybox.patch \
+   file://CVE-2020-14145.patch \
"
 SRC_URI[md5sum] = "3076e6413e8dbe56d33848c1054ac091"
 SRC_URI[sha256sum] = 
"43925151e6cf6cee1450190c0e9af4dc36b41c12737619edff8bcebdff64e671"
--
2.17.1

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the pe

[OE-core] [poky][dunfell][PATCH] openssh: Add fix for CVE-2020-14145

2021-03-31 Thread Sana Kazi
Applied patch for CVE-2020-14145 which fixes
man-in-the-middle attack.
Link: 
https://anongit.mindrot.org/openssh.git/patch/?id=b3855ff053f5078ec3d3c653cdaedefaa5fc362d

Signed-off-by: Sana Kazi 
---
 .../openssh/openssh/CVE-2020-14145.patch  | 97 +++
 .../openssh/openssh_8.2p1.bb  |  1 +
 2 files changed, 98 insertions(+)
 create mode 100644 
meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch

diff --git a/meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch 
b/meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch
new file mode 100644
index 00..3adb981fb4
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch
@@ -0,0 +1,97 @@
+From b3855ff053f5078ec3d3c653cdaedefaa5fc362d Mon Sep 17 00:00:00 2001
+From: "d...@openbsd.org" 
+Date: Fri, 18 Sep 2020 05:23:03 +
+Subject: upstream: tweak the client hostkey preference ordering algorithm to
+
+prefer the default ordering if the user has a key that matches the
+best-preference default algorithm.
+
+feedback and ok markus@
+
+OpenBSD-Commit-ID: a92dd7d7520ddd95c0a16786a7519e6d0167d35f
+
+Signed-off-by: Sana Kazi 
+---
+ sshconnect2.c | 41 ++---
+ 1 file changed, 38 insertions(+), 3 deletions(-)
+
+CVE: CVE-2020-14145
+Upstream-Status: Backport 
[https://anongit.mindrot.org/openssh.git/patch/?id=b3855ff053f5078ec3d3c653cdaedefaa5fc362d]
+Comment: Refreshed first hunk
+
+diff --git a/sshconnect2.c b/sshconnect2.c
+index 347e348c..f64aae66 100644
+--- a/sshconnect2.c
 b/sshconnect2.c
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: sshconnect2.c,v 1.320 2020/02/06 22:48:23 djm Exp $ */
++/* $OpenBSD: sshconnect2.c,v 1.326 2020/09/18 05:23:03 djm Exp $ */
+ /*
+  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
+  * Copyright (c) 2008 Damien Miller.  All rights reserved.
+@@ -102,12 +102,25 @@ verify_host_key_callback(struct sshkey *hostkey, struct 
ssh *ssh)
+   return 0;
+ }
+
++/* Returns the first item from a comma-separated algorithm list */
++static char *
++first_alg(const char *algs)
++{
++  char *ret, *cp;
++
++  ret = xstrdup(algs);
++  if ((cp = strchr(ret, ',')) != NULL)
++  *cp = '\0';
++  return ret;
++}
++
+ static char *
+ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port)
+ {
+-  char *oavail, *avail, *first, *last, *alg, *hostname, *ret;
++  char *oavail = NULL, *avail = NULL, *first = NULL, *last = NULL;
++  char *alg = NULL, *hostname = NULL, *ret = NULL, *best = NULL;
+   size_t maxlen;
+-  struct hostkeys *hostkeys;
++  struct hostkeys *hostkeys = NULL;
+   int ktype;
+   u_int i;
+
+@@ -119,6 +132,26 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, 
u_short port)
+   for (i = 0; i < options.num_system_hostfiles; i++)
+   load_hostkeys(hostkeys, hostname, options.system_hostfiles[i]);
+
++  /*
++   * If a plain public key exists that matches the type of the best
++   * preference HostkeyAlgorithms, then use the whole list as is.
++   * Note that we ignore whether the best preference algorithm is a
++   * certificate type, as sshconnect.c will downgrade certs to
++   * plain keys if necessary.
++   */
++  best = first_alg(options.hostkeyalgorithms);
++  if (lookup_key_in_hostkeys_by_type(hostkeys,
++  sshkey_type_plain(sshkey_type_from_name(best)), NULL)) {
++  debug3("%s: have matching best-preference key type %s, "
++  "using HostkeyAlgorithms verbatim", __func__, best);
++  ret = xstrdup(options.hostkeyalgorithms);
++  goto out;
++  }
++
++  /*
++   * Otherwise, prefer the host key algorithms that match known keys
++   * while keeping the ordering of HostkeyAlgorithms as much as possible.
++   */
+   oavail = avail = xstrdup(options.hostkeyalgorithms);
+   maxlen = strlen(avail) + 1;
+   first = xmalloc(maxlen);
+@@ -159,6 +192,8 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, 
u_short port)
+   if (*first != '\0')
+   debug3("%s: prefer hostkeyalgs: %s", __func__, first);
+
++ out:
++  free(best);
+   free(first);
+   free(last);
+   free(hostname);
+--
+cgit v1.2.3
diff --git a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb 
b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
index fe94f30503..17965557a7 100644
--- a/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_8.2p1.bb
@@ -24,6 +24,7 @@ SRC_URI = 
"http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \
file://sshd_check_keys \
file://add-test-support-for-busybox.patch \
+   file://CVE-2020-14145.patch \
"
 SRC_URI[md5sum] = 

Re: [OE-core] [poky][zeus][PATCH] curl: Security fixes for CVE-2020-{8169/8177}

2021-03-22 Thread Sana Kazi
Hi,

Could you please review below patch for curl to be upstreamed


 Thanks & Regards,

 Sana Kazi
 KPIT Technologies Limited


From: Sana Kazi 
Sent: Thursday, January 7, 2021 5:26 PM
To: Openembedded-core@lists.openembedded.org 
; raj.k...@gmail.com 

Cc: Nisha Parrakat ; Aditya Tayade 
; Harpritkaur Bhandari ; 
Sana Kazi 
Subject: [poky][zeus][PATCH] curl: Security fixes for CVE-2020-{8169/8177}

From: Armin Kuster 

Source: https://curl.haxx.se/
MR: 104472, 104458
Type: Security Fix
Disposition: Backport from 
https://github.com/curl/curl/commit/{600a8cded447cd/8236aba58542c5f}
ChangeID: 1300924f7a64b22375b4326daeef0b686481e30c
Description:

- Affected versions: curl 7.20.0 to and including 7.70.0
- Not affected versions: curl < 7.20.0 and curl >= 7.71.0

Fixes both CVE-2020-8169 and CVE-2020-8177

(From OE-Core rev: f42702baee57ab3d1b7ab7833e72c7d56ad4ee94)

Signed-off-by: Armin Kuster 
Signed-off-by: Steve Sakoman 
Signed-off-by: Richard Purdie 
Signed-off-by: Sana Kazi 
---
 .../curl/curl/CVE-2020-8169.patch | 141 ++
 .../curl/curl/CVE-2020-8177.patch |  67 +
 meta/recipes-support/curl/curl_7.66.0.bb  |   2 +
 3 files changed, 210 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2020-8169.patch
 create mode 100644 meta/recipes-support/curl/curl/CVE-2020-8177.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2020-8169.patch 
b/meta/recipes-support/curl/curl/CVE-2020-8169.patch
new file mode 100644
index 00..774567c017
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2020-8169.patch
@@ -0,0 +1,141 @@
+From 600a8cded447cd7118ed50142c576567c0cf5158 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg 
+Date: Thu, 14 May 2020 14:37:12 +0200
+Subject: [PATCH] url: make the updated credentials URL-encoded in the URL
+
+Found-by: Gregory Jefferis
+Reported-by: Jeroen Ooms
+Added test 1168 to verify. Bug spotted when doing a redirect.
+Bug: https://github.com/jeroen/curl/issues/224
+Closes #5400
+
+Upstream-Status: Backport
+https://github.com/curl/curl/commit/600a8cded447cd
+
+CVE: CVE-2020-8169
+Signed-off-by: Armin Kuster 
+
+---
+ lib/url.c   |  6 ++--
+ tests/data/Makefile.inc |  1 +
+ tests/data/test1168 | 78 +
+ 3 files changed, 83 insertions(+), 2 deletions(-)
+ create mode 100644 tests/data/test1168
+
+Index: curl-7.69.1/lib/url.c
+===
+--- curl-7.69.1.orig/lib/url.c
 curl-7.69.1/lib/url.c
+@@ -2776,12 +2776,14 @@ static CURLcode override_login(struct Cu
+
+   /* for updated strings, we update them in the URL */
+   if(user_changed) {
+-uc = curl_url_set(data->state.uh, CURLUPART_USER, *userp, 0);
++uc = curl_url_set(data->state.uh, CURLUPART_USER, *userp,
++  CURLU_URLENCODE);
+ if(uc)
+   return Curl_uc_to_curlcode(uc);
+   }
+   if(passwd_changed) {
+-uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD, *passwdp, 0);
++uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD, *passwdp,
++  CURLU_URLENCODE);
+ if(uc)
+   return Curl_uc_to_curlcode(uc);
+   }
+Index: curl-7.69.1/tests/data/Makefile.inc
+===
+--- curl-7.69.1.orig/tests/data/Makefile.inc
 curl-7.69.1/tests/data/Makefile.inc
+@@ -129,7 +129,7 @@
+ test1136 test1137 test1138 test1139 test1140 test1141 test1142 test1143 \
+ test1144 test1145 test1146 test1147 test1148 test1149 test1150 test1151 \
+ test1152 test1153 test1154 test1155 test1156 test1157 test1158 test1159 \
+-test1160 test1161 test1162 test1163 test1164 test1165 \
++test1160 test1161 test1162 test1163 test1164 test1165 test1168 \
+ test1170 test1171 test1172 test1173 test1174 \
+ \
+ test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
+Index: curl-7.69.1/tests/data/test1168
+===
+--- /dev/null
 curl-7.69.1/tests/data/test1168
+@@ -0,0 +1,78 @@
++
++
++
++HTTP
++HTTP GET
++followlocation
++
++
++# Server-side
++
++
++HTTP/1.1 301 This is a weirdo text message swsclose
++Date: Thu, 09 Nov 2010 14:49:00 GMT
++Server: test-server/fake
++Location: /data/11680002.txt
++Connection: close
++
++This server reply is for testing a simple Location: following
++
++
++
++HTTP/1.1 200 Followed here fine swsclose
++Date: Thu, 09 Nov 2010 14:49:00 GMT
++Server: test-server/fake
++Content-Length: 52
++
++If this is received, the location following worked
++
++
++
++HTTP/1.1 301 This is a weirdo text message swsclose
++Date: Thu, 09 Nov 2010 14:49:00 GMT
++Server: test-server/fake
++Location: /data/11680002.txt
++Connection: close
++
++HTTP/1.1 200 Followed here fine swsclose
++Date: Thu, 09 Nov 2010 14:49:00 GMT
++Server: test-server/fake
++Content-Length: 52
++
++If this is received, the loc

Re: [OE-core] [poky][gatesgarth][master][dunfell][PATCH] shadow: whitelist CVE-2013-4235

2021-03-19 Thread Sana Kazi
Hi,

This patch is merged for master and dunfell. Could you please review it for 
gatesgarth.

 Thanks & Regards,

 Sana Kazi
 KPIT Technologies Limited




From: Sana Kazi 
Sent: Wednesday, March 3, 2021 4:21 PM
To: Openembedded-core@lists.openembedded.org 
; raj.k...@gmail.com 

Cc: Nisha Parrakat ; Aditya Tayade 
; Harpritkaur Bhandari ; 
Purushottam Choudhary 
Subject: [poky][gatesgarth][master][dunfell][PATCH] shadow: whitelist 
CVE-2013-4235

From: Purushottam Choudhary 

This CVE is about TOCTOU (time-of-check time-of-use)
race condition when copying and removing directory trees
which had very low severity problem and marked as closed
and won't fix. Therefore whitelisted CVE-2013-4235.
Master, gatesgarth and dunfell all have shadow version 4.81.
Hence, this is applicable for master, gatesgarth and dunfell.
Link: https://bugzilla.redhat.com/show_bug.cgi?id=884658

Signed-off-by: Sana Kazi 
---
 meta/recipes-extended/shadow/shadow_4.8.1.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/shadow/shadow_4.8.1.bb 
b/meta/recipes-extended/shadow/shadow_4.8.1.bb
index c975395ff8..ff4aad926f 100644
--- a/meta/recipes-extended/shadow/shadow_4.8.1.bb
+++ b/meta/recipes-extended/shadow/shadow_4.8.1.bb
@@ -6,5 +6,6 @@ BUILD_LDFLAGS_append_class-target = " 
${@bb.utils.contains('DISTRO_FEATURES', 'p

 BBCLASSEXTEND = "native nativesdk"

-
-
+# Severity is low and marked as closed and won't fix.
+# https://bugzilla.redhat.com/show_bug.cgi?id=884658
+CVE_CHECK_WHITELIST += "CVE-2013-4235"
--
2.17.1

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient, you are not 
authorized to read, print, retain copy, disseminate, distribute, or use this 
message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message. KPIT 
Technologies Ltd. does not accept any liability for virus infected mails.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#149687): 
https://lists.openembedded.org/g/openembedded-core/message/149687
Mute This Topic: https://lists.openembedded.org/mt/81048889/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core][meta-oe][dunfell][PATCH] mdns: Whitelisted CVE-2007-0613 for mdns

2021-03-07 Thread Sana Kazi
CVE-2007-0613 is not applicable as it only affects Apple products
i.e. ichat,mdnsresponder, instant message framework and MacOS.
Also, https://www.exploit-db.com/exploits/3230 shows the part of code
affected by CVE-2007-0613 which is not preset in upstream source code.
Hence, CVE-2007-0613 does not affect other Yocto implementations and
is not reported for other distros can be marked whitelisted.
Links:
https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613
https://www.incibe-cert.es/en/early-warning/vulnerabilities/cve-2007-0613
https://security-tracker.debian.org/tracker/CVE-2007-0613
https://ubuntu.com/security/CVE-2007-0613
https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613
---
 .../recipes-protocols/mdns/mdns_878.270.2.bb| 13 +
 1 file changed, 13 insertions(+)

diff --git a/meta-networking/recipes-protocols/mdns/mdns_878.270.2.bb 
b/meta-networking/recipes-protocols/mdns/mdns_878.270.2.bb
index 0f8dc92df3..ce31233264 100644
--- a/meta-networking/recipes-protocols/mdns/mdns_878.270.2.bb
+++ b/meta-networking/recipes-protocols/mdns/mdns_878.270.2.bb
@@ -26,6 +26,19 @@ SRC_URI = 
"https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-${P
 SRC_URI[md5sum] = "4e139a8e1133349006b0436291c9e29b"
 SRC_URI[sha256sum] = 
"2cef0ee9900504c5277fb81de0a28e6c0835fe482ebecf1067c6864f5c4eda74"

+# CVE-2007-0613 is not applicable as it only affects Apple products
+# i.e. ichat,mdnsresponder, instant message framework and MacOS.
+# Also, https://www.exploit-db.com/exploits/3230 shows the part of code
+# affected by CVE-2007-0613 which is not preset in upstream source code.
+# Hence, CVE-2007-0613 does not affect other Yocto implementations and
+# is not reported for other distros can be marked whitelisted.
+# Links:
+# https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613
+# https://www.incibe-cert.es/en/early-warning/vulnerabilities/cve-2007-0613
+# https://security-tracker.debian.org/tracker/CVE-2007-0613
+# https://vulmon.com/vulnerabilitydetails?qid=CVE-2007-0613
+CVE_CHECK_WHITELIST += "CVE-2007-0613"
+
 PARALLEL_MAKE = ""

 S = "${WORKDIR}/mDNSResponder-${PV}/mDNSPosix"
--
2.17.1

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient, you are not 
authorized to read, print, retain copy, disseminate, distribute, or use this 
message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message. KPIT 
Technologies Ltd. does not accept any liability for virus infected mails.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#149094): 
https://lists.openembedded.org/g/openembedded-core/message/149094
Mute This Topic: https://lists.openembedded.org/mt/81168090/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [poky][gatesgarth][master][dunfell][PATCH] shadow: whitelist CVE-2013-4235

2021-03-03 Thread Sana Kazi
From: Purushottam Choudhary 

This CVE is about TOCTOU (time-of-check time-of-use)
race condition when copying and removing directory trees
which had very low severity problem and marked as closed
and won't fix. Therefore whitelisted CVE-2013-4235.
Master, gatesgarth and dunfell all have shadow version 4.81.
Hence, this is applicable for master, gatesgarth and dunfell.
Link: https://bugzilla.redhat.com/show_bug.cgi?id=884658

Signed-off-by: Sana Kazi 
---
 meta/recipes-extended/shadow/shadow_4.8.1.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/shadow/shadow_4.8.1.bb 
b/meta/recipes-extended/shadow/shadow_4.8.1.bb
index c975395ff8..ff4aad926f 100644
--- a/meta/recipes-extended/shadow/shadow_4.8.1.bb
+++ b/meta/recipes-extended/shadow/shadow_4.8.1.bb
@@ -6,5 +6,6 @@ BUILD_LDFLAGS_append_class-target = " 
${@bb.utils.contains('DISTRO_FEATURES', 'p

 BBCLASSEXTEND = "native nativesdk"

-
-
+# Severity is low and marked as closed and won't fix.
+# https://bugzilla.redhat.com/show_bug.cgi?id=884658
+CVE_CHECK_WHITELIST += "CVE-2013-4235"
--
2.17.1

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient, you are not 
authorized to read, print, retain copy, disseminate, distribute, or use this 
message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message. KPIT 
Technologies Ltd. does not accept any liability for virus infected mails.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#148881): 
https://lists.openembedded.org/g/openembedded-core/message/148881
Mute This Topic: https://lists.openembedded.org/mt/81048889/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [poky][zeus][PATCH] curl: Security fixes for CVE-2020-{8169/8177}

2021-01-07 Thread Sana Kazi
From: Armin Kuster 

Source: https://curl.haxx.se/
MR: 104472, 104458
Type: Security Fix
Disposition: Backport from 
https://github.com/curl/curl/commit/{600a8cded447cd/8236aba58542c5f}
ChangeID: 1300924f7a64b22375b4326daeef0b686481e30c
Description:

- Affected versions: curl 7.20.0 to and including 7.70.0
- Not affected versions: curl < 7.20.0 and curl >= 7.71.0

Fixes both CVE-2020-8169 and CVE-2020-8177

(From OE-Core rev: f42702baee57ab3d1b7ab7833e72c7d56ad4ee94)

Signed-off-by: Armin Kuster 
Signed-off-by: Steve Sakoman 
Signed-off-by: Richard Purdie 
Signed-off-by: Sana Kazi 
---
 .../curl/curl/CVE-2020-8169.patch | 141 ++
 .../curl/curl/CVE-2020-8177.patch |  67 +
 meta/recipes-support/curl/curl_7.66.0.bb  |   2 +
 3 files changed, 210 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2020-8169.patch
 create mode 100644 meta/recipes-support/curl/curl/CVE-2020-8177.patch

diff --git a/meta/recipes-support/curl/curl/CVE-2020-8169.patch 
b/meta/recipes-support/curl/curl/CVE-2020-8169.patch
new file mode 100644
index 00..774567c017
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2020-8169.patch
@@ -0,0 +1,141 @@
+From 600a8cded447cd7118ed50142c576567c0cf5158 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg 
+Date: Thu, 14 May 2020 14:37:12 +0200
+Subject: [PATCH] url: make the updated credentials URL-encoded in the URL
+
+Found-by: Gregory Jefferis
+Reported-by: Jeroen Ooms
+Added test 1168 to verify. Bug spotted when doing a redirect.
+Bug: https://github.com/jeroen/curl/issues/224
+Closes #5400
+
+Upstream-Status: Backport
+https://github.com/curl/curl/commit/600a8cded447cd
+
+CVE: CVE-2020-8169
+Signed-off-by: Armin Kuster 
+
+---
+ lib/url.c   |  6 ++--
+ tests/data/Makefile.inc |  1 +
+ tests/data/test1168 | 78 +
+ 3 files changed, 83 insertions(+), 2 deletions(-)
+ create mode 100644 tests/data/test1168
+
+Index: curl-7.69.1/lib/url.c
+===
+--- curl-7.69.1.orig/lib/url.c
 curl-7.69.1/lib/url.c
+@@ -2776,12 +2776,14 @@ static CURLcode override_login(struct Cu
+
+   /* for updated strings, we update them in the URL */
+   if(user_changed) {
+-uc = curl_url_set(data->state.uh, CURLUPART_USER, *userp, 0);
++uc = curl_url_set(data->state.uh, CURLUPART_USER, *userp,
++  CURLU_URLENCODE);
+ if(uc)
+   return Curl_uc_to_curlcode(uc);
+   }
+   if(passwd_changed) {
+-uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD, *passwdp, 0);
++uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD, *passwdp,
++  CURLU_URLENCODE);
+ if(uc)
+   return Curl_uc_to_curlcode(uc);
+   }
+Index: curl-7.69.1/tests/data/Makefile.inc
+===
+--- curl-7.69.1.orig/tests/data/Makefile.inc
 curl-7.69.1/tests/data/Makefile.inc
+@@ -129,7 +129,7 @@
+ test1136 test1137 test1138 test1139 test1140 test1141 test1142 test1143 \
+ test1144 test1145 test1146 test1147 test1148 test1149 test1150 test1151 \
+ test1152 test1153 test1154 test1155 test1156 test1157 test1158 test1159 \
+-test1160 test1161 test1162 test1163 test1164 test1165 \
++test1160 test1161 test1162 test1163 test1164 test1165 test1168 \
+ test1170 test1171 test1172 test1173 test1174 \
+ \
+ test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
+Index: curl-7.69.1/tests/data/test1168
+===
+--- /dev/null
 curl-7.69.1/tests/data/test1168
+@@ -0,0 +1,78 @@
++
++
++
++HTTP
++HTTP GET
++followlocation
++
++
++# Server-side
++
++
++HTTP/1.1 301 This is a weirdo text message swsclose
++Date: Thu, 09 Nov 2010 14:49:00 GMT
++Server: test-server/fake
++Location: /data/11680002.txt
++Connection: close
++
++This server reply is for testing a simple Location: following
++
++
++
++HTTP/1.1 200 Followed here fine swsclose
++Date: Thu, 09 Nov 2010 14:49:00 GMT
++Server: test-server/fake
++Content-Length: 52
++
++If this is received, the location following worked
++
++
++
++HTTP/1.1 301 This is a weirdo text message swsclose
++Date: Thu, 09 Nov 2010 14:49:00 GMT
++Server: test-server/fake
++Location: /data/11680002.txt
++Connection: close
++
++HTTP/1.1 200 Followed here fine swsclose
++Date: Thu, 09 Nov 2010 14:49:00 GMT
++Server: test-server/fake
++Content-Length: 52
++
++If this is received, the location following worked
++
++
++
++
++# Client-side
++
++
++http
++
++ 
++HTTP redirect with credentials using # in user and password
++ 
++ 
++http://%HOSTIP:%HTTPPORT/want/1168 -L -u "catmai#d:#DZaRJYrixKE*gFY"
++
++
++
++# Verify data after the test has been "shot"
++
++
++^User-Agent:.*
++
++
++GET /want/1168 HTTP/1.1
++Host: %HOSTIP:%HTTPPORT
++Authorization: Basic Y2F0bWFpI2Q6I0RaYVJKWXJpeEtFKmdGWQ==
++Accept: */*
++
++

[OE-core] [poky][sumo][PATCH 4/4] libsndfile1: fix CVE-2019-3832

2021-01-07 Thread Sana Kazi
From: Ross Burton 

The previous fix for CVE-2018-19758 wasn't complete, so backport another patch
to solve it properly.

(From OE-Core rev: aeaca9bb1b1c8bf44818945dc4b2cbd6d4b5cef2)

Signed-off-by: Ross Burton 
Signed-off-by: Richard Purdie 
Signed-off-by: Sana Kazi 
---
 .../libsndfile1/CVE-2019-3832.patch   | 37 +++
 .../libsndfile/libsndfile1_1.0.28.bb  |  5 +++
 2 files changed, 42 insertions(+)
 create mode 100644 
meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2019-3832.patch

diff --git a/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2019-3832.patch 
b/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2019-3832.patch
new file mode 100644
index 00..ab37211399
--- /dev/null
+++ b/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2019-3832.patch
@@ -0,0 +1,37 @@
+From 43886efc408c21e1e329086ef70c88860310f25b Mon Sep 17 00:00:00 2001
+From: Emilio Pozuelo Monfort 
+Date: Tue, 5 Mar 2019 11:27:17 +0100
+Subject: [PATCH] wav_write_header: don't read past the array end
+
+CVE-2018-19758 wasn't entirely fixed in the fix, so fix it harder.
+
+CVE: CVE-2019-3832
+Upstream-Status: Backport [7408c4c788ce047d4e652b60a04e7796bcd7267e]
+Signed-off-by: Ross Burton 
+
+If loop_count is bigger than the array, truncate it to the array
+length (and not to 32k).
+
+CVE-2019-3832
+
+---
+ src/wav.c | 6 --
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/wav.c b/src/wav.c
+index daae3cc..8851549 100644
+--- a/src/wav.c
 b/src/wav.c
+@@ -1094,8 +1094,10 @@ wav_write_header (SF_PRIVATE *psf, int calc_length)
+   psf_binheader_writef (psf, "44", 0, 0) ; /* SMTPE format */
+   psf_binheader_writef (psf, "44", psf->instrument->loop_count, 
0) ;
+
+-  /* Loop count is signed 16 bit number so we limit it range to 
something sensible. */
+-  psf->instrument->loop_count &= 0x7fff ;
++  /* Make sure we don't read past the loops array end. */
++  if (psf->instrument->loop_count > ARRAY_LEN 
(psf->instrument->loops))
++  psf->instrument->loop_count = ARRAY_LEN 
(psf->instrument->loops) ;
++
+   for (tmp = 0 ; tmp < psf->instrument->loop_count ; tmp++)
+   {   int type ;
+
diff --git a/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb 
b/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
index b28f675286..e52105fa2b 100644
--- a/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
+++ b/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
@@ -13,6 +13,11 @@ SRC_URI = 
"http://www.mega-nerd.com/libsndfile/files/libsndfile-${PV}.tar.gz \
file://CVE-2017-14245-14246.patch \
file://CVE-2017-14634.patch \
file://CVE-2018-13139.patch \
+   file://0001-a-ulaw-fix-multiple-buffer-overflows-432.patch \
+   file://CVE-2018-19432.patch \
+   file://CVE-2017-12562.patch \
+   file://CVE-2018-19758.patch \
+   file://CVE-2019-3832.patch \
   "

 SRC_URI[md5sum] = "646b5f98ce89ac60cdb060fcd398247c"
--
2.17.1

This message contains information that may be privileged or confidential and is 
the property of the KPIT Technologies Ltd. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient, you are not 
authorized to read, print, retain copy, disseminate, distribute, or use this 
message or any part thereof. If you receive this message in error, please 
notify the sender immediately and delete all copies of this message. KPIT 
Technologies Ltd. does not accept any liability for virus infected mails.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#146466): 
https://lists.openembedded.org/g/openembedded-core/message/146466
Mute This Topic: https://lists.openembedded.org/mt/79495952/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [poky][sumo][PATCH 3/4] libsndfile1: update security patches

2021-01-07 Thread Sana Kazi
From: Ross Burton 

Remove CVE-2017-14245-14246.patch, fix rejected upstream as it doesn't solve the
underlying issue.

Instead 0001-a-ulaw-fix-multiple-buffer-overflows-432 also solves CVE-2017-14245
and CVE-2017-14246 properly.

Add patches for CVE-2017-12562 and CVE-2018-19758.

Refresh CVE-2018-13139.patch.

(From OE-Core rev: a5625df8031985e9c60c34068a4a01c36da40eec)

Signed-off-by: Ross Burton 
Signed-off-by: Richard Purdie 
Signed-off-by: Sana Kazi 
---
 ...aw-fix-multiple-buffer-overflows-432.patch | 107 
 .../libsndfile1/CVE-2017-12562.patch  |  96 ++
 .../libsndfile1/CVE-2017-14245-14246.patch| 121 --
 .../libsndfile1/CVE-2018-13139.patch  |  30 +++--
 .../libsndfile1/CVE-2018-19758.patch  |  34 +
 .../libsndfile/libsndfile1_1.0.28.bb  |   5 +-
 6 files changed, 257 insertions(+), 136 deletions(-)
 create mode 100644 
meta/recipes-multimedia/libsndfile/libsndfile1/0001-a-ulaw-fix-multiple-buffer-overflows-432.patch
 create mode 100644 
meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-12562.patch
 delete mode 100644 
meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-14245-14246.patch
 create mode 100644 
meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2018-19758.patch

diff --git 
a/meta/recipes-multimedia/libsndfile/libsndfile1/0001-a-ulaw-fix-multiple-buffer-overflows-432.patch
 
b/meta/recipes-multimedia/libsndfile/libsndfile1/0001-a-ulaw-fix-multiple-buffer-overflows-432.patch
new file mode 100644
index 00..a4679cef2a
--- /dev/null
+++ 
b/meta/recipes-multimedia/libsndfile/libsndfile1/0001-a-ulaw-fix-multiple-buffer-overflows-432.patch
@@ -0,0 +1,107 @@
+This patch fixes #429 (CVE-2018-19661 CVE-2018-19662) and #344 (CVE-2017-17456
+CVE-2017-17457). As per
+https://github.com/erikd/libsndfile/issues/344#issuecomment-448504425 it also
+fixes #317 (CVE-2017-14245 CVE-2017-14246).
+
+CVE: CVE-2017-14245 CVE-2017-14246
+CVE: CVE-2017-17456 CVE-2017-17457
+CVE: CVE-2018-19661 CVE-2018-19662
+
+Upstream-Status: Backport [8ddc442d539ca775d80cdbc7af17a718634a743f]
+Signed-off-by: Ross Burton 
+
+From 39453899fe1bb39b2e041fdf51a85aecd177e9c7 Mon Sep 17 00:00:00 2001
+From: Changqing Li 
+Date: Mon, 7 Jan 2019 15:55:03 +0800
+Subject: [PATCH] a/ulaw: fix multiple buffer overflows (#432)
+
+i2ulaw_array() and i2alaw_array() fail to handle ptr [count] = INT_MIN
+properly, leading to buffer underflow. INT_MIN is a special value
+since - INT_MIN cannot be represented as int.
+
+In this case round - INT_MIN to INT_MAX and proceed as usual.
+
+f2ulaw_array() and f2alaw_array() fail to handle ptr [count] = NaN
+properly, leading to null pointer dereference.
+
+In this case, arbitrarily set the buffer value to 0.
+
+This commit fixes #429 (CVE-2018-19661 and CVE-2018-19662) and
+fixes #344 (CVE-2017-17456 and CVE-2017-17457).
+
+---
+ src/alaw.c | 9 +++--
+ src/ulaw.c | 9 +++--
+ 2 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/src/alaw.c b/src/alaw.c
+index 063fd1a..4220224 100644
+--- a/src/alaw.c
 b/src/alaw.c
+@@ -19,6 +19,7 @@
+ #include  "sfconfig.h"
+
+ #include  
++#include  
+
+ #include  "sndfile.h"
+ #include  "common.h"
+@@ -326,7 +327,9 @@ s2alaw_array (const short *ptr, int count, unsigned char 
*buffer)
+ static inline void
+ i2alaw_array (const int *ptr, int count, unsigned char *buffer)
+ { while (--count >= 0)
+-  {   if (ptr [count] >= 0)
++  {   if (ptr [count] == INT_MIN)
++  buffer [count] = alaw_encode [INT_MAX >> (16 + 4)] ;
++  else if (ptr [count] >= 0)
+   buffer [count] = alaw_encode [ptr [count] >> (16 + 4)] ;
+   else
+   buffer [count] = 0x7F & alaw_encode [- ptr [count] >> 
(16 + 4)] ;
+@@ -346,7 +349,9 @@ f2alaw_array (const float *ptr, int count, unsigned char 
*buffer, float normfact
+ static inline void
+ d2alaw_array (const double *ptr, int count, unsigned char *buffer, double 
normfact)
+ { while (--count >= 0)
+-  {   if (ptr [count] >= 0)
++  {   if (!isfinite (ptr [count]))
++  buffer [count] = 0 ;
++  else if (ptr [count] >= 0)
+   buffer [count] = alaw_encode [lrint (normfact * ptr 
[count])] ;
+   else
+   buffer [count] = 0x7F & alaw_encode [- lrint (normfact 
* ptr [count])] ;
+diff --git a/src/ulaw.c b/src/ulaw.c
+index e50b4cb..b6070ad 100644
+--- a/src/ulaw.c
 b/src/ulaw.c
+@@ -19,6 +19,7 @@
+ #include  "sfconfig.h"
+
+ #include  
++#include  
+
+ #include  "sndfile.h"
+ #include  "common.h"
+@@ -827,7 +828,9 @@ s2ulaw_array (const short *ptr, int count, unsigned char 
*buffer)
+ static inline void
+ i2ulaw_array (const int *ptr, int count, unsigned char *buffer)
+ {  

[OE-core] [poky][sumo][PATCH 2/4] libsndfile1: Security fix CVE-2018-19432

2021-01-07 Thread Sana Kazi
From: Changqing Li 

(From OE-Core rev: 6f010c9baae5ce2108122d0c6d3b1d630a21)

Signed-off-by: Changqing Li 
Signed-off-by: Ross Burton 
Signed-off-by: Richard Purdie 
Signed-off-by: Sana Kazi 
---
 .../libsndfile1/CVE-2018-19432.patch  | 115 ++
 .../libsndfile/libsndfile1_1.0.28.bb  |   2 +
 2 files changed, 117 insertions(+)
 create mode 100644 
meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2018-19432.patch

diff --git 
a/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2018-19432.patch 
b/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2018-19432.patch
new file mode 100644
index 00..8ded2c0f85
--- /dev/null
+++ b/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2018-19432.patch
@@ -0,0 +1,115 @@
+From 6f3266277bed16525f0ac2f0f03ff4626f1923e5 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo 
+Date: Thu, 8 Mar 2018 18:00:21 +1100
+Subject: [PATCH] Fix max channel count bug
+
+The code was allowing files to be written with a channel count of exactly
+`SF_MAX_CHANNELS` but was failing to read some file formats with the same
+channel count.
+
+Upstream-Status: Backport [https://github.com/erikd/libsndfile/
+commit/6f3266277bed16525f0ac2f0f03ff4626f1923e5]
+
+CVE: CVE-2018-19432
+
+Signed-off-by: Changqing Li 
+
+---
+ src/aiff.c |6 +++---
+ src/rf64.c |4 ++--
+ src/w64.c  |4 ++--
+ src/wav.c  |4 ++--
+ 4 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/src/aiff.c b/src/aiff.c
+index fbd43cb..6386bce 100644
+--- a/src/aiff.c
 b/src/aiff.c
+@@ -1,5 +1,5 @@
+ /*
+-** Copyright (C) 1999-2016 Erik de Castro Lopo 
++** Copyright (C) 1999-2018 Erik de Castro Lopo 
+ ** Copyright (C) 2005 David Viens 
+ **
+ ** This program is free software; you can redistribute it and/or modify
+@@ -950,7 +950,7 @@ aiff_read_header (SF_PRIVATE *psf, COMM_
+   if (psf->sf.channels < 1)
+   return SFE_CHANNEL_COUNT_ZERO ;
+
+-  if (psf->sf.channels >= SF_MAX_CHANNELS)
++  if (psf->sf.channels > SF_MAX_CHANNELS)
+   return SFE_CHANNEL_COUNT ;
+
+   if (! (found_chunk & HAVE_FORM))
+@@ -1030,7 +1030,7 @@ aiff_read_comm_chunk (SF_PRIVATE *psf, C
+   psf_log_printf (psf, "  Sample Rate : %d\n", samplerate) ;
+   psf_log_printf (psf, "  Frames  : %u%s\n", 
comm_fmt->numSampleFrames, (comm_fmt->numSampleFrames == 0 && psf->filelength > 
104) ? " (Should not be 0)" : "") ;
+
+-  if (comm_fmt->numChannels < 1 || comm_fmt->numChannels >= 
SF_MAX_CHANNELS)
++  if (comm_fmt->numChannels < 1 || comm_fmt->numChannels > 
SF_MAX_CHANNELS)
+   {   psf_log_printf (psf, "  Channels: %d (should be >= 1 and < 
%d)\n", comm_fmt->numChannels, SF_MAX_CHANNELS) ;
+   return SFE_CHANNEL_COUNT_BAD ;
+   } ;
+diff --git a/src/rf64.c b/src/rf64.c
+index d57f0f3..876cd45 100644
+--- a/src/rf64.c
 b/src/rf64.c
+@@ -1,5 +1,5 @@
+ /*
+-** Copyright (C) 2008-2017 Erik de Castro Lopo 
++** Copyright (C) 2008-2018 Erik de Castro Lopo 
+ ** Copyright (C) 2009  Uli Franke 
+ **
+ ** This program is free software; you can redistribute it and/or modify
+@@ -382,7 +382,7 @@ rf64_read_header (SF_PRIVATE *psf, int *
+   if (psf->sf.channels < 1)
+   return SFE_CHANNEL_COUNT_ZERO ;
+
+-  if (psf->sf.channels >= SF_MAX_CHANNELS)
++  if (psf->sf.channels > SF_MAX_CHANNELS)
+   return SFE_CHANNEL_COUNT ;
+
+   /* WAVs can be little or big endian */
+diff --git a/src/w64.c b/src/w64.c
+index 939b716..a37d2c5 100644
+--- a/src/w64.c
 b/src/w64.c
+@@ -1,5 +1,5 @@
+ /*
+-** Copyright (C) 1999-2016 Erik de Castro Lopo 
++** Copyright (C) 1999-2018 Erik de Castro Lopo 
+ **
+ ** This program is free software; you can redistribute it and/or modify
+ ** it under the terms of the GNU Lesser General Public License as published by
+@@ -383,7 +383,7 @@ w64_read_header(SF_PRIVATE *psf, int *b
+   if (psf->sf.channels < 1)
+   return SFE_CHANNEL_COUNT_ZERO ;
+
+-  if (psf->sf.channels >= SF_MAX_CHANNELS)
++  if (psf->sf.channels > SF_MAX_CHANNELS)
+   return SFE_CHANNEL_COUNT ;
+
+   psf->endian = SF_ENDIAN_LITTLE ;/* All W64 files are 
little endian. */
+diff --git a/src/wav.c b/src/wav.c
+index 7bd97bc..dc97545 100644
+--- a/src/wav.c
 b/src/wav.c
+@@ -1,5 +1,5 @@
+ /*
+-** Copyright (C) 1999-2016 Erik de Castro Lopo 
++** Copyright (C) 1999-2018 Erik de Castro Lopo 
+ ** Copyright (C) 2004-2005 David Viens 
+ **
+ ** This program is free software; you can redistribute it and/or modify
+@@ -627,7 +627,7 @@ wav_read_header(SF_PRIVATE *psf, int *b
+   if (psf->sf.channels < 1)
+   return SFE_CHANNEL_COUNT_ZERO ;
+
+-  if (psf->sf.channels >= SF_MAX_CHANNELS)
++  if (psf->sf.channe

[OE-core] [poky][sumo][PATCH 1/4] libsndfile1: Security fix CVE-2017-17456/17457 CVE-2018-19661/19662

2021-01-07 Thread Sana Kazi
From: Changqing Li 

Fixes 4 CVEs which are backported from
https://github.com/erikd/libsndfile/commit/585cc28a93be27d6938f276af0011401b9f7c0ca

(From OE-Core rev: 8f4af329df5373db8910726a6b954652623003dd)

Signed-off-by: Changqing Li 
Signed-off-by: Richard Purdie 
Signed-off-by: Sana Kazi 
---
 ...aw-fix-multiple-buffer-overflows-432.patch | 101 ++
 .../libsndfile/libsndfile1_1.0.28.bb  |   1 +
 2 files changed, 102 insertions(+)
 create mode 100644 
meta/recipes-multimedia/libsndfile/libsndfile1/0001-a-ulaw-fix-multiple-buffer-overflows-432.patch

diff --git 
a/meta/recipes-multimedia/libsndfile/libsndfile1/0001-a-ulaw-fix-multiple-buffer-overflows-432.patch
 
b/meta/recipes-multimedia/libsndfile/libsndfile1/0001-a-ulaw-fix-multiple-buffer-overflows-432.patch
new file mode 100644
index 00..c3f44ca235
--- /dev/null
+++ 
b/meta/recipes-multimedia/libsndfile/libsndfile1/0001-a-ulaw-fix-multiple-buffer-overflows-432.patch
@@ -0,0 +1,101 @@
+From 39453899fe1bb39b2e041fdf51a85aecd177e9c7 Mon Sep 17 00:00:00 2001
+From: Changqing Li 
+Date: Mon, 7 Jan 2019 15:55:03 +0800
+Subject: [PATCH] a/ulaw: fix multiple buffer overflows (#432)
+
+i2ulaw_array() and i2alaw_array() fail to handle ptr [count] = INT_MIN
+properly, leading to buffer underflow. INT_MIN is a special value
+since - INT_MIN cannot be represented as int.
+
+In this case round - INT_MIN to INT_MAX and proceed as usual.
+
+f2ulaw_array() and f2alaw_array() fail to handle ptr [count] = NaN
+properly, leading to null pointer dereference.
+
+In this case, arbitrarily set the buffer value to 0.
+
+This commit fixes #429 (CVE-2018-19661 and CVE-2018-19662) and
+fixes #344 (CVE-2017-17456 and CVE-2017-17457).
+
+Upstream-Status: Backport[https://github.com/erikd/libsndfile/
+commit/585cc28a93be27d6938f276af0011401b9f7c0ca]
+
+CVE: CVE-2017-17456 CVE-2017-17457 CVE-2018-19661 CVE-2018-19662
+
+Signed-off-by: Changqing Li 
+---
+ src/alaw.c | 9 +++--
+ src/ulaw.c | 9 +++--
+ 2 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/src/alaw.c b/src/alaw.c
+index 063fd1a..4220224 100644
+--- a/src/alaw.c
 b/src/alaw.c
+@@ -19,6 +19,7 @@
+ #include  "sfconfig.h"
+
+ #include  
++#include  
+
+ #include  "sndfile.h"
+ #include  "common.h"
+@@ -326,7 +327,9 @@ s2alaw_array (const short *ptr, int count, unsigned char 
*buffer)
+ static inline void
+ i2alaw_array (const int *ptr, int count, unsigned char *buffer)
+ { while (--count >= 0)
+-  {   if (ptr [count] >= 0)
++  {   if (ptr [count] == INT_MIN)
++  buffer [count] = alaw_encode [INT_MAX >> (16 + 4)] ;
++  else if (ptr [count] >= 0)
+   buffer [count] = alaw_encode [ptr [count] >> (16 + 4)] ;
+   else
+   buffer [count] = 0x7F & alaw_encode [- ptr [count] >> 
(16 + 4)] ;
+@@ -346,7 +349,9 @@ f2alaw_array (const float *ptr, int count, unsigned char 
*buffer, float normfact
+ static inline void
+ d2alaw_array (const double *ptr, int count, unsigned char *buffer, double 
normfact)
+ { while (--count >= 0)
+-  {   if (ptr [count] >= 0)
++  {   if (!isfinite (ptr [count]))
++  buffer [count] = 0 ;
++  else if (ptr [count] >= 0)
+   buffer [count] = alaw_encode [lrint (normfact * ptr 
[count])] ;
+   else
+   buffer [count] = 0x7F & alaw_encode [- lrint (normfact 
* ptr [count])] ;
+diff --git a/src/ulaw.c b/src/ulaw.c
+index e50b4cb..b6070ad 100644
+--- a/src/ulaw.c
 b/src/ulaw.c
+@@ -19,6 +19,7 @@
+ #include  "sfconfig.h"
+
+ #include  
++#include  
+
+ #include  "sndfile.h"
+ #include  "common.h"
+@@ -827,7 +828,9 @@ s2ulaw_array (const short *ptr, int count, unsigned char 
*buffer)
+ static inline void
+ i2ulaw_array (const int *ptr, int count, unsigned char *buffer)
+ { while (--count >= 0)
+-  {   if (ptr [count] >= 0)
++  {   if (ptr [count] == INT_MIN)
++  buffer [count] = ulaw_encode [INT_MAX >> (16 + 2)] ;
++  else if (ptr [count] >= 0)
+   buffer [count] = ulaw_encode [ptr [count] >> (16 + 2)] ;
+   else
+   buffer [count] = 0x7F & ulaw_encode [-ptr [count] >> 
(16 + 2)] ;
+@@ -847,7 +850,9 @@ f2ulaw_array (const float *ptr, int count, unsigned char 
*buffer, float normfact
+ static inline void
+ d2ulaw_array (const double *ptr, int count, unsigned char *buffer, double 
normfact)
+ { while (--count >= 0)
+-  {   if (ptr [count] >= 0)
++  {   if (!isfinite (ptr [count]))
++  buffer [count] = 0 ;
++  else if (ptr [count] >= 0)
+   buffer [count] = ulaw_encode [lrint (normfact * ptr 
[cou

[OE-core] [poky][sumo][PATCH] ncurses: fix CVE-2019-17594, CVE-2019-17595

2021-01-06 Thread Sana Kazi
From: Trevor Gamblin 

Backport changes to tinfo/comp_hash.c, tinfo/parse_entry.c,
and progs/dump_entry.c from upstream to fix CVEs.

(From OE-Core rev: 7ec70aeb0c6f6080523efa0f983fa36b92cb5558)

Signed-off-by: Trevor Gamblin 
Signed-off-by: Armin Kuster 
Signed-off-by: Richard Purdie 
Signed-off-by: Sana Kazi 
---
 ...selective-backport-of-20191012-patch.patch | 158 ++
 .../ncurses/ncurses_6.0+20171125.bb   |   1 +
 2 files changed, 159 insertions(+)
 create mode 100644 
meta/recipes-core/ncurses/files/0001-ncurses-selective-backport-of-20191012-patch.patch

diff --git 
a/meta/recipes-core/ncurses/files/0001-ncurses-selective-backport-of-20191012-patch.patch
 
b/meta/recipes-core/ncurses/files/0001-ncurses-selective-backport-of-20191012-patch.patch
new file mode 100644
index 00..989a8ccd4e
--- /dev/null
+++ 
b/meta/recipes-core/ncurses/files/0001-ncurses-selective-backport-of-20191012-patch.patch
@@ -0,0 +1,158 @@
+From 064b77f173337aa790f1cec0d741bfbc61a33d31 Mon Sep 17 00:00:00 2001
+From: Trevor Gamblin 
+Date: Fri, 18 Oct 2019 09:57:43 -0400
+Subject: [PATCH] ncurses: selective backport of 20191012 patch
+
+Upstream-Status: Backport 
[https://salsa.debian.org/debian/ncurses/commit/243908b1e3d81]
+
+Contents of the upstream patch that are not applied to comp_hash.c,
+parse_entry.c, or dump_entry.c have been omitted.
+
+CVE: CVE-2019-17594
+CVE: CVE-2019-17595
+
+Signed-off-by: Trevor Gamblin  
+
+---
+ ncurses/tinfo/comp_hash.c   | 14 ++
+ ncurses/tinfo/parse_entry.c | 32 
+ progs/dump_entry.c  |  7 ---
+ 3 files changed, 30 insertions(+), 23 deletions(-)
+
+diff --git a/ncurses/tinfo/comp_hash.c b/ncurses/tinfo/comp_hash.c
+index 21f165ca..a62d38f9 100644
+--- a/ncurses/tinfo/comp_hash.c
 b/ncurses/tinfo/comp_hash.c
+@@ -44,7 +44,7 @@
+ #include 
+ #include 
+
+-MODULE_ID("$Id: comp_hash.c,v 1.48 2009/08/08 17:36:21 tom Exp $")
++MODULE_ID("$Id: comp_hash.c,v 1.51 2019/10/12 16:32:13 tom Exp $")
+
+ /*
+  * Finds the entry for the given string in the hash table if present.
+@@ -63,7 +63,9 @@ _nc_find_entry(const char *string,
+
+ hashvalue = data->hash_of(string);
+
+-if (data->table_data[hashvalue] >= 0) {
++if (hashvalue >= 0
++  && (unsigned) hashvalue < data->table_size
++  && data->table_data[hashvalue] >= 0) {
+
+   real_table = _nc_get_table(termcap);
+   ptr = real_table + data->table_data[hashvalue];
+@@ -96,7 +98,9 @@ _nc_find_type_entry(const char *string,
+ const HashData *data = _nc_get_hash_info(termcap);
+ int hashvalue = data->hash_of(string);
+
+-if (data->table_data[hashvalue] >= 0) {
++if (hashvalue >= 0
++  && (unsigned) hashvalue < data->table_size
++  && data->table_data[hashvalue] >= 0) {
+   const struct name_table_entry *const table = _nc_get_table(termcap);
+
+   ptr = table + data->table_data[hashvalue];
+diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c
+index f8cca8b5..064376c5 100644
+--- a/ncurses/tinfo/parse_entry.c
 b/ncurses/tinfo/parse_entry.c
+@@ -47,7 +47,7 @@
+ #include 
+ #include 
+
+-MODULE_ID("$Id: parse_entry.c,v 1.91 2017/08/26 16:13:34 tom Exp $")
++MODULE_ID("$Id: parse_entry.c,v 1.98 2019/10/12 00:50:31 tom Exp $")
+
+ #ifdef LINT
+ static short const parametrized[] =
+@@ -654,12 +654,12 @@ _nc_capcmp(const char *s, const char *t)
+ }
+
+ static void
+-append_acs0(string_desc * dst, int code, int src)
++append_acs0(string_desc * dst, int code, char *src, size_t off)
+ {
+-if (src != 0) {
++if (src != 0 && off < strlen(src)) {
+   char temp[3];
+   temp[0] = (char) code;
+-  temp[1] = (char) src;
++  temp[1] = src[off];
+   temp[2] = 0;
+   _nc_safe_strcat(dst, temp);
+ }
+@@ -669,7 +669,7 @@ static void
+ append_acs(string_desc * dst, int code, char *src)
+ {
+ if (VALID_STRING(src) && strlen(src) == 1) {
+-  append_acs0(dst, code, *src);
++  append_acs0(dst, code, src, 0);
+ }
+ }
+
+@@ -1038,17 +1038,17 @@ postprocess_terminfo(TERMTYPE2 *tp)
+   _nc_str_init(, buf2, sizeof(buf2));
+   _nc_safe_strcat(, acs_chars);
+
+-  append_acs0(, 'l', box_chars_1[0]);  /* ACS_ULCORNER */
+-  append_acs0(, 'q', box_chars_1[1]);  /* ACS_HLINE */
+-  append_acs0(, 'k', box_chars_1[2]);  /* ACS_URCORNER */
+-  append_acs0(, 'x', box_chars_1[3]);  /* ACS_VLINE */
+-  append_acs0(, 'j', box_chars_1[4]);  /* ACS_LRCORNER */
+-  append_acs0(, 'm', box_chars_1[5]);  /* ACS_LLCORNER */
+-  append_acs0(, 'w', box_chars_1[6]);  /* ACS_TTEE */
+-  append_acs0(, 'u', box_chars_1[7]);  /* ACS_RTEE */
+-  append_acs0(, 'v', box_chars_1[8]);  /* ACS_BTEE */
+-  append_acs0(, 't', box_chars_1[9]);  /* ACS_LTEE */
+-  app

Re: [OE-core] [poky][sumo][PATCH] ncurses: fix CVE-2019-17594, CVE-2019-17595

2021-01-06 Thread Sana Kazi



Regards,
Sana Kazi


From: Sana Kazi 
Sent: Wednesday, January 6, 2021 2:39 PM
To: openembedded-core@lists.openembedded.org 
; raj.k...@gmail.com 

Cc: Nisha Parrakat ; Aditya Tayade 
; Trevor Gamblin ; Armin 
Kuster ; Richard Purdie 
; Sana Kazi 
Subject: [poky][sumo][PATCH] ncurses: fix CVE-2019-17594, CVE-2019-17595

From: Trevor Gamblin 

Backport changes to tinfo/comp_hash.c, tinfo/parse_entry.c,
and progs/dump_entry.c from upstream to fix CVEs.

(From OE-Core rev: 7ec70aeb0c6f6080523efa0f983fa36b92cb5558)

Signed-off-by: Trevor Gamblin 
Signed-off-by: Armin Kuster 
Signed-off-by: Richard Purdie 
Signed-off-by: Sana Kazi 
---
 ...selective-backport-of-20191012-patch.patch | 158 ++
 .../ncurses/ncurses_6.0+20171125.bb   |   1 +
 2 files changed, 159 insertions(+)
 create mode 100644 
meta/recipes-core/ncurses/files/0001-ncurses-selective-backport-of-20191012-patch.patch

diff --git 
a/meta/recipes-core/ncurses/files/0001-ncurses-selective-backport-of-20191012-patch.patch
 
b/meta/recipes-core/ncurses/files/0001-ncurses-selective-backport-of-20191012-patch.patch
new file mode 100644
index 00..989a8ccd4e
--- /dev/null
+++ 
b/meta/recipes-core/ncurses/files/0001-ncurses-selective-backport-of-20191012-patch.patch
@@ -0,0 +1,158 @@
+From 064b77f173337aa790f1cec0d741bfbc61a33d31 Mon Sep 17 00:00:00 2001
+From: Trevor Gamblin 
+Date: Fri, 18 Oct 2019 09:57:43 -0400
+Subject: [PATCH] ncurses: selective backport of 20191012 patch
+
+Upstream-Status: Backport 
[https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsalsa.debian.org%2Fdebian%2Fncurses%2Fcommit%2F243908b1e3d81data=04%7C01%7CSana.Kazi%40kpit.com%7C80550d084ab7442c06d508d8b222cd4c%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637455209903558555%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=J%2FrCRcik47L1Q0BQfVRWutz%2FObINAgtgrEv4sIYVj%2FM%3Dreserved=0]
+
+Contents of the upstream patch that are not applied to comp_hash.c,
+parse_entry.c, or dump_entry.c have been omitted.
+
+CVE: CVE-2019-17594
+CVE: CVE-2019-17595
+
+Signed-off-by: Trevor Gamblin  
+
+---
+ ncurses/tinfo/comp_hash.c   | 14 ++
+ ncurses/tinfo/parse_entry.c | 32 
+ progs/dump_entry.c  |  7 ---
+ 3 files changed, 30 insertions(+), 23 deletions(-)
+
+diff --git a/ncurses/tinfo/comp_hash.c b/ncurses/tinfo/comp_hash.c
+index 21f165ca..a62d38f9 100644
+--- a/ncurses/tinfo/comp_hash.c
 b/ncurses/tinfo/comp_hash.c
+@@ -44,7 +44,7 @@
+ #include 
+ #include 
+
+-MODULE_ID("$Id: comp_hash.c,v 1.48 2009/08/08 17:36:21 tom Exp $")
++MODULE_ID("$Id: comp_hash.c,v 1.51 2019/10/12 16:32:13 tom Exp $")
+
+ /*
+  * Finds the entry for the given string in the hash table if present.
+@@ -63,7 +63,9 @@ _nc_find_entry(const char *string,
+
+ hashvalue = data->hash_of(string);
+
+-if (data->table_data[hashvalue] >= 0) {
++if (hashvalue >= 0
++  && (unsigned) hashvalue < data->table_size
++  && data->table_data[hashvalue] >= 0) {
+
+real_table = _nc_get_table(termcap);
+ptr = real_table + data->table_data[hashvalue];
+@@ -96,7 +98,9 @@ _nc_find_type_entry(const char *string,
+ const HashData *data = _nc_get_hash_info(termcap);
+ int hashvalue = data->hash_of(string);
+
+-if (data->table_data[hashvalue] >= 0) {
++if (hashvalue >= 0
++  && (unsigned) hashvalue < data->table_size
++  && data->table_data[hashvalue] >= 0) {
+const struct name_table_entry *const table = _nc_get_table(termcap);
+
+ptr = table + data->table_data[hashvalue];
+diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c
+index f8cca8b5..064376c5 100644
+--- a/ncurses/tinfo/parse_entry.c
 b/ncurses/tinfo/parse_entry.c
+@@ -47,7 +47,7 @@
+ #include 
+ #include 
+
+-MODULE_ID("$Id: parse_entry.c,v 1.91 2017/08/26 16:13:34 tom Exp $")
++MODULE_ID("$Id: parse_entry.c,v 1.98 2019/10/12 00:50:31 tom Exp $")
+
+ #ifdef LINT
+ static short const parametrized[] =
+@@ -654,12 +654,12 @@ _nc_capcmp(const char *s, const char *t)
+ }
+
+ static void
+-append_acs0(string_desc * dst, int code, int src)
++append_acs0(string_desc * dst, int code, char *src, size_t off)
+ {
+-if (src != 0) {
++if (src != 0 && off < strlen(src)) {
+char temp[3];
+temp[0] = (char) code;
+-  temp[1] = (char) src;
++  temp[1] = src[off];
+temp[2] = 0;
+_nc_safe_strcat(dst, temp);
+ }
+@@ -669,7 +669,7 @@ static void
+ append_acs(string_desc * dst, int code, char *src)
+ {
+ if (VALID_STRING(src) && strlen(src) == 1) {
+-  append_acs0(dst, code, *src);
++  append_acs0(dst, code, src, 0);
+ }
+ }
+
+@@ -1038,17 +1038,17 @@ postprocess_terminfo(TERMTYPE2 *tp)
+