Skip to content

Commit cadba3d

Browse files
committed
Merge branch 'main' into 2.0
2 parents bec0395 + febc095 commit cadba3d

100 files changed

Lines changed: 13417 additions & 1386 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
name: Github Merge Conflict Check
5+
6+
on:
7+
push:
8+
branches: [main, dev, 1.0*, 2.0*, 3.0*, fasttrack/*]
9+
pull_request:
10+
branches: [main, dev, 1.0*, 2.0*, 3.0*, fasttrack/*]
11+
12+
jobs:
13+
spec-check:
14+
name: Github Merge Conflict Check
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
# Checkout the branch of our repo that triggered this action
19+
- name: Workflow trigger checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Get base commit for PRs
23+
if: ${{ github.event_name == 'pull_request' }}
24+
run: |
25+
git fetch origin ${{ github.base_ref }}
26+
echo "base_sha=$(git rev-parse origin/${{ github.base_ref }})" >> $GITHUB_ENV
27+
echo "Merging ${{ github.sha }} into ${{ github.base_ref }}"
28+
29+
- name: Get base commit for Pushes
30+
if: ${{ github.event_name == 'push' }}
31+
run: |
32+
git fetch origin ${{ github.event.before }}
33+
echo "base_sha=${{ github.event.before }}" >> $GITHUB_ENV
34+
echo "Merging ${{ github.sha }} into ${{ github.event.before }}"
35+
36+
- name: Check for merge conflicts
37+
run: |
38+
echo "Files changed: '$(git diff-tree --no-commit-id --name-only -r ${{ env.base_sha }} ${{ github.sha }})'"
39+
changed_files=$(git diff-tree --diff-filter=d --no-commit-id --name-only -r ${{ env.base_sha }} ${{ github.sha }})
40+
41+
merge_conflict_found=false
42+
for file in $changed_files ; do
43+
if [ -f $file ]; then
44+
echo "Checking for merge conflicts in $file"
45+
if grep -H -r "^<<<<<<< HEAD$" $file; then
46+
echo "Merge conflict found in $file"
47+
merge_conflict_found=true
48+
fi
49+
50+
if grep -H -r "^>>>>>>>$" $file; then
51+
echo "Merge conflict found in $file"
52+
merge_conflict_found=true
53+
fi
54+
55+
if grep -H -r "^=======$" $file; then
56+
echo "Merge conflict found in $file"
57+
merge_conflict_found=true
58+
fi
59+
fi
60+
done
61+
62+
if [[ $merge_conflict_found =~ [Tt]rue ]]; then
63+
echo "Merge conflict found in one or more files"
64+
exit 1
65+
fi
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# Triggers controlled on the ADO side.
5+
trigger: none
6+
7+
resources:
8+
repositories:
9+
- repository: templates
10+
type: git
11+
name: OneBranch.Pipelines/GovernedTemplates
12+
ref: refs/heads/main
13+
14+
extends:
15+
template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates
16+
parameters:
17+
featureFlags:
18+
runOnHost: true
19+
globalSdl:
20+
credscan:
21+
suppressionsFile: .config/CredScanSuppressions.json
22+
stages:
23+
- stage: InfoPublishing
24+
jobs:
25+
- job: PublishMergeInfo
26+
pool:
27+
type: linux
28+
29+
variables:
30+
ob_outputDirectory: "$(Pipeline.Workspace)/not_used/OB_template_complains_if_this_is_not_set"
31+
32+
steps:
33+
- script: |
34+
set -e
35+
36+
echo "##vso[build.addbuildtag]Repository.Name-$(Build.Repository.Name)"
37+
echo "##vso[build.addbuildtag]SourceBranch-$(Build.SourceBranch)"
38+
echo "##vso[build.addbuildtag]SourceVersion-$(Build.SourceVersion)"
39+
displayName: "Set merge info tags"

.pipelines/templates/PackageBuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ steps:
297297
- bash: |
298298
published_logs_dir="${{ parameters.outputArtifactsFolder }}/${{ parameters.outputArtifactsLogsSubfolder }}"
299299
mkdir -p "$published_logs_dir"
300-
tar -C "${{ parameters.buildRepoRoot }}/build/logs/pkggen" -czf "$published_logs_dir/pkggen.logs.tar.gz" .
300+
tar -C "${{ parameters.buildRepoRoot }}/build/logs" -czf "$published_logs_dir/pkggen.logs.tar.gz" .
301301
tar -C "${{ parameters.buildRepoRoot }}/build/pkg_artifacts" -czf "$published_logs_dir/pkg_artifacts.tar.gz" .
302302
tar -C "${{ parameters.buildRepoRoot }}/build/timestamp" -czf "$published_logs_dir/timestamp.tar.gz" .
303303
condition: always()

SPECS/avahi/CVE-2023-1981.patch

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From a2696da2f2c50ac43b6c4903f72290d5c3fa9f6f Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
3+
Date: Thu, 17 Nov 2022 01:51:53 +0100
4+
Subject: [PATCH] Emit error if requested service is not found
5+
6+
It currently just crashes instead of replying with error. Check return
7+
value and emit error instead of passing NULL pointer to reply.
8+
9+
Fixes #375
10+
---
11+
avahi-daemon/dbus-protocol.c | 20 ++++++++++++++------
12+
1 file changed, 14 insertions(+), 6 deletions(-)
13+
14+
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
15+
index 70d7687b..406d0b44 100644
16+
--- a/avahi-daemon/dbus-protocol.c
17+
+++ b/avahi-daemon/dbus-protocol.c
18+
@@ -375,10 +375,14 @@ static DBusHandlerResult dbus_get_alternative_host_name(DBusConnection *c, DBusM
19+
}
20+
21+
t = avahi_alternative_host_name(n);
22+
- avahi_dbus_respond_string(c, m, t);
23+
- avahi_free(t);
24+
+ if (t) {
25+
+ avahi_dbus_respond_string(c, m, t);
26+
+ avahi_free(t);
27+
28+
- return DBUS_HANDLER_RESULT_HANDLED;
29+
+ return DBUS_HANDLER_RESULT_HANDLED;
30+
+ } else {
31+
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Hostname not found");
32+
+ }
33+
}
34+
35+
static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DBusMessage *m, DBusError *error) {
36+
@@ -389,10 +393,14 @@ static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DB
37+
}
38+
39+
t = avahi_alternative_service_name(n);
40+
- avahi_dbus_respond_string(c, m, t);
41+
- avahi_free(t);
42+
+ if (t) {
43+
+ avahi_dbus_respond_string(c, m, t);
44+
+ avahi_free(t);
45+
46+
- return DBUS_HANDLER_RESULT_HANDLED;
47+
+ return DBUS_HANDLER_RESULT_HANDLED;
48+
+ } else {
49+
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Service not found");
50+
+ }
51+
}
52+
53+
static DBusHandlerResult dbus_create_new_entry_group(DBusConnection *c, DBusMessage *m, DBusError *error) {

SPECS/avahi/avahi.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Local network service discovery
44
Name: avahi
55
Version: 0.8
6-
Release: 1%{?dist}
6+
Release: 2%{?dist}
77
License: LGPLv2+
88
Vendor: Microsoft Corporation
99
Distribution: Mariner
@@ -12,6 +12,7 @@ Source0: https://github.com/lathiat/avahi/releases/download/v%{version}/%
1212
Patch0: %{name}-libevent-pc-fix.patch
1313
Patch1: CVE-2021-3468.patch
1414
Patch2: CVE-2021-3502.patch
15+
Patch3: CVE-2023-1981.patch
1516
BuildRequires: automake
1617
BuildRequires: dbus-devel >= 0.90
1718
BuildRequires: dbus-glib-devel >= 0.70
@@ -405,6 +406,9 @@ exit 0
405406
%endif
406407

407408
%changelog
409+
* Tue Oct 29 2024 Daniel McIlvaney <damcilva@microsoft.com> - 0.8-2
410+
- Fix CVE-2023-1981 with an upstream patch
411+
408412
* Wed Apr 20 2022 Olivia Crain <oliviacrain@microsoft.com> - 0.8-1
409413
- Upgrade to latest upstream version to fix CVE-2017-6519
410414
- Add upstream patch to fix CVE-2021-3502
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 0ebc886149c22aceaf8ed74267821a59ca9d03eb Mon Sep 17 00:00:00 2001
2+
From: Alan Modra <amodra@gmail.com>
3+
Date: Fri, 17 Jun 2022 09:00:41 +0930
4+
Subject: [PATCH] PR29254, memory leak in stab_demangle_v3_arg
5+
6+
PR 29254
7+
* stabs.c (stab_demangle_v3_arg): Free dt on failure path.
8+
---
9+
binutils/stabs.c | 5 ++++-
10+
1 file changed, 4 insertions(+), 1 deletion(-)
11+
12+
diff --git a/binutils/stabs.c b/binutils/stabs.c
13+
index 2b5241637c1..796ff85b86a 100644
14+
--- a/binutils/stabs.c
15+
+++ b/binutils/stabs.c
16+
@@ -5467,7 +5467,10 @@ stab_demangle_v3_arg (void *dhandle, struct stab_handle *info,
17+
dc->u.s_binary.right,
18+
&varargs);
19+
if (pargs == NULL)
20+
- return NULL;
21+
+ {
22+
+ free (dt);
23+
+ return NULL;
24+
+ }
25+
26+
return debug_make_function_type (dhandle, dt, pargs, varargs);
27+
}
28+
--
29+
2.43.5
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From d6e1d48c83b165c129cb0aa78905f7ca80a1f682 Mon Sep 17 00:00:00 2001
2+
From: Alan Modra <amodra@gmail.com>
3+
Date: Fri, 17 Jun 2022 09:13:38 +0930
4+
Subject: [PATCH] PR29255, memory leak in make_tempdir
5+
6+
PR 29255
7+
* bucomm.c (make_tempdir, make_tempname): Free template on all
8+
failure paths.
9+
---
10+
binutils/bucomm.c | 20 +++++++++++---------
11+
1 file changed, 11 insertions(+), 9 deletions(-)
12+
13+
diff --git a/binutils/bucomm.c b/binutils/bucomm.c
14+
index fdc2209df9c..4395cb9f7f5 100644
15+
--- a/binutils/bucomm.c
16+
+++ b/binutils/bucomm.c
17+
@@ -537,8 +537,9 @@ make_tempname (const char *filename, int *ofd)
18+
#else
19+
tmpname = mktemp (tmpname);
20+
if (tmpname == NULL)
21+
- return NULL;
22+
- fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600);
23+
+ fd = -1;
24+
+ else
25+
+ fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600);
26+
#endif
27+
if (fd == -1)
28+
{
29+
@@ -556,22 +557,23 @@ char *
30+
make_tempdir (const char *filename)
31+
{
32+
char *tmpname = template_in_dir (filename);
33+
+ char *ret;
34+
35+
#ifdef HAVE_MKDTEMP
36+
- return mkdtemp (tmpname);
37+
+ ret = mkdtemp (tmpname);
38+
#else
39+
- tmpname = mktemp (tmpname);
40+
- if (tmpname == NULL)
41+
- return NULL;
42+
+ ret = mktemp (tmpname);
43+
#if defined (_WIN32) && !defined (__CYGWIN32__)
44+
if (mkdir (tmpname) != 0)
45+
- return NULL;
46+
+ ret = NULL;
47+
#else
48+
if (mkdir (tmpname, 0700) != 0)
49+
- return NULL;
50+
+ ret = NULL;
51+
#endif
52+
- return tmpname;
53+
#endif
54+
+ if (ret == NULL)
55+
+ free (tmpname);
56+
+ return ret;
57+
}
58+
59+
/* Parse a string into a VMA, with a fatal error if it can't be
60+
--
61+
2.43.5
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From 0d02e70b197c786f26175b9a73f94e01d14abdab Mon Sep 17 00:00:00 2001
2+
From: Alan Modra <amodra@gmail.com>
3+
Date: Mon, 20 Jun 2022 10:39:31 +0930
4+
Subject: [PATCH] PR29262, memory leak in pr_function_type
5+
6+
PR 29262
7+
* prdbg.c (pr_function_type): Free "s" on failure path.
8+
---
9+
binutils/prdbg.c | 7 ++-----
10+
1 file changed, 2 insertions(+), 5 deletions(-)
11+
12+
diff --git a/binutils/prdbg.c b/binutils/prdbg.c
13+
index c1e41628d26..bb42a5b6c2d 100644
14+
--- a/binutils/prdbg.c
15+
+++ b/binutils/prdbg.c
16+
@@ -742,12 +742,9 @@ pr_function_type (void *p, int argcount, bool varargs)
17+
18+
strcat (s, ")");
19+
20+
- if (! substitute_type (info, s))
21+
- return false;
22+
-
23+
+ bool ret = substitute_type (info, s);
24+
free (s);
25+
-
26+
- return true;
27+
+ return ret;
28+
}
29+
30+
/* Turn the top type on the stack into a reference to that type. */
31+
--
32+
2.43.5
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 8a24927bc8dbf6beac2000593b21235c3796dc35 Mon Sep 17 00:00:00 2001
2+
From: Alan Modra <amodra@gmail.com>
3+
Date: Mon, 20 Jun 2022 10:39:13 +0930
4+
Subject: [PATCH] PR29261, memory leak in parse_stab_struct_fields
5+
6+
PR 29261
7+
* stabs.c (parse_stab_struct_fields): Free "fields" on failure path.
8+
---
9+
binutils/stabs.c | 5 ++++-
10+
1 file changed, 4 insertions(+), 1 deletion(-)
11+
12+
diff --git a/binutils/stabs.c b/binutils/stabs.c
13+
index 796ff85b86a..bf3f578cbcc 100644
14+
--- a/binutils/stabs.c
15+
+++ b/binutils/stabs.c
16+
@@ -2367,7 +2367,10 @@ parse_stab_struct_fields (void *dhandle,
17+
18+
if (! parse_stab_one_struct_field (dhandle, info, pp, p, fields + c,
19+
staticsp, p_end))
20+
- return false;
21+
+ {
22+
+ free (fields);
23+
+ return false;
24+
+ }
25+
26+
++c;
27+
}
28+
--
29+
2.43.5

SPECS/binutils/binutils.spec

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Summary: Contains a linker, an assembler, and other tools
2222
Name: binutils
2323
Version: 2.37
24-
Release: 8%{?dist}
24+
Release: 9%{?dist}
2525
License: GPLv2+
2626
Vendor: Microsoft Corporation
2727
Distribution: Mariner
@@ -38,6 +38,10 @@ Patch4: CVE-2022-38533.patch
3838
Patch5: CVE-2022-4285.patch
3939
# The gold linker doesn't understand the 'module_info.ld' script passed to all linkers and the tests fail to correctly link.
4040
Patch6: disable_gold_test.patch
41+
Patch7: CVE-2022-47007.patch
42+
Patch8: CVE-2022-47008.patch
43+
Patch9: CVE-2022-47010.patch
44+
Patch10: CVE-2022-47011.patch
4145
Provides: bundled(libiberty)
4246

4347
# Moving macro before the "SourceX" tags breaks PR checks parsing the specs.
@@ -294,6 +298,9 @@ find %{buildroot} -type f -name "*.la" -delete -print
294298
%do_files aarch64-linux-gnu %{build_aarch64}
295299

296300
%changelog
301+
* Mon Nov 04 2024 Nicolas Guibourge <nicolasg@microsoft.com> - 2.37-9
302+
- Address CVE-2022-47007, CVE-2022-47008, CVE-2022-47010, CVE-2022-47011.
303+
297304
* Fri Nov 17 2023 Pawel Winogrodzki <pawelwi@microsoft.com> - 2.37-8
298305
- Add the cross-compilation subpackage for aarch64.
299306
- Used Fedora 38 spec (license: MIT) for guidance.

0 commit comments

Comments
 (0)