From 82c0a5f6167845e251ae410a574a690becfe1a2d Mon Sep 17 00:00:00 2001 From: Tedd Ho-Jeong An Date: Tue, 10 Mar 2020 10:00:58 -0700 Subject: [PATCH 1/2] workflow: Add workflow files This patch adds workflow files for ci: [sync.yml] - runs every 30 mins. - sync repo with upstream repo and rebase workflow branch to tip of master. - creates PR after reading patches from patchwork.kernel.org [ci.yml] - Tests the following checks: - checkpatch - gitlint - make - make check [code_scan.yml] - Static code checker: Coverity and Clang - Coverity: Submit the result to the coverity website - Clang Code Scan: Send email with result file to the internal team To simplify the history, new change will amend to this patch without creating new patch. --- .github/workflows/ci.yml | 25 +++++++++++++++++++ .github/workflows/code_scan.yml | 26 ++++++++++++++++++++ .github/workflows/sync.yml | 43 +++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/code_scan.yml create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..a3a54d1a1b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: [pull_request] + +jobs: + ci: + runs-on: ubuntu-latest + name: CI for Pull Request + steps: + - name: Checkout the source code + uses: actions/checkout@v3 + with: + path: src/src + + - name: CI + uses: tedd-an/bzcafe@main + with: + task: ci + base_folder: src + space: user + github_token: ${{ secrets.ACTION_TOKEN }} + email_token: ${{ secrets.EMAIL_TOKEN }} + patchwork_token: ${{ secrets.PATCHWORK_TOKEN }} + patchwork_user: ${{ secrets.PATCHWORK_USER }} + diff --git a/.github/workflows/code_scan.yml b/.github/workflows/code_scan.yml new file mode 100644 index 0000000000..181d08c32d --- /dev/null +++ b/.github/workflows/code_scan.yml @@ -0,0 +1,26 @@ +name: Code Scan + +on: + schedule: + - cron: "40 7 * * FRI" + +jobs: + code-scan: + runs-on: ubuntu-latest + steps: + - name: Checkout the source + uses: actions/checkout@v2 + with: + fetch-depth: 0 + path: src + - name: Code Scan + uses: BluezTestBot/action-code-scan@main + with: + src_path: src + github_token: ${{ secrets.GITHUB_TOKEN }} + email_token: ${{ secrets.EMAIL_TOKEN }} + - uses: actions/upload-artifact@v2 + with: + name: scan_report + path: scan_report.tar.gz + diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000000..d935cca9fa --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,43 @@ +name: Sync + +on: + schedule: + - cron: "*/30 * * * *" + +jobs: + sync_repo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: master + + - name: Sync Repo + uses: tedd-an/bzcafe@main + with: + task: sync + upstream_repo: 'https://git.kernel.org/pub/scm/bluetooth/bluez.git' + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Cleanup PR + uses: tedd-an/bzcafe@main + with: + task: cleanup + github_token: ${{ secrets.ACTION_TOKEN }} + + sync_patchwork: + needs: sync_repo + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Sync Patchwork + uses: tedd-an/bzcafe@main + with: + task: patchwork + space: user + github_token: ${{ secrets.ACTION_TOKEN }} + email_token: ${{ secrets.EMAIL_TOKEN }} + patchwork_token: ${{ secrets.PATCHWORK_TOKEN }} + patchwork_user: ${{ secrets.PATCHWORK_USER }} + From 5afb0887b4383dcee52677b5cd29a676811c0d0a Mon Sep 17 00:00:00 2001 From: Shuai Zhang Date: Thu, 27 Mar 2025 16:41:28 +0800 Subject: [PATCH 2/2] dbus: Fix add invalid memory during interface removal test setp register_service register_application unregister_service unregister_application register_service register_application core dump invalidate_parent_data is called to add the service to the application's glist when unregister_service. However, this service has already been added to the glist of root object in register_service. This results in services existing in both queues,but only the services in the application's glist are freed upon removal. A null address is stored in root object's glist, a crash dump will occur when get_object is called. Add a check for the parent pointer to avoid adding the service again. 0 0x0000007ff7df6058 in dbus_message_iter_append_basic () from /usr/lib/libdbus-1.so.3 1 0x00000055555a3780 in append_object (data=0x31306666, user_data=0x7ffffff760) at /usr/src/debug/bluez5/5.72/gdbus/object.c:1117 2 0x0000007ff7ece0cc in g_slist_foreach () from /usr/lib/libglib-2.0.so.0 3 0x00000055555a37ac in append_object (data=0x5555642cf0, user_data=0x7ffffff760) at /usr/src/debug/bluez5/5.72/gdbus/object.c:1122 4 0x0000007ff7ece0cc in g_slist_foreach () from /usr/lib/libglib-2.0.so.0 5 0x00000055555a3630 in get_objects (connection=, message=, user_data=0x555563b390) at /usr/src/debug/bluez5/5.72/gdbus/object.c:1154 6 0x00000055555a51d0 in process_message ( connection=connection@entry=0x5555639310, message=message@entry=0x5555649ac0, method=method@entry=0x55555facf8 , iface_user_data=) at /usr/src/debug/bluez5/5.72/gdbus/object.c:246 7 0x00000055555a575c in generic_message (connection=0x5555639310, message=0x5555649ac0, user_data=) Signed-off-by: Shuai Zhang --- gdbus/object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdbus/object.c b/gdbus/object.c index 7b0476f1ad..d87a81160c 100644 --- a/gdbus/object.c +++ b/gdbus/object.c @@ -809,7 +809,8 @@ static struct generic_data *invalidate_parent_data(DBusConnection *conn, if (child == NULL || g_slist_find(data->objects, child) != NULL) goto done; - + if(g_slist_find(parent->objects, child) != NULL) + goto done; data->objects = g_slist_prepend(data->objects, child); child->parent = data;