netfilter: nf_log: fix uninit read in nf_log_proc_dostring
authorJann Horn <jannh@google.com>
Wed, 20 Jun 2018 16:33:45 +0000 (18:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:12:32 +0000 (13:12 +0200)
commitf6a67684626cf03b317ccc4c6d5bac99822d1b06
tree0494a5b3fc4321c4b802531fe2f7123b5a2c8727
parentf6e22734fba141b631965c38d04365e430673e0c
netfilter: nf_log: fix uninit read in nf_log_proc_dostring

[ Upstream commit dffd22aed2aa1e804bccf19b30a421e89ee2ae61 ]

When proc_dostring() is called with a non-zero offset in strict mode, it
doesn't just write to the ->data buffer, it also reads. Make sure it
doesn't read uninitialized data.

Fixes: c6ac37d8d884 ("netfilter: nf_log: fix error on write NONE to [...]")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_log.c