Skip to content

Commit

Permalink
bpfilter: Initialize pos variable
Browse files Browse the repository at this point in the history
Make sure 'pos' is initialized to zero before calling kernel_write().

Fixes: d2ba09c ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Alexei Starovoitov <[email protected]>
  • Loading branch information
Alexei Starovoitov committed Jul 14, 2020
1 parent ec2ffdf commit a4fa458
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/bpfilter/bpfilter_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit a4fa458

Please sign in to comment.