Skip to content

Conversation

@kernel-patches-daemon-bpf
Copy link

Pull request for series with
subject: bpf: Specify access type of bpf_sysctl_get_name args
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=973851

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: cd7312a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=973851
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e30329b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=973851
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e30329b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=973851
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 99fe8af
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=973851
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: c11f34e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=973851
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 3ce7cdd
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=973851
version: 3

The second argument of bpf_sysctl_get_name() helper is a pointer to a
buffer that is being written to. However that isn't specify in the
prototype.

Until commit 37cce22 ("bpf: verifier: Refactor helper access
type tracking"), all helper accesses were considered as a possible
write access by the verifier, so no big harm was done. However, since
then, the verifier might make wrong asssumption about the content of
that address which might lead it to make faulty optimizations (such as
removing code that was wrongly labeled dead). This is what happens in
test_sysctl selftest to the tests related to sysctl_get_name.

Add MEM_WRITE flag the second argument of bpf_sysctl_get_name().

Signed-off-by: Jerome Marchand <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Convert test_sysctl test to prog_tests with minimal change to the
tests themselves.

Signed-off-by: Jerome Marchand <[email protected]>
Acked-by: Yonghong Song <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=973851 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/966731=>bpf-next branch June 24, 2025 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants