Re: [PATCH] rule: fix out of memory write if num_stmts is too low

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 05, 2020 at 03:22:07PM +0200, michael-dev wrote:
> Am 05.05.2020 14:17, schrieb Pablo Neira Ayuso:
> > On Mon, May 04, 2020 at 10:48:58PM +0200, Michael Braun wrote:
> > > Running bridge/vlan.t with ASAN, results in the following error.
> > > This patch fixes this
> > > 
> > > flush table bridge test-bridge
> > > add rule bridge test-bridge input vlan id 1 ip saddr 10.0.0.1
> > 
> > Thanks for your patch. Probably this patch instead?
> 
> That fixes the testcase for me as well.

Thanks for confirming.

> Though there are some more places that call list_add / list_add_tail on
> rule->stmts, so I'm unsure if this patch catches all similar cases, e.g:
>
> src/evaluate.c: list_add(&nstmt->list, &ctx->rule->stmts);
> src/evaluate.c: list_add(&nstmt->list, &ctx->rule->stmts);
> src/netlink_delinearize.c:      list_add_tail(&stmt->list,
> &ctx->rule->stmts);
> src/netlink_delinearize.c:              list_add_tail(&stmt->list,
> &ctx->rule->stmts);
> src/netlink_delinearize.c:              list_add_tail(&ctx->stmt->list,
> &ctx->rule->stmts);
> src/parser_json.c:              list_add_tail(&stmt->list, &rule->stmts);
> src/parser_json.c:              list_add_tail(&stmt->list, &rule->stmts);
> src/xt.c:       list_add_tail(&stmt->list, &ctx->rule->stmts);
> src/xt.c:       list_add_tail(&stmt->list, &ctx->rule->stmts);

Right, this is inconsistent. I sent a few patches for this.

BTW, did you update tests/py to run it under ASAN, a patch for this
would be great.

Thanks.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux