Skip to content

Commit

Permalink
debug: add top level security docs for dwarf, elf, macho, pe, and pla…
Browse files Browse the repository at this point in the history
…n9obj

Adds a package level doc comment to the debug/dwarf, debug/elf,
debug/macho, debug/pe, and debug/plan9obj noting that these packages
are not designed to be hardened against adversarial inputs.

Change-Id: I678d01bcdc8ad01c23805f09cc59e64cec6c3f76
Reviewed-on: https://go-review.googlesource.com/c/go/+/435417
Reviewed-by: Damien Neil <[email protected]>
Reviewed-by: Julie Qiu <[email protected]>
Run-TryBot: Roland Shoemaker <[email protected]>
Auto-Submit: Roland Shoemaker <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
rolandshoemaker authored and pull[bot] committed Mar 16, 2023
1 parent a1d4229 commit 3218552
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 7 deletions.
16 changes: 13 additions & 3 deletions src/debug/dwarf/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package dwarf provides access to DWARF debugging information loaded from
// executable files, as defined in the DWARF 2.0 Standard at
// http://dwarfstd.org/doc/dwarf-2.0.0.pdf
/*
Package dwarf provides access to DWARF debugging information loaded from
executable files, as defined in the DWARF 2.0 Standard at
http://dwarfstd.org/doc/dwarf-2.0.0.pdf.
# Security
This package is not designed to be hardened against adversarial inputs, and is
outside the scope of https://go.dev/security/policy. In particular, only basic
validation is done when parsing object files. As such, care should be taken when
parsing untrusted inputs, as parsing malformed files may consume significant
resources, or cause panics.
*/
package dwarf

import (
Expand Down
12 changes: 11 additions & 1 deletion src/debug/elf/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package elf implements access to ELF object files.
/*
Package elf implements access to ELF object files.
# Security
This package is not designed to be hardened against adversarial inputs, and is
outside the scope of https://go.dev/security/policy. In particular, only basic
validation is done when parsing object files. As such, care should be taken when
parsing untrusted inputs, as parsing malformed files may consume significant
resources, or cause panics.
*/
package elf

import (
Expand Down
12 changes: 11 additions & 1 deletion src/debug/macho/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package macho implements access to Mach-O object files.
/*
Package macho implements access to Mach-O object files.
# Security
This package is not designed to be hardened against adversarial inputs, and is
outside the scope of https://go.dev/security/policy. In particular, only basic
validation is done when parsing object files. As such, care should be taken when
parsing untrusted inputs, as parsing malformed files may consume significant
resources, or cause panics.
*/
package macho

// High level access to low level data structures.
Expand Down
12 changes: 11 additions & 1 deletion src/debug/pe/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package pe implements access to PE (Microsoft Windows Portable Executable) files.
/*
Package pe implements access to PE (Microsoft Windows Portable Executable) files.
# Security
This package is not designed to be hardened against adversarial inputs, and is
outside the scope of https://go.dev/security/policy. In particular, only basic
validation is done when parsing object files. As such, care should be taken when
parsing untrusted inputs, as parsing malformed files may consume significant
resources, or cause panics.
*/
package pe

import (
Expand Down
12 changes: 11 additions & 1 deletion src/debug/plan9obj/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package plan9obj implements access to Plan 9 a.out object files.
/*
Package plan9obj implements access to Plan 9 a.out object files.
# Security
This package is not designed to be hardened against adversarial inputs, and is
outside the scope of https://go.dev/security/policy. In particular, only basic
validation is done when parsing object files. As such, care should be taken when
parsing untrusted inputs, as parsing malformed files may consume significant
resources, or cause panics.
*/
package plan9obj

import (
Expand Down

0 comments on commit 3218552

Please sign in to comment.