Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp211545pxj; Thu, 13 May 2021 03:10:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwy36cAdnGp3vRTnfpbO9Mh1SR7814iCQ/jG6rPP6eL2R/gyMw+73WVlvDJLfhtI4mEIgmn X-Received: by 2002:a05:6638:3708:: with SMTP id k8mr37006963jav.24.1620900648310; Thu, 13 May 2021 03:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620900648; cv=none; d=google.com; s=arc-20160816; b=TtAcXVYSac7k6BMtjfBzMg3Ckt0NNHWqDN7ukejapRMZmoFwH0JylEZSzlskzSCFxh 2VazcI4CxMOg7JZ+dGy3TYg8H71LT8MZp5e2PkaQXudqM/0e+zLb2+YliDhkGmJLGjZ6 tkk33n+H1JNIybj572QESm13ldXd/Fi6QAtMtc2PQkd7cXnnbtnzH2GxUEHBz0CJM7jz kxUfj9ctYN6UeP/+Q5dxHuplGsfpX04c3KImGhoC9eR599G0EQHEGWKY+zJFyqvSn9Yl 5XMsJodVZ1umPRFuBfCAvD/i2F4qRY/FyFfaeF5XOecby+q29zc0JF5PC8mLSNoJtEsI AwJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=aw7LRPX6tq7M7BmczKU7NCBmBIwXs1/S7DOiXiPO3xM=; b=VZB5X+t7C6nUCVOlcnjl74Mj/0F6cCkRy+LitxCxZ/deW9NTvFoJo4g2X0OPT/7yzo qOXIZXXCL/+fy4DndUmhXiKXrDEPXkAlGeFYvC/UHWNsYMReG/QnH5Im6uHf+Q63arOZ 8jqyeyFuiLnmWyufNDiA+f6TkAZPr4aV21EvSErHFBqmTmE7NWt+c5rnbgEHQD/Hp5B6 FQAMBqcPF26hIftbTrkBs5exVWehibwEhCHXqHIuoB+yGntuSlw++3WA0GQ841PLcqYz i9KjhMxc1+k5emM0mqEb9O54m+n7R2HPb9qz8gWWAqzOOumQINgBHPBSgGbXhQoatMhW ZvsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si1977708jat.123.2021.05.13.03.10.34; Thu, 13 May 2021 03:10:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232756AbhEMJmD (ORCPT + 99 others); Thu, 13 May 2021 05:42:03 -0400 Received: from mail.netfilter.org ([217.70.188.207]:60854 "EHLO mail.netfilter.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230393AbhEMJmA (ORCPT ); Thu, 13 May 2021 05:42:00 -0400 Received: from us.es (unknown [90.77.255.23]) by mail.netfilter.org (Postfix) with ESMTPSA id 2708764151; Thu, 13 May 2021 11:39:59 +0200 (CEST) Date: Thu, 13 May 2021 11:40:47 +0200 From: Pablo Neira Ayuso To: Dexuan Cui Cc: "'netfilter-devel@vger.kernel.org'" , "'netdev@vger.kernel.org'" , Stephen Hemminger , Haiyang Zhang , "'linux-kernel@vger.kernel.org'" Subject: Re: netfilter: iptables-restore: setsockopt(3, SOL_IP, IPT_SO_SET_REPLACE, "security...", ...) return -EAGAIN Message-ID: <20210513094047.GA24842@salvia> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 13, 2021 at 06:19:38AM +0000, Dexuan Cui wrote: > > From: Dexuan Cui > > Sent: Wednesday, May 12, 2021 11:02 PM > > BTW, I found a similar report in 2019: > > " > https://serverfault.com/questions/101022/error-applying-iptables-rules-using-iptables-restore > I stumbled upon this issue on Ubuntu 18.04. The netfilter-persistent > service failed randomly on boot while working ok when launched manually. > Turned out it was conflicting with sshguard service due to systemd trying > to load everything in parallel. What helped is to setting > ENABLE_FIREWALL=0 in /etc/default/sshguard and then adding sshguard chain > and rule manually to /etc/iptables/rules.v4 and /etc/iptables/rules.v6. > " > > The above report provided a workaround. There's -w and -W to serialize ruleset updates. You could follow a similar approach from userspace if you don't use iptables userspace binary. > I think we need a real fix. iptables-nft already fixes this.