diff --git a/pkg/sentry/arch/arch_aarch64.go b/pkg/sentry/arch/arch_aarch64.go index 0d61a21e7..04262f6c5 100644 --- a/pkg/sentry/arch/arch_aarch64.go +++ b/pkg/sentry/arch/arch_aarch64.go @@ -39,7 +39,7 @@ type Registers struct { } const ( - // SyscallWidth is the width of insturctions. + // SyscallWidth is the width of instructions. SyscallWidth = 4 ) diff --git a/pkg/sentry/arch/arch_x86.go b/pkg/sentry/arch/arch_x86.go index a251f0668..7c5ba9197 100644 --- a/pkg/sentry/arch/arch_x86.go +++ b/pkg/sentry/arch/arch_x86.go @@ -38,7 +38,7 @@ type Registers struct { // System-related constants for x86. const ( - // SyscallWidth is the width of syscall, sysenter, and int 80 insturctions. + // SyscallWidth is the width of syscall, sysenter, and int 80 instructions. SyscallWidth = 2 ) diff --git a/pkg/sentry/devices/tpuproxy/device.go b/pkg/sentry/devices/tpuproxy/device.go index 54cea798e..e6bdf9e8c 100644 --- a/pkg/sentry/devices/tpuproxy/device.go +++ b/pkg/sentry/devices/tpuproxy/device.go @@ -32,7 +32,7 @@ import ( const ( // VFIO_MINOR is the VFIO minor number from include/linux/miscdevice.h. VFIO_MINOR = 196 - // VFIOPath is the path to a VFIO device, it is ususally used to + // VFIOPath is the path to a VFIO device, it is usually used to // construct a VFIO container. VFIOPath = "/dev/vfio/vfio" @@ -49,7 +49,7 @@ type tpuDevice struct { minor uint32 } -// Open implememnts vfs.Device.Open. +// Open implements vfs.Device.Open. func (dev *tpuDevice) Open(ctx context.Context, mnt *vfs.Mount, d *vfs.Dentry, opts vfs.OpenOptions) (*vfs.FileDescription, error) { devClient := devutil.GoferClientFromContext(ctx) if devClient == nil { @@ -133,7 +133,7 @@ func RegisterTPUDevice(vfsObj *vfs.VirtualFilesystem, minor uint32) error { }) } -// RegisterVfioDevice registers VFIO devices that are implemented by this pacakge in vfsObj. +// RegisterVfioDevice registers VFIO devices that are implemented by this package in vfsObj. func RegisterVfioDevice(vfsObj *vfs.VirtualFilesystem) error { return vfsObj.RegisterDevice(vfs.CharDevice, linux.MISC_MAJOR, VFIO_MINOR, &vfioDevice{}, &vfs.RegisterDeviceOptions{ GroupName: vfioDeviceGroupName, diff --git a/pkg/sentry/hostcpu/getcpu_arm64.s b/pkg/sentry/hostcpu/getcpu_arm64.s index bdbcc5d8d..6ef54f219 100644 --- a/pkg/sentry/hostcpu/getcpu_arm64.s +++ b/pkg/sentry/hostcpu/getcpu_arm64.s @@ -15,7 +15,7 @@ #include "textflag.h" // GetCPU makes the getcpu(unsigned *cpu, unsigned *node, NULL) syscall for -// the lack of an optimazed way of getting the current CPU number on arm64. +// the lack of an optimized way of getting the current CPU number on arm64. // func GetCPU() uint32 TEXT ·GetCPU(SB), NOSPLIT, $0-4 diff --git a/pkg/sentry/kernel/ipc/ns.go b/pkg/sentry/kernel/ipc/ns.go index ee8b8581b..481c795a4 100644 --- a/pkg/sentry/kernel/ipc/ns.go +++ b/pkg/sentry/kernel/ipc/ns.go @@ -18,5 +18,5 @@ type contextID int // CtxIPCNamespace is the context.Value key used to retrieve an IPC namespace. // We define it here because it's needed in several packages, and is not -// possible to use otherwise without causing a circular depenedency. +// possible to use otherwise without causing a circular dependency. const CtxIPCNamespace contextID = iota diff --git a/pkg/sentry/platform/kvm/bluepill_arm64_unsafe.go b/pkg/sentry/platform/kvm/bluepill_arm64_unsafe.go index d7b5f53c2..5164419d3 100644 --- a/pkg/sentry/platform/kvm/bluepill_arm64_unsafe.go +++ b/pkg/sentry/platform/kvm/bluepill_arm64_unsafe.go @@ -32,7 +32,7 @@ func fpsimdPtr(addr *byte) *arch.FpsimdContext { return (*arch.FpsimdContext)(unsafe.Pointer(addr)) } -// dieArchSetup initialies the state for dieTrampoline. +// dieArchSetup initializes the state for dieTrampoline. // // The arm64 dieTrampoline requires the vCPU to be set in R1, and the last PC // to be in R0. The trampoline then simulates a call to dieHandler from the diff --git a/pkg/sentry/socket/netlink/route/protocol.go b/pkg/sentry/socket/netlink/route/protocol.go index bfaa00765..584b941dc 100644 --- a/pkg/sentry/socket/netlink/route/protocol.go +++ b/pkg/sentry/socket/netlink/route/protocol.go @@ -287,7 +287,7 @@ func (p *Protocol) dumpAddrs(ctx context.Context, msg *nlmsg.Message, ms *nlmsg. } // commonPrefixLen reports the length of the longest IP address prefix. -// This is a simplied version from Golang's src/net/addrselect.go. +// This is a simplified version from Golang's src/net/addrselect.go. func commonPrefixLen(a, b []byte) (cpl int) { for len(a) > 0 { if a[0] == b[0] { diff --git a/pkg/sentry/time/calibrated_clock_test.go b/pkg/sentry/time/calibrated_clock_test.go index 0a4b1f1bf..f0847191c 100644 --- a/pkg/sentry/time/calibrated_clock_test.go +++ b/pkg/sentry/time/calibrated_clock_test.go @@ -160,7 +160,7 @@ func TestErrorCorrection(t *testing.T) { t.Errorf("Discontinuous time; ComputeTime(%v) got %v want %v", tc.samples[2].after, newProjected, projected) } - // As the reference clock stablizes, ensure that the clock error + // As the reference clock stabilizes, ensure that the clock error // decreases. initialErr := c.errorNS t.Logf("initial error: %v ns", initialErr) diff --git a/pkg/tcpip/header/ipv4.go b/pkg/tcpip/header/ipv4.go index 6e566205d..84a5b1d77 100644 --- a/pkg/tcpip/header/ipv4.go +++ b/pkg/tcpip/header/ipv4.go @@ -571,7 +571,7 @@ func IsV4LoopbackAddress(addr tcpip.Address) bool { // ========================= Options ========================== -// An IPv4OptionType can hold the valuse for the Type in an IPv4 option. +// An IPv4OptionType can hold the value for the Type in an IPv4 option. type IPv4OptionType byte // These constants are needed to identify individual options in the option list. diff --git a/pkg/tcpip/link/sharedmem/queue/queue_test.go b/pkg/tcpip/link/sharedmem/queue/queue_test.go index 64f218d00..2ee2175c0 100644 --- a/pkg/tcpip/link/sharedmem/queue/queue_test.go +++ b/pkg/tcpip/link/sharedmem/queue/queue_test.go @@ -492,7 +492,7 @@ func TestLotsOfReceptions(t *testing.T) { } func TestRxEnableNotification(t *testing.T) { - // Check that enabling nofifications results in properly updated state. + // Check that enabling notifications results in properly updated state. pb1 := make([]byte, 100) pb2 := make([]byte, 100) @@ -507,7 +507,7 @@ func TestRxEnableNotification(t *testing.T) { } func TestRxDisableNotification(t *testing.T) { - // Check that disabling nofifications results in properly updated state. + // Check that disabling notifications results in properly updated state. pb1 := make([]byte, 100) pb2 := make([]byte, 100) diff --git a/pkg/tcpip/network/ipv6/ipv6_test.go b/pkg/tcpip/network/ipv6/ipv6_test.go index cc24da19e..fd4c31aba 100644 --- a/pkg/tcpip/network/ipv6/ipv6_test.go +++ b/pkg/tcpip/network/ipv6/ipv6_test.go @@ -729,7 +729,7 @@ func TestReceiveIPv6ExtHdrs(t *testing.T) { pointer: header.IPv6FixedHeaderSize + 8, }, { - name: "destination with unknown option discard and send icmp action (muilticast)", + name: "destination with unknown option discard and send icmp action (multicast)", extHdr: func(nextHdr uint8) ([]byte, uint8) { return []byte{ nextHdr, 1, diff --git a/pkg/tcpip/stack/ndp_test.go b/pkg/tcpip/stack/ndp_test.go index c5b1ab046..1e78f1630 100644 --- a/pkg/tcpip/stack/ndp_test.go +++ b/pkg/tcpip/stack/ndp_test.go @@ -3532,7 +3532,7 @@ func TestAutoGenAddrDeprecateFromPI(t *testing.T) { } expectPrimaryAddr(addr1) - // Deprecate addr for prefix1 immedaitely. + // Deprecate addr for prefix1 immediately. e.InjectInbound(header.IPv6ProtocolNumber, raBufWithPI(llAddr2, 0, prefix1, true, true, 100, 0)) expectAutoGenAddrEvent(t, ndpDisp, addr1, deprecatedAddr) if !containsV6Addr(s.NICInfo()[nicID].ProtocolAddresses, addr1) { @@ -3560,7 +3560,7 @@ func TestAutoGenAddrDeprecateFromPI(t *testing.T) { } expectPrimaryAddr(addr2) - // Deprecate addr for prefix2 immedaitely. + // Deprecate addr for prefix2 immediately. e.InjectInbound(header.IPv6ProtocolNumber, raBufWithPI(llAddr2, 0, prefix2, true, true, 100, 0)) expectAutoGenAddrEvent(t, ndpDisp, addr2, deprecatedAddr) if !containsV6Addr(s.NICInfo()[nicID].ProtocolAddresses, addr2) { @@ -5969,7 +5969,7 @@ func TestStopStartSolicitingRouters(t *testing.T) { }, // Tests that when a NIC is removed, router solicitations are stopped. We - // cannot start router solications on a removed NIC. + // cannot start router solicitations on a removed NIC. { name: "Remove NIC", stopFn: func(t *testing.T, s *stack.Stack, first bool) { @@ -6046,7 +6046,7 @@ func TestStopStartSolicitingRouters(t *testing.T) { t.Fatal("unexpectedly got a packet after router solicitation has been stopepd") } - // If test.startFn is nil, there is no way to restart router solications. + // If test.startFn is nil, there is no way to restart router solicitations. if test.startFn == nil { return } diff --git a/pkg/tcpip/transport/tcp/test/e2e/tcp_test.go b/pkg/tcpip/transport/tcp/test/e2e/tcp_test.go index 8140106f0..48d6ca564 100644 --- a/pkg/tcpip/transport/tcp/test/e2e/tcp_test.go +++ b/pkg/tcpip/transport/tcp/test/e2e/tcp_test.go @@ -7229,7 +7229,7 @@ func TestReceiveBufferAutoTuningApplicationLimited(t *testing.T) { } // Verify that we receive a non-zero window update ACK. When running - // under thread santizer this test can end up sending more than 1 + // under thread sanitizer this test can end up sending more than 1 // ack, 1 for the non-zero window p := c.GetPacket() defer p.Release() diff --git a/pkg/xdp/umem.go b/pkg/xdp/umem.go index 912c4346e..6086a002b 100644 --- a/pkg/xdp/umem.go +++ b/pkg/xdp/umem.go @@ -39,7 +39,7 @@ type UMEM struct { // sockfd is the underlying AF_XDP socket. sockfd uint32 - // frameMask masks the lower bits of an adderess to get the frame's + // frameMask masks the lower bits of an address to get the frame's // address. frameMask uint64 diff --git a/pkg/xdp/xdp.go b/pkg/xdp/xdp.go index 5863d4221..e7bf115a5 100644 --- a/pkg/xdp/xdp.go +++ b/pkg/xdp/xdp.go @@ -26,7 +26,7 @@ // with an incoming packet. The packet is filled by the kernel, which // places a descriptor to the same UMEM area in the RX queue, signifying // that userspace may read the packet. -// - Trasmit: Userspace adds a descriptor to TX queue. The kernel +// - Transmit: Userspace adds a descriptor to TX queue. The kernel // sends the packet (stored in UMEM) pointed to by the descriptor. // Upon completion, the kernel places a descriptor in the completion // queue to notify userspace that the packet is sent and the UMEM