netfilter: nfnetlink: skip error delivery on batch in case of ENOMEM
[ Upstream commit a1a64a151dae8ac3581c1cbde44b672045cb658b ]
If caller reports ENOMEM, then stop iterating over the batch and send a
single netlink message to userspace to report OOM.
Fixes: cbb8125eb4 ("netfilter: nfnetlink: deliver netlink errors on batch completion")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
af42c4fd82
commit
1200af82cf
@@ -473,7 +473,8 @@ ack:
|
|||||||
* processed, this avoids that the same error is
|
* processed, this avoids that the same error is
|
||||||
* reported several times when replaying the batch.
|
* reported several times when replaying the batch.
|
||||||
*/
|
*/
|
||||||
if (nfnl_err_add(&err_list, nlh, err, &extack) < 0) {
|
if (err == -ENOMEM ||
|
||||||
|
nfnl_err_add(&err_list, nlh, err, &extack) < 0) {
|
||||||
/* We failed to enqueue an error, reset the
|
/* We failed to enqueue an error, reset the
|
||||||
* list of errors and send OOM to userspace
|
* list of errors and send OOM to userspace
|
||||||
* pointing to the batch header.
|
* pointing to the batch header.
|
||||||
|
|||||||
Reference in New Issue
Block a user