microsoft / microsoft/ebpf-for-windows

Support BPF_F_RDONLY and BPF_F_WRONLY map flags

Open
#3,697 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted P3 triaged
Dominant language
C
Stars
3.6k
Forks
311
Avg merge
6d 10h
Merged PRs (30d)
21

Description

### Describe the feature you'd like supported

Libbpf defines these flags for map creation:
https://github.com/libbpf/libbpf/blob/master/include/uapi/linux/bpf.h#L1356

This allows (say) one map to be writable from user mode, whereas another map may be only writable from kernel mode. These flags are supported on Linux and libbpf, so for cross-platform portability Windows should support them with the same semantics.

### Proposed solution

We should add support for these flags for all map types.

### Additional context

This discussion arose as a result of reviewing PR #3689.
Discussed during triage meeting today, and agreed that implementing these flags would be the best way to resolve one of the comments, and that this does not block the existing PR.

Contributor guide

Open the contributing guide

Research direction

Start with the BPF_F_RDONLY and BPF_F_WRONLY definitions in the linked libbpf include/uapi/linux/bpf.h, then trace the map-creation paths in this repository. Check how map flags are handled across every map type and verify that user- and kernel-write semantics match Linux and libbpf behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.