platform/core/system/crash-worker.git
8 months agoFree 'hash_str_full' only if it was allocated 57/297957/1 accepted/tizen_8.0_unified tizen_8.0 accepted/tizen/8.0/unified/20231005.093732 accepted/tizen/unified/20230830.170554 tizen_8.0_m2_release
Sung-hun Kim [Tue, 29 Aug 2023 06:45:35 +0000 (15:45 +0900)]
Free 'hash_str_full' only if it was allocated

Change-Id: Ided519be8f5a6145d0ea018fa37a0f5a7ef7a213
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
8 months agoFix a coverity issue 56/297956/1
Sung-hun Kim [Tue, 29 Aug 2023 06:40:41 +0000 (15:40 +0900)]
Fix a coverity issue

This patch fixes a coverity issue [1].
Since 'ctx' is dereferenced in EVP_DigestInit_ex call, it should be NULL checked before calling this function.

[1] http://10.113.139.115:8081/reports.htm#v19039/p11006/fileInstanceId=612233125&defectInstanceId=130271535&mergedDefectId=1706287

Change-Id: I0e1e8a7a775734649ecffe9d5adaf0bd71dac8a5
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
9 months agocrash-stack: Always print threads information 45/297445/1 accepted/tizen/unified/20230825.044304
Karol Lewandowski [Thu, 17 Aug 2023 20:18:44 +0000 (22:18 +0200)]
crash-stack: Always print threads information

