diff options
author | Alexei Starovoitov <ast@kernel.org> | 2020-07-14 12:31:45 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-14 12:31:45 -0700 |
commit | a4fa458950b40d3849946daa32466392811a3716 (patch) | |
tree | 46eeaafa4faa0f1ea594afb91227fdc829f9c800 | |
parent | ec2ffdf65f8b2b64f3f40062f0a24861b72cf39f (diff) |
bpfilter: Initialize pos variable
Make sure 'pos' is initialized to zero before calling kernel_write().
Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r-- | net/bpfilter/bpfilter_kern.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bpfilter/bpfilter_kern.c b/net/bpfilter/bpfilter_kern.c index 54f82c341e20..2c31e82cb953 100644 --- a/net/bpfilter/bpfilter_kern.c +++ b/net/bpfilter/bpfilter_kern.c @@ -48,6 +48,7 @@ static int __bpfilter_process_sockopt(struct sock *sk, int optname, req.len = optlen; if (!bpfilter_ops.info.tgid) goto out; + pos = 0; n = kernel_write(bpfilter_ops.info.pipe_to_umh, &req, sizeof(req), &pos); if (n != sizeof(req)) { |