Compare commits

...

No commits in common. 'c9' and 'c10-beta' have entirely different histories.
c9 ... c10-beta

4
.gitignore vendored

@ -1,2 +1,2 @@
SOURCES/doc-v2.0.4.tar.xz
SOURCES/v2.0.4.tar.gz
SOURCES/doc-v2.1.tar.xz
SOURCES/v2.1.tar.gz

@ -1,2 +1,2 @@
77fe11a5169b820b549718c4094a7f46498f449a SOURCES/doc-v2.0.4.tar.xz
89b3dd85676090dd4a923425f7668446d729f5f3 SOURCES/v2.0.4.tar.gz
bd8a58203ca345d433598a8c0cd339e1a5011357 SOURCES/doc-v2.1.tar.xz
f8b79bb1b5bcf1d319541b22f6270b4ae38599ea SOURCES/v2.1.tar.gz

@ -1,22 +0,0 @@
diff --git a/libipt/test/src/ptunit-msec_cache.c b/libipt/test/src/ptunit-msec_cache.c
index 68d9daf..cfb059b 100644
--- a/libipt/test/src/ptunit-msec_cache.c
+++ b/libipt/test/src/ptunit-msec_cache.c
@@ -296,7 +296,7 @@ static struct ptunit_result read(struct test_fixture *tfix)
static struct ptunit_result fill_nomap(struct test_fixture *tfix)
{
const struct pt_mapped_section *msec;
- struct pt_asid asid;
+ struct pt_asid asid = { 0 };
struct pt_section *section;
int status;
@@ -320,7 +320,7 @@ static struct ptunit_result fill(struct test_fixture *tfix)
{
const struct pt_mapped_section *msec;
struct pt_section *section;
- struct pt_asid asid;
+ struct pt_asid asid = { 0 };
int status;
status = pt_msec_cache_fill(&tfix->mcache, &msec, &tfix->image, &asid,

@ -0,0 +1,41 @@
From 0144bc2fa99421725585dbc7ecbe2e412f7f8d27 Mon Sep 17 00:00:00 2001
From: Markus Metzger <markus.t.metzger@intel.com>
Date: Thu, 12 Oct 2023 12:57:41 +0000
Subject: [PATCH 1/2] pttc, lto: fix lto strnlen size warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Building with -flto results in
.../pttc/src/util.c:48:15: error: strnlen specified bound 4096 exceeds source size 1024 [-Werror=stringop-overread]
48 | len = strnlen(s, n);
| ^
.../pttc/src/util.c: In function yasm_advance_next_line.part.0:
.../pttc/src/yasm.c:790:14: note: source object declared here
790 | char s[1024];
| ^
Increase the size to fix this.
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
---
pttc/src/yasm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pttc/src/yasm.c b/pttc/src/yasm.c
index 33b8eb9..1004cfa 100644
--- a/pttc/src/yasm.c
+++ b/pttc/src/yasm.c
@@ -787,7 +787,7 @@ int yasm_lookup_label(const struct yasm *y, uint64_t *addr,
static int yasm_advance_next_line(struct yasm *y)
{
- char s[1024];
+ char s[FILENAME_MAX+1];
char filename[FILENAME_MAX+1];
int errcode;
int asm_line, asm_inc;
--
2.41.0

@ -0,0 +1,122 @@
From b79e10fce4dfceddbc9adb706d7a3300df5fabe6 Mon Sep 17 00:00:00 2001
From: Markus Metzger <markus.t.metzger@intel.com>
Date: Mon, 16 Oct 2023 07:25:19 +0000
Subject: [PATCH 2/2] libipt, ptunit: avoid lto maybe-uninitialized warning
Building with GCC 13 and -flto produces
In function 'pt_qry_get_offset',
inlined from 'get_offset_null' at .../libipt/test/src/ptunit-block_decoder.c:164:12,
inlined from 'main' at .../libipt/test/src/ptunit-block_decoder.c:336:2:
.../libipt/src/pt_query_decoder.c:380:16: error: 'decoder' may be used uninitialized [-Werror=maybe-uninitialized]
380 | return pt_evt_get_offset(&decoder->evdec, offset);
| ^
.../libipt/src/pt_event_decoder.c: In function 'main':
.../libipt/src/pt_event_decoder.c:1541:5: note: by argument 1 of type 'const struct pt_event_decoder *' to 'pt_evt_get_offset' declared here
1541 | int pt_evt_get_offset(const struct pt_event_decoder *decoder, uint64_t *offset)
| ^
.../libipt/test/src/ptunit-block_decoder.c:157:33: note: 'decoder' declared here
157 | struct pt_block_decoder decoder;
| ^
Those are false positive since the decoder object isn't actually used. In
&decoder->evdec
we compute the address of the event decoder object within the block
decoder object. This adds an offset defined by the type. It does not
actually dereference the pointer to access an uninitialized decoder
object.
Initialize the test decoder to avoid those warnings. Fixes #101.
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
---
libipt/test/src/ptunit-block_decoder.c | 4 ++++
libipt/test/src/ptunit-encoder.c | 2 ++
libipt/test/src/ptunit-insn_decoder.c | 4 ++++
libipt/test/src/ptunit-packet_decoder.c | 4 ++++
4 files changed, 14 insertions(+)
diff --git a/libipt/test/src/ptunit-block_decoder.c b/libipt/test/src/ptunit-block_decoder.c
index 44249d3..d1ff288 100644
--- a/libipt/test/src/ptunit-block_decoder.c
+++ b/libipt/test/src/ptunit-block_decoder.c
@@ -158,6 +158,8 @@ static struct ptunit_result get_offset_null(void)
uint64_t offset;
int errcode;
+ memset(&decoder, 0, sizeof(decoder));
+
errcode = pt_blk_get_offset(NULL, &offset);
ptu_int_eq(errcode, -pte_invalid);
@@ -184,6 +186,8 @@ static struct ptunit_result get_sync_offset_null(void)
uint64_t offset;
int errcode;
+ memset(&decoder, 0, sizeof(decoder));
+
errcode = pt_blk_get_sync_offset(NULL, &offset);
ptu_int_eq(errcode, -pte_invalid);
diff --git a/libipt/test/src/ptunit-encoder.c b/libipt/test/src/ptunit-encoder.c
index 15d5eb4..edabe9e 100644
--- a/libipt/test/src/ptunit-encoder.c
+++ b/libipt/test/src/ptunit-encoder.c
@@ -138,6 +138,8 @@ static struct ptunit_result get_offset_null(void)
uint64_t offset;
int errcode;
+ memset(&encoder, 0, sizeof(encoder));
+
errcode = pt_enc_get_offset(NULL, &offset);
ptu_int_eq(errcode, -pte_invalid);
diff --git a/libipt/test/src/ptunit-insn_decoder.c b/libipt/test/src/ptunit-insn_decoder.c
index c8447e7..c5a057c 100644
--- a/libipt/test/src/ptunit-insn_decoder.c
+++ b/libipt/test/src/ptunit-insn_decoder.c
@@ -158,6 +158,8 @@ static struct ptunit_result get_offset_null(void)
uint64_t offset;
int errcode;
+ memset(&decoder, 0, sizeof(decoder));
+
errcode = pt_insn_get_offset(NULL, &offset);
ptu_int_eq(errcode, -pte_invalid);
@@ -184,6 +186,8 @@ static struct ptunit_result get_sync_offset_null(void)
uint64_t offset;
int errcode;
+ memset(&decoder, 0, sizeof(decoder));
+
errcode = pt_insn_get_sync_offset(NULL, &offset);
ptu_int_eq(errcode, -pte_invalid);
diff --git a/libipt/test/src/ptunit-packet_decoder.c b/libipt/test/src/ptunit-packet_decoder.c
index 39f1ede..4cb60ad 100644
--- a/libipt/test/src/ptunit-packet_decoder.c
+++ b/libipt/test/src/ptunit-packet_decoder.c
@@ -158,6 +158,8 @@ static struct ptunit_result get_offset_null(void)
uint64_t offset;
int errcode;
+ memset(&decoder, 0, sizeof(decoder));
+
errcode = pt_pkt_get_offset(NULL, &offset);
ptu_int_eq(errcode, -pte_invalid);
@@ -199,6 +201,8 @@ static struct ptunit_result get_sync_offset_null(void)
uint64_t offset;
int errcode;
+ memset(&decoder, 0, sizeof(decoder));
+
errcode = pt_pkt_get_sync_offset(NULL, &offset);
ptu_int_eq(errcode, -pte_invalid);
--
2.41.0

@ -4,13 +4,14 @@
%global __cmake_in_source_build 1
Name: libipt
Version: 2.0.4
Release: 5%{?dist}
Version: 2.1
Release: 4%{?dist}
Summary: Intel Processor Trace Decoder Library
License: BSD
License: BSD-3-Clause
URL: https://github.com/intel/libipt
Source0: https://github.com/intel/libipt/archive/v%{version}.tar.gz
Patch0: libipt-gcc11.patch
Patch0: libipt-pttc-lto-fix-lto-strlen-size-warning.patch
Patch1: libipt-ptunit-avoid-lto-maybe-uninitialized-warning.patch
Source1: doc-v%{version}.tar.xz
# c++ is required only for -DPTUNIT test "ptunit-cpp".
BuildRequires: gcc-c++ cmake
@ -39,7 +40,8 @@ develop programs that use the Intel Processor Trace (Intel PT) Decoder Library.
%prep
%setup -q -n libipt-%{version}
%patch0 -p1
%patch -p1 -P 0
%patch -p1 -P 1
%build
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
@ -81,15 +83,41 @@ ctest -V %{?_smp_mflags}
%{_mandir}/*/*.gz
%changelog
* Thu Aug 12 2021 Keith Seitz <keiths@redhat.com> - 2.0.4-5
- Rebuilt for CI verification of 1943531.
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.1-4
- Bump release for June 2024 mass rebuild
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.0.4-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.0.4-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Oct 18 2023 Keith Seitz <keiths@redhat.com> - 2.1-1
- Update to v2.1.
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jul 06 2023 Keith Seitz <keiths@redhat.com> - 2.0.6-1
- Import v2.0.6 and regenerate documentation.
* Tue Mar 07 2023 Keith Seitz <keiths@redhat.com>
- migrated to SPDX license
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 27 2022 Keith Seitz <keiths@redhat.com> - 2.0.5-1
- Import v2.0.5 and regenerate documentation.
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Mar 30 2021 Keith Seitz <keiths@redhat.com> - 2.0.4-2
- Add support for pre-generated documenation, allowing removal

Loading…
Cancel
Save