Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Daniel Borkmann says: ==================== pull-request: bpf 2017-12-02 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix a compilation warning in xdp redirect tracepoint due to missing bpf.h include that pulls in struct bpf_map, from Xie. 2) Limit the maximum number of attachable BPF progs for a given perf event as long as uabi is not frozen yet. The hard upper limit is now 64 and therefore the same as with BPF multi-prog for cgroups. Also add related error checking for the sample BPF loader when enabling and attaching to the perf event, from Yonghong. 3) Specifically set the RLIMIT_MEMLOCK for the test_verifier_log case, so that the test case can always pass and not fail in some environments due to too low default limit, also from Yonghong. 4) Fix up a missing license header comment for kernel/bpf/offload.c, from Jakub. 5) Several fixes for bpftool, among others a crash on incorrect arguments when json output is used, error message handling fixes on unknown options and proper destruction of json writer for some exit cases, all from Quentin. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include <linux/bpf.h>
|
||||
#include <linux/filter.h>
|
||||
@@ -131,11 +133,16 @@ static void test_log_bad(char *log, size_t log_len, int log_level)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct rlimit limit = { RLIM_INFINITY, RLIM_INFINITY };
|
||||
char full_log[LOG_SIZE];
|
||||
char log[LOG_SIZE];
|
||||
size_t want_len;
|
||||
int i;
|
||||
|
||||
/* allow unlimited locked memory to have more consistent error code */
|
||||
if (setrlimit(RLIMIT_MEMLOCK, &limit) < 0)
|
||||
perror("Unable to lift memlock rlimit");
|
||||
|
||||
memset(log, 1, LOG_SIZE);
|
||||
|
||||
/* Test incorrect attr */
|
||||
|
||||
Reference in New Issue
Block a user