OpenBSD CVS

CVS log for src/usr.bin/ctfdump/ctfdump.c


[BACK] Up to [local] / src / usr.bin / ctfdump

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.28 / (download) - annotate - [select for diffs], Thu Feb 22 13:21:03 2024 UTC (2 months, 3 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.27: +7 -6 lines
Diff to previous 1.27 (colored)

Print the size of more objects (basic types and enums) based on their
ctt_size info. This helps to ensure that the reported sizes match.
OK mpi@

Revision 1.27 / (download) - annotate - [select for diffs], Sun Aug 14 15:01:18 2022 UTC (21 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.26: +14 -14 lines
Diff to previous 1.26 (colored)

Use size_t for the length parameters, not off_t.
Now that zlib uses unsigned long for its totals there is no reason
to use off_t in ctfdump.  This is similar to the changes in db_ctf.c.
OK tb@

Revision 1.26 / (download) - annotate - [select for diffs], Wed Aug 10 07:58:04 2022 UTC (21 months, 1 week ago) by tb
Branch: MAIN
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

Fix two compiler warnings resulting from last zlib bump

total_out is now an unsigned long, so a format string warning is issued
on all architectures. Fix this and also fix the format string for the
off_t len, which is signed, not unsigned.

Comparing an unsigned long to an off_t involves implementation-defined
behavior for values > LONG_MAX on 64-bit architectures, so the compiler
complains. Fix this by checking that len >= 0 and then casting both sides
to a wider type.

reported by and ok deraadt

Revision 1.25 / (download) - annotate - [select for diffs], Thu Feb 10 23:40:09 2022 UTC (2 years, 3 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.24: +46 -44 lines
Diff to previous 1.24 (colored)

Casting a char pointer to struct ctf_header causes bus error on
sparc64.  Use memcpy() to align the data.
found by regress/usr.bin/ctfdump; OK mpi@

Revision 1.24 / (download) - annotate - [select for diffs], Tue Sep 3 10:32:15 2019 UTC (4 years, 8 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.23: +7 -7 lines
Diff to previous 1.23 (colored)

Use 0 as exit value if no error has been found in the CTF section.

ok sunil@

Revision 1.23 / (download) - annotate - [select for diffs], Tue May 14 03:16:55 2019 UTC (5 years ago) by sunil
Branch: MAIN
Changes since 1.22: +103 -69 lines
Diff to previous 1.22 (colored)

Use elf(3) api instead of an ad-hoc elf parser.

Ok mpi@

Revision 1.22 / (download) - annotate - [select for diffs], Sat Mar 16 16:35:03 2019 UTC (5 years, 2 months ago) by sunil
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.21: +4 -1 lines
Diff to previous 1.21 (colored)

Fix a buffer over-read while dumping functions.

A bogus vlen in metadata could cause offset point beyond CTF section
boundary. Found by afl-fuzz.

Ok mpi@

Revision 1.21 / (download) - annotate - [select for diffs], Sat Mar 16 15:34:58 2019 UTC (5 years, 2 months ago) by sunil
Branch: MAIN
Changes since 1.20: +7 -1 lines
Diff to previous 1.20 (colored)

Fix a buffer over-read while dumping structs/unions.

A bogus vlen in metadata could cause offset point beyond CTF section
boundary. Found by afl-fuzz.

Ok mpi@

Revision 1.20 / (download) - annotate - [select for diffs], Sat Mar 16 07:36:56 2019 UTC (5 years, 2 months ago) by sunil
Branch: MAIN
Changes since 1.19: +4 -1 lines
Diff to previous 1.19 (colored)

Fix a buffer over-read while dumping enums.

A bogus vlen in metadata could cause offset point beyond CTF section
boundary.  Found by afl-fuzz.

Feedback and Ok mpi@

Revision 1.19 / (download) - annotate - [select for diffs], Mon Nov 6 14:59:27 2017 UTC (6 years, 6 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.18: +6 -9 lines
Diff to previous 1.18 (colored)

Use the symtab's sh_link to get the string table section.

This is technically more correct than looking for ".strtab" and allows
us to get rid of unportable ELF_STRTAB.

We can also get rid of the hack for some incorrect ELF files since we
no longer try to apply relocations for the string table.

From Mark Johnston, markj@FreeBSD

Revision 1.18 / (download) - annotate - [select for diffs], Fri Nov 3 12:53:38 2017 UTC (6 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

Fix formatting in the case where a symbol table isn't present.

From Mark Johnston, markj@FreeBSD

Revision 1.17 / (download) - annotate - [select for diffs], Sat Oct 28 09:30:27 2017 UTC (6 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.16: +4 -1 lines
Diff to previous 1.16 (colored)

Correctly handle binaries without string table.

Found by jsg@ with afl(1).

Revision 1.16 / (download) - annotate - [select for diffs], Sat Oct 28 09:26:16 2017 UTC (6 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.15: +4 -3 lines
Diff to previous 1.15 (colored)

Correct an integer overflow check to detect invalid CTF section.

Found by jsg@ with afl(1).

Revision 1.15 / (download) - annotate - [select for diffs], Sat Oct 28 08:22:28 2017 UTC (6 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.14: +8 -8 lines
Diff to previous 1.14 (colored)

Print values as unsigned when dumping header.

Revision 1.14 / (download) - annotate - [select for diffs], Fri Oct 27 09:35:22 2017 UTC (6 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.13: +20 -10 lines
Diff to previous 1.13 (colored)

Prevent out-of-bound with malformed type entry.

Issue found by jsg@ with afl(1).

Revision 1.13 / (download) - annotate - [select for diffs], Fri Oct 27 09:22:20 2017 UTC (6 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.12: +8 -4 lines
Diff to previous 1.12 (colored)

Prevent out-of-bound leading to an invalid pointer dereference when
dumping functions.

Sync the logic with the kernel iterator for that.

Issue found by jsg@ with afl(1).

Revision 1.12 / (download) - annotate - [select for diffs], Fri Oct 27 08:33:46 2017 UTC (6 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

Use <elf.h> rather than <sys/exec_elf.h>.

The former is more portable.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Oct 16 12:58:57 2017 UTC (6 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Typo in header dump, from sbz@FreeBSD

Revision 1.10 / (download) - annotate - [select for diffs], Thu Oct 5 03:06:14 2017 UTC (6 years, 7 months ago) by jsg
Branch: MAIN
Changes since 1.9: +7 -1 lines
Diff to previous 1.9 (colored)

add boundary tests to avoid some crashes found with afl
ok mpi@

Revision 1.9 / (download) - annotate - [select for diffs], Thu Oct 5 02:59:39 2017 UTC (6 years, 7 months ago) by jsg
Branch: MAIN
Changes since 1.8: +6 -6 lines
Diff to previous 1.8 (colored)

sync elf.c with ctfconv
ok mpi@ jasper@

Revision 1.8 / (download) - annotate - [select for diffs], Sat Sep 23 12:25:39 2017 UTC (6 years, 7 months ago) by uwe
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Fix off by one in ctf_enc2name (who uses SIGNED BOOL anyway?)

ok mpi

Revision 1.7 / (download) - annotate - [select for diffs], Sat Sep 23 12:24:31 2017 UTC (6 years, 7 months ago) by uwe
Branch: MAIN
Changes since 1.6: +19 -3 lines
Diff to previous 1.6 (colored)

Show floating-point encoding by name in ctfdump(1)

ok mpi

Revision 1.6 / (download) - annotate - [select for diffs], Tue Sep 19 08:28:57 2017 UTC (6 years, 8 months ago) by jsg
Branch: MAIN
Changes since 1.5: +3 -1 lines
Diff to previous 1.5 (colored)

fix fd leaks in error paths
ok mpi@

Revision 1.5 / (download) - annotate - [select for diffs], Tue Aug 29 21:10:20 2017 UTC (6 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.4: +1 -2 lines
Diff to previous 1.4 (colored)

quarterly rescan of the tree:  remove unneccessary sys/param.h, and
annotate the ones which are needed.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Aug 11 20:42:59 2017 UTC (6 years, 9 months ago) by jasper
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

move pledge after setlocale as suggested by tb@

Revision 1.3 / (download) - annotate - [select for diffs], Fri Aug 11 18:22:22 2017 UTC (6 years, 9 months ago) by jasper
Branch: MAIN
Changes since 1.2: +4 -1 lines
Diff to previous 1.2 (colored)

pledge ctfdump to stdio and rpath

ok mpi@

Revision 1.2 / (download) - annotate - [select for diffs], Fri Aug 11 15:00:00 2017 UTC (6 years, 9 months ago) by jasper
Branch: MAIN
Changes since 1.1: +2 -0 lines
Diff to previous 1.1 (colored)

add rcs ids

Revision 1.1 / (download) - annotate - [select for diffs], Fri Aug 11 14:17:05 2017 UTC (6 years, 9 months ago) by mpi
Branch: MAIN

Import a tool for dumping the contents of CTF data section (SUNW_ctf).

ok deraadt@, kettenis@, jasper@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.