Update vendored runc to v1.0.0.0-rc94
Note that this is the code in containerd that uses runc (as almost a library). Please see the other commit for the update to runc binary itself. Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
		
							
								
								
									
										131
									
								
								vendor/github.com/cilium/ebpf/elf_reader.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										131
									
								
								vendor/github.com/cilium/ebpf/elf_reader.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -272,11 +272,12 @@ func (ec *elfCode) loadPrograms() (map[string]*ProgramSpec, error) { | ||||
| 			return nil, fmt.Errorf("program %s: %w", funcSym.Name, err) | ||||
| 		} | ||||
|  | ||||
| 		progType, attachType, attachTo := getProgType(sec.Name) | ||||
| 		progType, attachType, progFlags, attachTo := getProgType(sec.Name) | ||||
|  | ||||
| 		spec := &ProgramSpec{ | ||||
| 			Name:          funcSym.Name, | ||||
| 			Type:          progType, | ||||
| 			Flags:         progFlags, | ||||
| 			AttachType:    attachType, | ||||
| 			AttachTo:      attachTo, | ||||
| 			License:       ec.license, | ||||
| @@ -533,28 +534,25 @@ func (ec *elfCode) loadBTFMaps(maps map[string]*MapSpec) error { | ||||
| 			return fmt.Errorf("missing BTF") | ||||
| 		} | ||||
|  | ||||
| 		if len(sec.symbols) == 0 { | ||||
| 			return fmt.Errorf("section %v: no symbols", sec.Name) | ||||
| 		} | ||||
|  | ||||
| 		_, err := io.Copy(internal.DiscardZeroes{}, bufio.NewReader(sec.Open())) | ||||
| 		if err != nil { | ||||
| 			return fmt.Errorf("section %v: initializing BTF map definitions: %w", sec.Name, internal.ErrNotSupported) | ||||
| 		} | ||||
|  | ||||
| 		for _, sym := range sec.symbols { | ||||
| 			name := sym.Name | ||||
| 			if maps[name] != nil { | ||||
| 				return fmt.Errorf("section %v: map %v already exists", sec.Name, sym) | ||||
| 			} | ||||
| 		var ds btf.Datasec | ||||
| 		if err := ec.btf.FindType(sec.Name, &ds); err != nil { | ||||
| 			return fmt.Errorf("cannot find section '%s' in BTF: %w", sec.Name, err) | ||||
| 		} | ||||
|  | ||||
| 			// A global Var is created by declaring a struct with a 'structure variable', | ||||
| 			// as is common in eBPF C to declare eBPF maps. For example, | ||||
| 			// `struct { ... } map_name ...;` emits a global variable `map_name` | ||||
| 			// with the type of said struct (which can be anonymous). | ||||
| 			var v btf.Var | ||||
| 			if err := ec.btf.FindType(name, &v); err != nil { | ||||
| 				return fmt.Errorf("cannot find global variable '%s' in BTF: %w", name, err) | ||||
| 		for _, vs := range ds.Vars { | ||||
| 			v, ok := vs.Type.(*btf.Var) | ||||
| 			if !ok { | ||||
| 				return fmt.Errorf("section %v: unexpected type %s", sec.Name, vs.Type) | ||||
| 			} | ||||
| 			name := string(v.Name) | ||||
|  | ||||
| 			if maps[name] != nil { | ||||
| 				return fmt.Errorf("section %v: map %s already exists", sec.Name, name) | ||||
| 			} | ||||
|  | ||||
| 			mapStruct, ok := v.Type.(*btf.Struct) | ||||
| @@ -834,56 +832,61 @@ func (ec *elfCode) loadDataSections(maps map[string]*MapSpec) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func getProgType(sectionName string) (ProgramType, AttachType, string) { | ||||
| func getProgType(sectionName string) (ProgramType, AttachType, uint32, string) { | ||||
| 	types := map[string]struct { | ||||
| 		progType   ProgramType | ||||
| 		attachType AttachType | ||||
| 		progFlags  uint32 | ||||
| 	}{ | ||||
| 		// From https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/lib/bpf/libbpf.c | ||||
| 		"socket":                {SocketFilter, AttachNone}, | ||||
| 		"seccomp":               {SocketFilter, AttachNone}, | ||||
| 		"kprobe/":               {Kprobe, AttachNone}, | ||||
| 		"uprobe/":               {Kprobe, AttachNone}, | ||||
| 		"kretprobe/":            {Kprobe, AttachNone}, | ||||
| 		"uretprobe/":            {Kprobe, AttachNone}, | ||||
| 		"tracepoint/":           {TracePoint, AttachNone}, | ||||
| 		"raw_tracepoint/":       {RawTracepoint, AttachNone}, | ||||
| 		"xdp":                   {XDP, AttachNone}, | ||||
| 		"perf_event":            {PerfEvent, AttachNone}, | ||||
| 		"lwt_in":                {LWTIn, AttachNone}, | ||||
| 		"lwt_out":               {LWTOut, AttachNone}, | ||||
| 		"lwt_xmit":              {LWTXmit, AttachNone}, | ||||
| 		"lwt_seg6local":         {LWTSeg6Local, AttachNone}, | ||||
| 		"sockops":               {SockOps, AttachCGroupSockOps}, | ||||
| 		"sk_skb/stream_parser":  {SkSKB, AttachSkSKBStreamParser}, | ||||
| 		"sk_skb/stream_verdict": {SkSKB, AttachSkSKBStreamParser}, | ||||
| 		"sk_msg":                {SkMsg, AttachSkSKBStreamVerdict}, | ||||
| 		"lirc_mode2":            {LircMode2, AttachLircMode2}, | ||||
| 		"flow_dissector":        {FlowDissector, AttachFlowDissector}, | ||||
| 		"iter/":                 {Tracing, AttachTraceIter}, | ||||
| 		"sk_lookup/":            {SkLookup, AttachSkLookup}, | ||||
| 		"lsm/":                  {LSM, AttachLSMMac}, | ||||
| 		"socket":                {SocketFilter, AttachNone, 0}, | ||||
| 		"seccomp":               {SocketFilter, AttachNone, 0}, | ||||
| 		"kprobe/":               {Kprobe, AttachNone, 0}, | ||||
| 		"uprobe/":               {Kprobe, AttachNone, 0}, | ||||
| 		"kretprobe/":            {Kprobe, AttachNone, 0}, | ||||
| 		"uretprobe/":            {Kprobe, AttachNone, 0}, | ||||
| 		"tracepoint/":           {TracePoint, AttachNone, 0}, | ||||
| 		"raw_tracepoint/":       {RawTracepoint, AttachNone, 0}, | ||||
| 		"xdp":                   {XDP, AttachNone, 0}, | ||||
| 		"perf_event":            {PerfEvent, AttachNone, 0}, | ||||
| 		"lwt_in":                {LWTIn, AttachNone, 0}, | ||||
| 		"lwt_out":               {LWTOut, AttachNone, 0}, | ||||
| 		"lwt_xmit":              {LWTXmit, AttachNone, 0}, | ||||
| 		"lwt_seg6local":         {LWTSeg6Local, AttachNone, 0}, | ||||
| 		"sockops":               {SockOps, AttachCGroupSockOps, 0}, | ||||
| 		"sk_skb/stream_parser":  {SkSKB, AttachSkSKBStreamParser, 0}, | ||||
| 		"sk_skb/stream_verdict": {SkSKB, AttachSkSKBStreamParser, 0}, | ||||
| 		"sk_msg":                {SkMsg, AttachSkSKBStreamVerdict, 0}, | ||||
| 		"lirc_mode2":            {LircMode2, AttachLircMode2, 0}, | ||||
| 		"flow_dissector":        {FlowDissector, AttachFlowDissector, 0}, | ||||
| 		"iter/":                 {Tracing, AttachTraceIter, 0}, | ||||
| 		"fentry.s/":             {Tracing, AttachTraceFEntry, unix.BPF_F_SLEEPABLE}, | ||||
| 		"fmod_ret.s/":           {Tracing, AttachModifyReturn, unix.BPF_F_SLEEPABLE}, | ||||
| 		"fexit.s/":              {Tracing, AttachTraceFExit, unix.BPF_F_SLEEPABLE}, | ||||
| 		"sk_lookup/":            {SkLookup, AttachSkLookup, 0}, | ||||
| 		"lsm/":                  {LSM, AttachLSMMac, 0}, | ||||
| 		"lsm.s/":                {LSM, AttachLSMMac, unix.BPF_F_SLEEPABLE}, | ||||
|  | ||||
| 		"cgroup_skb/ingress": {CGroupSKB, AttachCGroupInetIngress}, | ||||
| 		"cgroup_skb/egress":  {CGroupSKB, AttachCGroupInetEgress}, | ||||
| 		"cgroup/dev":         {CGroupDevice, AttachCGroupDevice}, | ||||
| 		"cgroup/skb":         {CGroupSKB, AttachNone}, | ||||
| 		"cgroup/sock":        {CGroupSock, AttachCGroupInetSockCreate}, | ||||
| 		"cgroup/post_bind4":  {CGroupSock, AttachCGroupInet4PostBind}, | ||||
| 		"cgroup/post_bind6":  {CGroupSock, AttachCGroupInet6PostBind}, | ||||
| 		"cgroup/bind4":       {CGroupSockAddr, AttachCGroupInet4Bind}, | ||||
| 		"cgroup/bind6":       {CGroupSockAddr, AttachCGroupInet6Bind}, | ||||
| 		"cgroup/connect4":    {CGroupSockAddr, AttachCGroupInet4Connect}, | ||||
| 		"cgroup/connect6":    {CGroupSockAddr, AttachCGroupInet6Connect}, | ||||
| 		"cgroup/sendmsg4":    {CGroupSockAddr, AttachCGroupUDP4Sendmsg}, | ||||
| 		"cgroup/sendmsg6":    {CGroupSockAddr, AttachCGroupUDP6Sendmsg}, | ||||
| 		"cgroup/recvmsg4":    {CGroupSockAddr, AttachCGroupUDP4Recvmsg}, | ||||
| 		"cgroup/recvmsg6":    {CGroupSockAddr, AttachCGroupUDP6Recvmsg}, | ||||
| 		"cgroup/sysctl":      {CGroupSysctl, AttachCGroupSysctl}, | ||||
| 		"cgroup/getsockopt":  {CGroupSockopt, AttachCGroupGetsockopt}, | ||||
| 		"cgroup/setsockopt":  {CGroupSockopt, AttachCGroupSetsockopt}, | ||||
| 		"classifier":         {SchedCLS, AttachNone}, | ||||
| 		"action":             {SchedACT, AttachNone}, | ||||
| 		"cgroup_skb/ingress": {CGroupSKB, AttachCGroupInetIngress, 0}, | ||||
| 		"cgroup_skb/egress":  {CGroupSKB, AttachCGroupInetEgress, 0}, | ||||
| 		"cgroup/dev":         {CGroupDevice, AttachCGroupDevice, 0}, | ||||
| 		"cgroup/skb":         {CGroupSKB, AttachNone, 0}, | ||||
| 		"cgroup/sock":        {CGroupSock, AttachCGroupInetSockCreate, 0}, | ||||
| 		"cgroup/post_bind4":  {CGroupSock, AttachCGroupInet4PostBind, 0}, | ||||
| 		"cgroup/post_bind6":  {CGroupSock, AttachCGroupInet6PostBind, 0}, | ||||
| 		"cgroup/bind4":       {CGroupSockAddr, AttachCGroupInet4Bind, 0}, | ||||
| 		"cgroup/bind6":       {CGroupSockAddr, AttachCGroupInet6Bind, 0}, | ||||
| 		"cgroup/connect4":    {CGroupSockAddr, AttachCGroupInet4Connect, 0}, | ||||
| 		"cgroup/connect6":    {CGroupSockAddr, AttachCGroupInet6Connect, 0}, | ||||
| 		"cgroup/sendmsg4":    {CGroupSockAddr, AttachCGroupUDP4Sendmsg, 0}, | ||||
| 		"cgroup/sendmsg6":    {CGroupSockAddr, AttachCGroupUDP6Sendmsg, 0}, | ||||
| 		"cgroup/recvmsg4":    {CGroupSockAddr, AttachCGroupUDP4Recvmsg, 0}, | ||||
| 		"cgroup/recvmsg6":    {CGroupSockAddr, AttachCGroupUDP6Recvmsg, 0}, | ||||
| 		"cgroup/sysctl":      {CGroupSysctl, AttachCGroupSysctl, 0}, | ||||
| 		"cgroup/getsockopt":  {CGroupSockopt, AttachCGroupGetsockopt, 0}, | ||||
| 		"cgroup/setsockopt":  {CGroupSockopt, AttachCGroupSetsockopt, 0}, | ||||
| 		"classifier":         {SchedCLS, AttachNone, 0}, | ||||
| 		"action":             {SchedACT, AttachNone, 0}, | ||||
| 	} | ||||
|  | ||||
| 	for prefix, t := range types { | ||||
| @@ -892,13 +895,13 @@ func getProgType(sectionName string) (ProgramType, AttachType, string) { | ||||
| 		} | ||||
|  | ||||
| 		if !strings.HasSuffix(prefix, "/") { | ||||
| 			return t.progType, t.attachType, "" | ||||
| 			return t.progType, t.attachType, t.progFlags, "" | ||||
| 		} | ||||
|  | ||||
| 		return t.progType, t.attachType, sectionName[len(prefix):] | ||||
| 		return t.progType, t.attachType, t.progFlags, sectionName[len(prefix):] | ||||
| 	} | ||||
|  | ||||
| 	return UnspecifiedProgram, AttachNone, "" | ||||
| 	return UnspecifiedProgram, AttachNone, 0, "" | ||||
| } | ||||
|  | ||||
| func (ec *elfCode) loadRelocations(sec *elf.Section, symbols []elf.Symbol) (map[uint64]elf.Symbol, error) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Davanum Srinivas
					Davanum Srinivas