Commit 8a61fadb authored by Harald Welte's avatar Harald Welte Committed by David S. Miller
Browse files

[NETFILTER]: check nf_log function call arguments

Check whether pf is too large in order to prevent array overflow.
Signed-off-by: default avatarHarald Welte <>
Signed-off-by: default avatarDavid S. Miller <>
parent d72367b6
......@@ -157,7 +157,7 @@ struct nf_logger {
/* Function to register/unregister log function. */
int nf_log_register(int pf, struct nf_logger *logger);
void nf_log_unregister_pf(int pf);
int nf_log_unregister_pf(int pf);
void nf_log_unregister_logger(struct nf_logger *logger);
/* Calls the registered backend logging function */
......@@ -24,6 +24,9 @@ int nf_log_register(int pf, struct nf_logger *logger)
int ret = -EBUSY;
if (pf >= NPROTO)
return -EINVAL;
/* Any setup of logging members must be done before
* substituting pointer. */
......@@ -38,14 +41,19 @@ int nf_log_register(int pf, struct nf_logger *logger)
void nf_log_unregister_pf(int pf)
int nf_log_unregister_pf(int pf)
if (pf >= NPROTO)
return -EINVAL;
nf_logging[pf] = NULL;
/* Give time to concurrent readers. */
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment