Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/tools/testing/selftests/bpf/progs/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 601 B image not shown  

Quelle  test_global_func10.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
#include <stddef.h>
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include "bpf_misc.h"

#if !defined(__clang__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

struct Small {
 long x;
};

struct Big {
 long x;
 long y;
};

__noinline int foo(const struct Big *big)
{
 if (!big)
  return 0;

 return bpf_get_prandom_u32() < big->y;
}

SEC("cgroup_skb/ingress")
__failure __msg("invalid read from stack")
int global_func10(struct __sk_buff *skb)
{
 const struct Small small = {.x = skb->len };

 return foo((struct Big *)&small) ? 1 : 0;
}

Messung V0.5
C=77 H=93 G=85

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.