Skip to contentSkip to conversation

evaluate: reject: fix a crash to use tcp reset with network context in bridge

PATCH In review Alvaro Neira Ayuso 2 participants 2 messages Nov 24, 2014 – Nov 25, 2014 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 evaluate: reject: fix a crash to use tcp reset with network context in bridge

If we use tcp reset with a network protocol that it's not supported, we send an error message. In that case reject.expr is NULL and we have a crash. Therefore we have to use the stmt to indicate that the error comes from the reject.

---
 src/evaluate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/evaluate.c +1 -1
index 3eeb614..00e55b7 100644
@@ -1277,7 +1277,7 @@ static int stmt_evaluate_reject_bridge_family(struct eval_ctx *ctx,
 		case __constant_htons(ETH_P_IPV6):
 			break;
 		default:
-			return stmt_binary_error(ctx, stmt->reject.expr,
+			return stmt_binary_error(ctx, stmt,
 				    &ctx->pctx.protocol[PROTO_BASE_NETWORK_HDR],
 				    "cannot reject this ether type");
 		}
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 3 lines · Alvaro Neira Ayuso

If we use tcp reset with a network protocol that it's not supported, we send an error message. In that case reject.expr is NULL and we have a crash. Therefore we have to use the stmt to indicate that the error comes from the reject.

Please, reword this title and description. I can see you're fixing this by passing the stmt->location instead of the reject expression, which is NULL in this case.

Thanks.