The default behaviour was to skip thread information when there
was only one (main) thread.  This however, breaks report parsing
as it has been recently added for `bugreport-service --type pid
feature[1].

This commit makes printing thread info unconditional, fixing
bugrepor-service.

[1] dumpsys org.tizen.bugreport-service --type pid

Change-Id: Icfc6ebe3e44c86d241f22cf88f0561f697d7e361

9 months agopackaging: Add friendly reminder about the need to call set_capability for tools... 64/297364/2 accepted/tizen/unified/20230818.054622
Karol Lewandowski [Thu, 17 Aug 2023 09:42:27 +0000 (11:42 +0200)]
packaging: Add friendly reminder about the need to call set_capability for tools to work

Change-Id: I2c847032505b2fc5c04e3fe3f42a5f2effc3cb50

9 months agocrash-stack: Check return of EVP_*() calls 04/297304/5
Karol Lewandowski [Wed, 16 Aug 2023 12:39:46 +0000 (14:39 +0200)]
crash-stack: Check return of EVP_*() calls

Change-Id: Idb2f43986986fd11f696962d17599304dc10c417

9 months agodiagnostics: Fix errors found via static analysis 03/297303/3
Karol Lewandowski [Wed, 16 Aug 2023 12:23:04 +0000 (14:23 +0200)]
diagnostics: Fix errors found via static analysis

Change-Id: Iad3f8e31e62d5a0fe2d87a98e9fdbfe26359a4e0

9 months agoChange /usr/bin/crash-worker Smack label to floor (_) 45/296145/3 accepted/tizen_unified_riscv accepted/tizen/unified/riscv/20230726.061410
Karol Lewandowski [Thu, 20 Jul 2023 10:05:28 +0000 (12:05 +0200)]
Change /usr/bin/crash-worker Smack label to floor (_)

This change is needed after kernel started launching processes
using usermodehelper process. Usermodehelper runs with normal
privileges (Smack floor label) all normal policies apply to it.
Thus, in order for it to launch crash-worker it either needs to
have same label or there exists rule that allows given transition.

Adding rule allowing _ to execute System would break Tizen policy
so the other option is to change crash-worker label to _, which
is what this commit does.

There should be no adverse affects of this patch as crash-worker
is already only allowed to be executed by root:crash_worker uids:gids.

Ref: https://lore.kernel.org/all/20220607165003.871993847@linuxfoundation.org/

Change-Id: I805d263fec72b491d0fc0915413d2c3bdded91ab
Reported-by: Sunghun Kim <sfoon.kim@samsung.com>
10 months agoUpgrade OpenSSL version 52/296152/3 accepted/tizen/unified/20230731.175255
Mateusz Moscicki [Thu, 20 Jul 2023 10:51:52 +0000 (12:51 +0200)]
Upgrade OpenSSL version

Change-Id: I2e1bec24859056fa4c64b096c748b85c592050c4

10 months agodump_systemstate-service: Fix possible memory leaks 66/294966/1 accepted/tizen_unified_dev accepted/tizen/unified/dev/20230726.115826
Sung-hun Kim [Thu, 29 Jun 2023 06:57:33 +0000 (15:57 +0900)]
dump_systemstate-service: Fix possible memory leaks

The `strdup` call uses `malloc` internally for allocating memory
area. Thus, the result of `strdup` should be freed in the
allocation failed cases.

Change-Id: I01a1f1653cd1ddbac5e89cdfb085e0d273414c6c
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
10 months agodump_systemstate-service: Fix a build error on GCC-13 59/294959/2
Sung-hun Kim [Thu, 29 Jun 2023 05:41:04 +0000 (14:41 +0900)]
dump_systemstate-service: Fix a build error on GCC-13

Building on GCC-13 stops on the below build error:

[   16s] [ 64%] Built target test1-default-sleep
[   17s] /home/abuild/rpmbuild/BUILD/crash-worker-7.0.1/src/dump_systemstate-service/dump_systemstate-service.c: In function 'split':
[   17s] /home/abuild/rpmbuild/BUILD/crash-worker-7.0.1/src/dump_systemstate-service/dump_systemstate-service.c:101:25: error: pointer 'result' may be used after 'realloc' [-Werror=use-after-free]
[   17s]   101 |                         free(result);
[   17s]       |                         ^~~~~~~~~~~~
[   17s] /home/abuild/rpmbuild/BUILD/crash-worker-7.0.1/src/dump_systemstate-service/dump_systemstate-service.c:92:37: note: call to 'realloc' here
[   17s]    92 |                 char **result_tmp = realloc(result, (*size + 1) * sizeof(char *));
[   17s]       |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Since the memory area pointed by `result` can be freed by `realloc`,
`result` should be freed conditionally.

Change-Id: I09ee12f83073665ef37788fa948b72ce3883ea3f
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
10 months agobugreport-service: Add PID information as a new type of bugreport 33/293933/4
Sung-hun Kim [Thu, 1 Jun 2023 07:05:36 +0000 (16:05 +0900)]
bugreport-service: Add PID information as a new type of bugreport

To prevent unlimited re-executing a crashed app, application manager
(e.g., AMD) needs an information of PID for the crashed app. But it
don't need the full report of it. So, we need to add a method to get
only the PID while using same diagnostics API call for convenience.

At the perspective of caller, it just uses the same diagnostics API
with an argument "PID" to get the PID of the crashed app.

Change-Id: I165ea2e33840bd803ae4319137bb44f7b2c883d3
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
13 months agoFix build issue on riscv 95/290495/1
Mateusz Moscicki [Mon, 27 Mar 2023 12:48:59 +0000 (14:48 +0200)]
Fix build issue on riscv

Change-Id: I37083fc604170613f0d7033afc6fa4cfb12901ae

14 months agoFix build issue on armv7l related to ptrace() 50/289850/1 accepted/tizen/unified/20230320.021836
Mateusz Moscicki [Tue, 14 Mar 2023 15:55:32 +0000 (16:55 +0100)]
Fix build issue on armv7l related to ptrace()

Change-Id: Ia33eefb96b7f98c9c983f236d30c6dc643b88d1a

14 months agoFix SVACE issuses 47/289847/1
Mateusz Moscicki [Tue, 14 Mar 2023 12:56:53 +0000 (13:56 +0100)]
Fix SVACE issuses

Change-Id: I371e7a235ce5502d8a5f01cdfecac509efac7cc9

17 months agoAdd support for RISC-V 35/285135/4
Mateusz Moscicki [Thu, 1 Dec 2022 11:34:48 +0000 (12:34 +0100)]
Add support for RISC-V

Change-Id: Id1cbadf09b55f7da416833981b0e14ce6202cd7e

2 years agoFix realpath(3) memory leak 96/270496/1 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_7.0 tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.060611 accepted/tizen/7.0/unified/hotfix/20221116.105659 accepted/tizen/unified/20220204.132338 accepted/tizen/unified/20220220.211421 submit/tizen/20220203.172140 submit/tizen/20220219.164033 tizen_7.0_m2_release
Karol Lewandowski [Thu, 3 Feb 2022 11:40:06 +0000 (12:40 +0100)]
Fix realpath(3) memory leak

Change-Id: Ic2e2264a8dab194884decfa5acb9035ea712b149

2 years agoRelease 7.0.1 07/269307/1 accepted/tizen/unified/20220114.130110 submit/tizen/20220112.233041
Mateusz Moscicki [Wed, 12 Jan 2022 15:16:08 +0000 (16:16 +0100)]
Release 7.0.1

Change-Id: I4d0e812752f4d396668bbca7da1b6222c3261dff

2 years agoFix the release of ELF data resources 06/269306/1
Mateusz Moscicki [Wed, 12 Jan 2022 14:52:29 +0000 (15:52 +0100)]
Fix the release of ELF data resources

Change-Id: I66810a17c4fa04db981a6c325e6a054a334d0bfb

2 years agoRelease 7.0.0 03/268903/3 accepted/tizen/unified/20220105.120700 submit/tizen/20220104.145800
Mateusz Moscicki [Tue, 4 Jan 2022 13:57:30 +0000 (14:57 +0100)]
Release 7.0.0

Change-Id: Ibb09b26050346252f4c8b7caeffbb0c804a60175

2 years agoRemove 500.crash-manager-upgrade.sh 02/268902/2
Mateusz Moscicki [Tue, 4 Jan 2022 13:28:23 +0000 (14:28 +0100)]
Remove 500.crash-manager-upgrade.sh

This script prepares directories and permissions when upgrading from
Tizen 5.5 to 6.0. Therefore it is no longer needed.

Change-Id: I1c4b4baeea02c4b0c9ac4131da297352b72399ce

2 years agoRelease 6.5.22 71/264371/1 accepted/tizen/6.5/unified/20211028.114240 accepted/tizen/unified/20210917.124812 submit/tizen/20210916.121713 submit/tizen_6.5/20211028.162501 tizen_6.5.m2_release
Karol Lewandowski [Thu, 16 Sep 2021 11:44:41 +0000 (13:44 +0200)]
Release 6.5.22

Change-Id: Ib867761ec1c4089efd85f8e5f94a74f932d21683

2 years agopackaging: Drop unneeded BuildRequires 70/264370/1
Karol Lewandowski [Thu, 16 Sep 2021 11:33:44 +0000 (13:33 +0200)]
packaging: Drop unneeded BuildRequires

Not only it was in wrong section but there is already
BuildRequires: pkgconfig(diagnostics) in top section.

Change-Id: I66dac6e85a82f350c56675bd370c68a586d299bf

2 years agopackaging: Update license specifications after relicensing parts of codebase 69/264369/1
Karol Lewandowski [Thu, 16 Sep 2021 11:31:39 +0000 (13:31 +0200)]
packaging: Update license specifications after relicensing parts of codebase

Additionally, rename LICENSE to LICENSE.Apache-2.0 for clarity.

Change-Id: If2eb9621ad0808970521d64a5dfe8099913ec2b3

2 years agoAdd missing license header to crash-json2info 68/264368/1
Karol Lewandowski [Thu, 16 Sep 2021 11:29:39 +0000 (13:29 +0200)]
Add missing license header to crash-json2info

Change-Id: Id9d16738ab457a78cba9192deb64b0640d39946c

2 years agoRelicense crash-manager to MIT 33/264233/1
Karol Lewandowski [Tue, 14 Sep 2021 13:11:52 +0000 (15:11 +0200)]
Relicense crash-manager to MIT

This includes relicensing:
 - crash-manager - the standalone program, which uses libcrash-manager
 - libcrash-manager - library that contains most of the logic

After this change libcrash-manager can be safely combined with GPL-2.0
binaries.

Change-Id: I564837e3ffe7ae5291b8e92bf1199f6277e04017

2 years agosystem-tests: Fix behavior when dump directory is missing 32/253932/2
Mateusz Moscicki [Fri, 19 Feb 2021 10:41:07 +0000 (11:41 +0100)]
system-tests: Fix behavior when dump directory is missing

Since crash-manager is responsible for creating dump directory
(commit 96a11f21e013e1de3d02ee438c4291d55de56e9e), the
absence of this directory cannot be considered as an error.

Change-Id: I8db05869c951b3d9b893a223d020dc146ba9455f

2 years agoRelease 6.5.21 42/259742/1 accepted/tizen/unified/20210615.215243 submit/tizen/20210611.114327 submit/tizen/20210615.092029
Mateusz Moscicki [Fri, 11 Jun 2021 11:23:35 +0000 (13:23 +0200)]
Release 6.5.21

Change-Id: I8d58aab1e533cb1563d9f053df79a73ea72e8963

2 years agoMerge "telf: Fix uninitialized pointer read" into tizen
Mateusz Mościcki [Fri, 11 Jun 2021 10:54:11 +0000 (10:54 +0000)]
Merge "telf: Fix uninitialized pointer read" into tizen

2 years agotelf: Fix uninitialized pointer read 38/259738/1
Mateusz Moscicki [Fri, 11 Jun 2021 10:39:29 +0000 (12:39 +0200)]
telf: Fix uninitialized pointer read

Change-Id: I8bf8dbed9af82c895ec3040eeafdb03a0d74fd04

2 years agobugreport-service: fix memory leak 25/259725/1
Karol Lewandowski [Fri, 11 Jun 2021 10:20:40 +0000 (12:20 +0200)]
bugreport-service: fix memory leak

Change-Id: I8609072ca5a0eaf55c613390ece3d58b891e6d51

2 years agoRelease 6.5.20 98/258998/2 accepted/tizen/unified/20210531.130334 submit/tizen/20210528.151917
Mateusz Moscicki [Fri, 28 May 2021 15:15:21 +0000 (17:15 +0200)]
Release 6.5.20

Change-Id: I6f2ecd6a3c5ac242ae6e8783c528dd4a76cad0d5

2 years agoMerge "Continue creating a report even if an error has occured" into tizen
Karol Lewandowski [Fri, 28 May 2021 15:08:42 +0000 (15:08 +0000)]
Merge "Continue creating a report even if an error has occured" into tizen

2 years agoContinue creating a report even if an error has occured 16/258916/1
Mateusz Moscicki [Thu, 27 May 2021 20:44:40 +0000 (22:44 +0200)]
Continue creating a report even if an error has occured

If an error occurs during minicoredump or dumpsystemstate creation,
report creation is not aborted to preserve as much information about the
crash as possible.

Change-Id: I133eae76335fb0a3a2f6d676393a23576493a44c

2 years agocrash-stack: Drop dead code 11/258911/1
Karol Lewandowski [Thu, 27 May 2021 12:12:37 +0000 (14:12 +0200)]
crash-stack: Drop dead code

Change-Id: Ib463525ae36cd1db3910748e3246e327dc13533f

3 years agocrash-manager: Fix memory leak 25/258425/1
Mateusz Moscicki [Mon, 17 May 2021 10:47:57 +0000 (12:47 +0200)]
crash-manager: Fix memory leak

Change-Id: I022a378b011f1f7220f87946c85eca2e7ec8553c

3 years agoTest: remove duplicated link option 03/257903/1
INSUN PYO [Thu, 6 May 2021 07:08:46 +0000 (16:08 +0900)]
Test: remove duplicated link option

Change-Id: I38948f1902482922e5876574bfb42091cce98713

3 years agoRelease 6.5.19 91/257691/3 accepted/tizen/unified/20210505.141406 submit/tizen/20210430.131845 submit/tizen/20210505.030411
Mateusz Moscicki [Thu, 29 Apr 2021 11:30:23 +0000 (13:30 +0200)]
Release 6.5.19

Change-Id: I164d956ca37d4d87dccc1db74039cc022796702b

3 years agocrash-manager: Provide TID as optional value of an -i option 76/257776/2
Mateusz Moscicki [Fri, 30 Apr 2021 10:21:48 +0000 (12:21 +0200)]
crash-manager: Provide TID as optional value of an -i option

Since %i can only be specified in core_pattern since kernel 3.18,
crash-manager must handle the situation where no value is specified for
this parameter. This is implemented in this commit, but the value for
the -i parameter must be specified without spaces.

Change-Id: I2cc2ff5d527a638c0f52df180c3875daf6208e02

3 years agocrash-manager: Fix TID finding 90/257690/2
Mateusz Moscicki [Thu, 29 Apr 2021 10:57:55 +0000 (12:57 +0200)]
crash-manager: Fix TID finding

To find a thread ID that crashed crash-worker checked if
/proc/<pid>/tasks/<pid>/wchan contains pipe_wait or do_coredump.
Additionally it should check if pipe_write is there, because since
kernel 5.10 this content is for the thread that crashed.

Change-Id: Ic45913306d4f5b39ae704abdd58bbd79fef5e7cd

3 years agoRelease 6.5.18 15/257015/1 accepted/tizen/unified/20210423.073215 submit/tizen/20210421.201602
Karol Lewandowski [Fri, 16 Apr 2021 11:50:34 +0000 (13:50 +0200)]
Release 6.5.18

Change-Id: I8c73d1521e36364090d4ac42fd08cc9bc59a1ceb

3 years agoRevert "packaging: Package only bugreport-service and dumpsystemstate-service for TV" 14/257014/1
Karol Lewandowski [Fri, 16 Apr 2021 11:50:06 +0000 (13:50 +0200)]
Revert "packaging: Package only bugreport-service and dumpsystemstate-service for TV"

This reverts commit 15e78af58e90069dff13201dfcc89035664ba650.

Change-Id: Id7951c0beaa7322eb3db5e75865e6bb9f601312e

3 years agobugreport-service: Get bugreport based on event data 27/256827/5 accepted/tizen/unified/20210417.022231 submit/tizen/20210416.144436
Mateusz Moscicki [Fri, 9 Apr 2021 10:57:15 +0000 (12:57 +0200)]
bugreport-service: Get bugreport based on event data

A bugreport identifier is sent along with BugreportCreated event so that
client can request the details of the bugreport to which the event
related:

  static void bugreport_created_cb(diagnostics_ctx_h ctx, void *user_data)
  {
      ...
      const char *params[] = {"--type", "crash-info-json"};
      diagnostics_data_h data;
      diagnostics_get_data(ctx, params, ARRAY_SIZE(params), &data);

      size_t bytes;
      char buff[1024];
      diagnostics_data_read(data, buff, sizeof(buff), 0, &bytes);
      ...
  }

  int main()
  {
      ...
      diagnostics_set_notification_cb(bugreport_created_cb, NULL);
      diagnostics_subscribe_event("BugreportCreated", "org.tizen.bugreport-service");
      g_main_loop_run(mainloop);
      ...
  }

Change-Id: I056f16743e656504dcefe0972eae00bc4b6f58ab

3 years agobugreport-service: Add the ability to get coredump file from a report 88/256188/5
Mateusz Moscicki [Tue, 30 Mar 2021 16:32:19 +0000 (18:32 +0200)]
bugreport-service: Add the ability to get coredump file from a report

This commit adds two more report types that can be obtained:

  coredumptar  - tared coredump file
  fullreport   - zipped report

New types can only be used with a specified report, the identifier of
which must be given as the call argument.

Change-Id: I5c769224c5f5ef89c5d1cc5070a7a4af8a7e0b8a

3 years agobugreport-service: Add crash-info-json report type 87/256187/3
Mateusz Moscicki [Tue, 30 Mar 2021 16:20:56 +0000 (18:20 +0200)]
bugreport-service: Add crash-info-json report type

Change-Id: I7a3a1878085e64852fe19ca44a1045de6f71150f

3 years agoRevert "Fix build error" 70/256270/2
Hyotaek Shim [Wed, 31 Mar 2021 23:55:09 +0000 (23:55 +0000)]
Revert "Fix build error"

This reverts commit 437d159c204e5cae9b5ea6c8a7d294dc73b421af.

Change-Id: I72df3308c18fef162740c783f80c897e31c7a7fc

3 years agoRelease 6.5.17: Fix resource leaks 59/256259/4 accepted/tizen/unified/20210401.105943 submit/tizen/20210331.120928
Karol Lewandowski [Wed, 31 Mar 2021 09:54:41 +0000 (11:54 +0200)]
Release 6.5.17: Fix resource leaks

Change-Id: I3f4b6031baba78e3db2105020db3cbe24f3736e8

3 years agoFix build error 23/256223/1 accepted/tizen/unified/20210331.104644 submit/tizen/20210331.055612
Hyotaek Shim [Wed, 31 Mar 2021 05:49:20 +0000 (14:49 +0900)]
Fix build error

[  101s] /home/abuild/rpmbuild/BUILD/crash-worker-6.5.16/tests/system/utils/
libbugreport-servicetest.c:46:51: error: 'CS_ERR_NO_ERROR' undeclared (first use in this function)
[  101s]    46 |  printf("res: %s (%d)\nreport_path: %s\n", res == CS_ERR_NO_ERROR ? "true" ...
[  101s]       |                                                   ^~~~~~~~~~~~~~~

Change-Id: I5f9588ee8c3b9f9be15169a848ac6082e67ce042
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoFix memory leak and remove the unused code 06/256006/3 accepted/tizen/unified/20210330.111258 submit/tizen/20210329.082152 submit/tizen/20210329.184123
Mateusz Moscicki [Fri, 26 Mar 2021 08:58:19 +0000 (09:58 +0100)]
Fix memory leak and remove the unused code

Change-Id: Ic746786b2c76314d671a18d992a25451c564197f

3 years agoRelease 6.5.16: Various fixes 43/255943/6 submit/tizen/20210325.112955
Karol Lewandowski [Thu, 25 Mar 2021 07:38:23 +0000 (08:38 +0100)]
Release 6.5.16: Various fixes

 - Restore /opt/usr/share/crash/dump directory for tizen smoke scripts
 - Fix TV build

Change-Id: Id64d47dae3e592089ba1c02c79365af7a19791dc

3 years agobugreport-service uses the default crash_root_path when there is no config file 49/255949/2
Mateusz Moscicki [Thu, 25 Mar 2021 10:13:42 +0000 (11:13 +0100)]
bugreport-service uses the default crash_root_path when there is no config file

Change-Id: If5d6b0b0323576a27e115a407c3130a2bac2111f

3 years agoRelease 6.5.15: bugreport-service fixes 83/255883/1 submit/tizen/20210324.085352
Karol Lewandowski [Wed, 24 Mar 2021 20:26:55 +0000 (21:26 +0100)]
Release 6.5.15: bugreport-service fixes

This release fixes up two important issues with bugreport-service:
 - null-terminate array of getopt args to avoid crash on arg parsing
 - default to 'bugreport' report type when it's not specified

Change-Id: I7e99d19cfacb7f1193314a9dd4c6256b9aa25503

3 years agoRelease 6.5.14 80/255880/2
Mateusz Moscicki [Wed, 24 Mar 2021 12:59:04 +0000 (13:59 +0100)]
Release 6.5.14

Change-Id: Ib05ad5ca226f68e88d3dd9b842f8232dd359042d

3 years agoMove the bugreport library to the diagnostics repository 78/255878/3
Mateusz Moscicki [Wed, 24 Mar 2021 11:54:02 +0000 (12:54 +0100)]
Move the bugreport library to the diagnostics repository

Change-Id: I05ee9089e4fa74fa58f0a8554aa67e82a10372f2

3 years agoFix svace issues 88/255788/3
Mateusz Moscicki [Tue, 23 Mar 2021 14:32:43 +0000 (15:32 +0100)]
Fix svace issues

Change-Id: Ic4935bd22bccaa3f07f7cbd57055f5f7bfe58ff1

3 years agoChange livedump_pid() return codes 58/255758/4
Konrad Kuchciak [Tue, 23 Mar 2021 09:55:39 +0000 (10:55 +0100)]
Change livedump_pid() return codes

livedump_pid() returns 0 on success, otherwise a negative error value
TIZEN_ERROR_PERMISSION_DENIED - privilege error
TIZEN_ERROR_NO_SUCH_PROCESS - no such process
TIZEN_ERROR_IO_ERROR - other error

Change-Id: If961771e745e98212ca9ded959dfa504b197f030
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
3 years agobugreport-service: Add return error code about no process for livedump_pid() method 87/255787/2
Mateusz Moscicki [Tue, 23 Mar 2021 11:29:18 +0000 (12:29 +0100)]
bugreport-service: Add return error code about no process for livedump_pid() method

Change-Id: I9f0182b9b857c4aca685d495f568c1fbd48a8b37

3 years agoCheck dbus bugreport.admin privilege for accessing livedump_pid 86/255786/1
Mateusz Moscicki [Mon, 22 Mar 2021 13:10:46 +0000 (14:10 +0100)]
Check dbus bugreport.admin privilege for accessing livedump_pid

Change-Id: Ia41d63e1f461454cb9f9d297113624e96bdb3ca6

3 years agocrash-stack: Drop unused get_threads() 95/255695/1
Karol Lewandowski [Mon, 22 Mar 2021 15:39:07 +0000 (16:39 +0100)]
crash-stack: Drop unused get_threads()

Change-Id: I8146fe9c52889d872967dadfa12065dabb42cc3f

3 years agoRelease 6.5.13 43/255443/10 submit/tizen/20210322.183501
Mateusz Moscicki [Thu, 18 Mar 2021 10:15:58 +0000 (11:15 +0100)]
Release 6.5.13

Change-Id: Iccc7f0dd4aafcf6056282a71880b4dd8df89a3a1

3 years agoAllow to get bugreports using the diagnostics API 21/255621/3
Mateusz Moscicki [Fri, 19 Mar 2021 16:53:49 +0000 (17:53 +0100)]
Allow to get bugreports using the diagnostics API

bugreport-service registers as a org.tizen.bugreport-service and allows
to get bugreport and crash-info report by dumpsys.
For example: to get all bugreports created in the last hour run:

  dumpsys org.tizen.bugreport-service -- --type bugreport --last 3600

Supported parameters:

  --type <bugreport|crash-info>  Get specified report
  --last <sec>          Get reports created in the last <sec>
  --from <timestamp>    Get reports created after a specified time
  --to <timestamp>      Get reports created before a specified time

Change-Id: I0d3e04c34b63f3a559c8bde9af703eeabeb4e7ae

3 years agoSend diagnostics event (BugreportCreated) when new bugreport is created 20/255620/2
Mateusz Moscicki [Fri, 19 Mar 2021 16:51:35 +0000 (17:51 +0100)]
Send diagnostics event (BugreportCreated) when new bugreport is created

Change-Id: I0fe77932bec656e1abbf0a1fd79eb68ae233ea3d

3 years agolibbugreport: Drop needless -service suffix 60/255460/1 submit/tizen/20210322.215101 submit/tizen/20210324.111927
Karol Lewandowski [Thu, 18 Mar 2021 11:26:43 +0000 (12:26 +0100)]
libbugreport: Drop needless -service suffix

Change-Id: I1f7c0d4b021c5bee76d2325649c55bdc6478eac1

3 years agospec: Fix crash_root directory permission 56/255456/4
Mateusz Moscicki [Thu, 18 Mar 2021 11:57:46 +0000 (12:57 +0100)]
spec: Fix crash_root directory permission

Change-Id: Id2f1f4ac5fb2f160011d5ccb1976645f8b853d55

3 years agospec: Ensure needed crash_worker user is available during package installation 91/255291/2
Karol Lewandowski [Tue, 16 Mar 2021 08:53:01 +0000 (09:53 +0100)]
spec: Ensure needed crash_worker user is available during package installation

Some system users are created by security-config package %post script, thus
we need to ensure this package is installed and configured before we install
packages containing, in our case, crash_worker-user owned files/dirs.

Change-Id: I122e992936f4569cbb5f42f0f38f4ce9f5fb2100

3 years agoMove the libbugreport library to the separate spec 08/255308/3
Mateusz Moscicki [Tue, 16 Mar 2021 11:15:58 +0000 (12:15 +0100)]
Move the libbugreport library to the separate spec

A separate spec is needed because diagnostics depends on libbugreport,
while bugreport-service requires diagnostics.

Change-Id: I809e21be045ca6d29d5851032d135a308e816c16

3 years agoRelease 6.5.12 55/255155/4 accepted/tizen/unified/20210318.055925 submit/tizen/20210315.181414
Karol Lewandowski [Fri, 12 Mar 2021 12:21:22 +0000 (13:21 +0100)]
Release 6.5.12

* Add new dumpsystemstate-service
* Rename crash-service to bugreport-service
* Decouple bugreport-service from crash-worker dependencies
* Rework packaging to make it possible to complile out/disable crash-worker/livedumper/etc.

Change-Id: I7b3bdd9156e786d7bbba1d49ef6db36659eb7c48

3 years agospec: Santize programs' permissions 41/255241/1
Karol Lewandowski [Mon, 15 Mar 2021 14:00:47 +0000 (15:00 +0100)]
spec: Santize programs' permissions

Use default only where necessary and clearly
write the reason behind it.

Change-Id: I96b696c4b8268a9548be3f105dc827a67b436742

3 years agospec: Provide libcrash-service to ease transition to libbugreport 61/255161/2
Karol Lewandowski [Fri, 12 Mar 2021 16:44:49 +0000 (17:44 +0100)]
spec: Provide libcrash-service to ease transition to libbugreport

Change-Id: I33d83f9d5e40e6d6d1940597424bba87fcc4552d

3 years agopackaging: Package only bugreport-service and dumpsystemstate-service for TV 70/255070/3
Karol Lewandowski [Thu, 11 Mar 2021 22:00:42 +0000 (23:00 +0100)]
packaging: Package only bugreport-service and dumpsystemstate-service for TV

Change-Id: Ia2b330a71d6775821dce0db5f2076074dfe396c1

3 years agospec: redesign 58/255058/5
Karol Lewandowski [Thu, 11 Mar 2021 13:59:12 +0000 (14:59 +0100)]
spec: redesign

Change-Id: I5b2b2337413c4ea019be4c876449263d8ef72257

3 years agobugreport-service: Independence from the crash-manager 68/255068/3
Mateusz Moscicki [Wed, 10 Mar 2021 10:30:39 +0000 (11:30 +0100)]
bugreport-service: Independence from the crash-manager

The changes that this commit makes allow to install the
bugreport-service without having to install crash-manager.

Change-Id: If448436c0dff6a69f1bef6b4d249c199f549dec8

3 years agolibcrash-service: Do not export unneeded symbols 54/255054/1
Karol Lewandowski [Thu, 11 Mar 2021 11:23:33 +0000 (12:23 +0100)]
libcrash-service: Do not export unneeded symbols

Change-Id: I5584761b83f386568b869be921f667d18c6cfd3e

3 years agobugreport: Ensure library is linked to libraries we actually need 33/255033/3
Karol Lewandowski [Thu, 11 Mar 2021 09:39:18 +0000 (10:39 +0100)]
bugreport: Ensure library is linked to libraries we actually need

We always link to libcrash-manager but it might not be needed,
if livecoredump suport is disabled.

This commit prepares bugreport-service to be libcrash-manager-independent.

Change-Id: I4d506e517ce2da22daa047741187a15f91da4180

3 years agoAdd dump_systemstate-service 91/253491/10
Mateusz Moscicki [Mon, 15 Feb 2021 12:16:53 +0000 (13:16 +0100)]
Add dump_systemstate-service

The service registers with the name org.tizen.systemstate and provides
the output of defined commands via dumpsys interface. The registration
of commands is done by adding dumpsyscmd parameter to the extra program
configuration file. For example, the following configuration in
/etc/dump_systemstate.conf.d/programs/crash-worker-programs.conf:

  ...

  [buxton system]
  order=141
  cmdflag=b
  title=System configuration
  path=/usr/bin/buxton2ctl
  args=dump system
  dumpsyscmd=buxton_system
  allowdumpsysargs=yes
  ...

allows to get the output of the command:

  /usr/bin/buxton2ctl dump system

by calling:

  dumpsys org.tizen.systemstate buxton_system

The allowdumpsysargs parameter is responsible for the possibility to
provide custom parameters via dumpsys (disallowed by default).

Change-Id: Iff9569d4975ab97addfcf32ea6c22d7237275b35

3 years agodump_systemstate: Extract the function to read ini files 90/253490/5
Mateusz Moscicki [Mon, 15 Feb 2021 12:09:34 +0000 (13:09 +0100)]
dump_systemstate: Extract the function to read ini files

Change-Id: I53b79be8953bfc1d6c3c420913d8afa47cac5004

3 years agopackaging: Split packages to allow installing only bugreport-service with its deps 14/254814/3
Karol Lewandowski [Tue, 9 Mar 2021 13:55:15 +0000 (14:55 +0100)]
packaging: Split packages to allow installing only bugreport-service with its deps

Change-Id: I8e225cc465b6a6585fd7f3f292e249a27bcff898

3 years agobugreport: Ensure DLog tag is always specified 13/254813/1
Karol Lewandowski [Tue, 9 Mar 2021 11:47:59 +0000 (12:47 +0100)]
bugreport: Ensure DLog tag is always specified

Change-Id: I4ccde9340c18e9589fdfdc03ba0937c2632ff4bf

3 years agoChange the crash-service to the bugreport-service 00/254100/4
Mateusz Moscicki [Tue, 23 Feb 2021 09:40:57 +0000 (10:40 +0100)]
Change the crash-service to the bugreport-service

Change-Id: Ieea6c499a279f8bbe6c61232bbc49c4f0f768691

3 years agoCreate a report with only dump_systemstate output for PID <= 0 51/253851/6
Mateusz Moscicki [Thu, 18 Feb 2021 11:08:55 +0000 (12:08 +0100)]
Create a report with only dump_systemstate output for PID <= 0

Passing PID <= 0 to livedump_pid() API method will create a report
containing only dump_systemstate output.

Change-Id: I38dd566acb0ff2f1a0ecf0a492dbdac91343c215

3 years agoRelease 6.5.11 34/254034/1 accepted/tizen/unified/20210222.215244 submit/tizen/20210222.111341
Mateusz Moscicki [Mon, 22 Feb 2021 10:36:33 +0000 (11:36 +0100)]
Release 6.5.11

Change-Id: Ied63aff39a5c9b5d03874683e9e2ab08bab6c661

3 years agoRe-create crash_path for compatibilities. 54/253954/1
Kunhoon Baik [Sun, 21 Feb 2021 03:39:22 +0000 (12:39 +0900)]
Re-create crash_path for compatibilities.

The crash_path should be installed at image creation time for several Tizen testing infras.
Until Tizen testing infras will be modified, the crash_path should be remained.

Change-Id: Iea7166e87a2dbd3b55bb95f8d8a492d17dec50a0

3 years agoRelease 6.5.10 04/253104/6 submit/tizen/20210205.125131 submit/tizen/20210217.095429 submit/tizen/20210217.142253
Mateusz Moscicki [Thu, 4 Feb 2021 11:47:23 +0000 (12:47 +0100)]
Release 6.5.10

Change-Id: I1a7060c4c3949a28f2e7d66c31ff85063e3eb295

3 years agoSet permissions explicitly for directories and reports 02/253202/1
Mateusz Moscicki [Fri, 5 Feb 2021 10:47:31 +0000 (11:47 +0100)]
Set permissions explicitly for directories and reports

Change-Id: If01ddf2a7f73a6b808f3cd8d39f20a77c74231d3

3 years agocrash-manager, service: Set a restrictive umask 13/253113/4
Karol Lewandowski [Thu, 4 Feb 2021 15:03:15 +0000 (16:03 +0100)]
crash-manager, service: Set a restrictive umask

Setting such a mask will make any files created on ocassion (such as
temporary files) unreadable by others.

Change-Id: I6843a49cb123a663effb1ab99e8118e968786624

3 years agopackaging: Drop redundant directories 03/253103/4
Karol Lewandowski [Thu, 4 Feb 2021 11:05:22 +0000 (12:05 +0100)]
packaging: Drop redundant directories

These directories are created on-demand by crash-manager/service.

There is no need to main correct permission/label set in multiple
places.

Change-Id: Ie81cd358d9e17d4249bbdc0a2ed791b5097fa583

3 years agoMerge branch 'tizen_6.0' into tizen 20/252820/1 submit/tizen/20210202.125831
Mateusz Moscicki [Tue, 2 Feb 2021 11:14:57 +0000 (12:14 +0100)]
Merge branch 'tizen_6.0' into tizen

Change-Id: I3d8551cda3f54fd4bfa617667a54ef7238c39949

3 years agoRelease 6.0.30 11/252811/1 submit/tizen_6.0/20210202.125902
Mateusz Moscicki [Tue, 2 Feb 2021 11:13:16 +0000 (12:13 +0100)]
Release 6.0.30

Change-Id: I5480be318f6855562e7b4599be2b002d5d97ca37

3 years agodiagnostics-run.conf: fix tmpfile location in 64 bit 10/252810/1
INSUN PYO [Fri, 29 Jan 2021 03:07:55 +0000 (12:07 +0900)]
diagnostics-run.conf: fix tmpfile location in 64 bit

Change-Id: Ieda58ed71f73503127ba44b85f8bc0d6fa6e26f0

3 years agocrash-manager: Set primary group 01/252801/1
Karol Lewandowski [Tue, 2 Feb 2021 09:00:59 +0000 (10:00 +0100)]
crash-manager: Set primary group

Previously only supplementary groups were set, leaving main gid to
be 'root'.

Change-Id: I50494ca40192c985d07cf07827c4f44c4f99b1d7

3 years agoMerge branch 'tizen' into tizen_6.0 93/252093/1 accepted/tizen/6.0/unified/20210126.035401 submit/tizen_6.0/20210122.102603
Mateusz Moscicki [Fri, 22 Jan 2021 09:47:42 +0000 (10:47 +0100)]
Merge branch 'tizen' into tizen_6.0

Change-Id: Ib47738a925b7ce8f241d1f865a4ca6767013d273

3 years agoRelease 6.5.8 90/252090/1 accepted/tizen/unified/20210125.132336 submit/tizen/20210122.102631
Mateusz Moscicki [Fri, 22 Jan 2021 09:45:55 +0000 (10:45 +0100)]
Release 6.5.8

Change-Id: I4a4549b63a6ea415d8a1818d7bb1b782bebe6eea

3 years agocrash-service: Drop priv_* group from policy as these are not allowed by tizen sanity... 16/252016/2
Karol Lewandowski [Thu, 21 Jan 2021 20:07:11 +0000 (21:07 +0100)]
crash-service: Drop priv_* group from policy as these are not allowed by tizen sanity checkers

It seems priv_* groups can not be explicitly listed, as image creation fails with:

[01/21 15:50:01 UTC] FAILED(assert) at /busconfig/policy[3] : Group 'priv_*' is not allowed.
[01/21 15:50:01 UTC] Found 1 Fails
[01/21 15:50:01 UTC] Remove conf file : mv /etc/dbus-1/system.d/crash-service.conf /etc/dbus-1/system.d/crash-service.conf.fail

Change-Id: Ieea004890dfbccddf9d16ee949f55f3a02461bcc

3 years agoMerge branch 'tizen' into tizen_6.0 04/251904/1 submit/tizen_6.0/20210121.145209
Karol Lewandowski [Wed, 20 Jan 2021 15:32:37 +0000 (16:32 +0100)]
Merge branch 'tizen' into tizen_6.0

Change-Id: Iaec2734d534c06682dc3bb85b7339fc6a685e14f

3 years agoRelease 6.5.7 03/251903/1 submit/tizen/20210121.145225
Karol Lewandowski [Wed, 20 Jan 2021 15:28:46 +0000 (16:28 +0100)]
Release 6.5.7

Change-Id: Iab075746a882ac423c212f4b803fa8fa48984dfe

3 years agocrash-service: Re-add privilege <check> for livedump 33/251833/4
Karol Lewandowski [Tue, 19 Jan 2021 16:56:47 +0000 (17:56 +0100)]
crash-service: Re-add privilege <check> for livedump

dbus-daemon uses getgrouplist() to get group membership, meaning
that we can't depend on group membership alone.  For this to work
dbus-daemon would need to use SO_PEERGROUP, which was introduced
in Linux kernel 4.13.

For now we have to keep both checks (<group> and <check privilege..)

Change-Id: I86b7664f19292be71c5d7c2ca27f837ec7799a96

3 years agoRelease 6.5.6 30/251830/1
Mateusz Moscicki [Tue, 19 Jan 2021 16:29:35 +0000 (17:29 +0100)]
Release 6.5.6

Change-Id: I843c2c7021a04b42799cb5f2b4931fe1a1145fe7

3 years agocrash-service: Simplify the diagnostics get_file access control 23/251823/2
Karol Lewandowski [Tue, 19 Jan 2021 12:17:14 +0000 (13:17 +0100)]
crash-service: Simplify the diagnostics get_file access control

Root is impicitly allowed by <check ..> directive, there is no need
for separate section for this.

Change-Id: I8ff19674fd2610ab1255db14658ae0e1ceeab5e1

3 years agocrash-service: Permit service & app livedump API clients 22/251822/2
Karol Lewandowski [Tue, 19 Jan 2021 12:05:46 +0000 (13:05 +0100)]
crash-service: Permit service & app livedump API clients

The d-bus livedump_pid API can be used by both services and apps.

For service to use the API it should be member of (supplementary)
priv_livecoredumper group.

For application to use the API it should be given the
"http://tizen.org/privilege/internal/livecoredump" privilege.
However, it's internal privilege so it can't be given from the
application manifest. See 'livedumper' section in NOTES file
for hints.

Change-Id: I01586c2c00f7a15d2553e4284ce373a03f9433b1

3 years agoAdd information about the need to manually add a privilege 83/251683/3
Mateusz Moscicki [Mon, 18 Jan 2021 10:26:38 +0000 (11:26 +0100)]
Add information about the need to manually add a privilege

Change-Id: I9832f5fb566e183e414e1fc0f27d3275f2931aa8

3 years agoMerge changes I4fbe1307,I4ed60496 into tizen_6.0 submit/tizen_6.0/20210114.151600
Mateusz Mościcki [Thu, 14 Jan 2021 15:00:17 +0000 (15:00 +0000)]
Merge changes I4fbe1307,I4ed60496 into tizen_6.0

* changes:
  Release 6.0.27
  Fix dbus policy for livedump_pid