From owner-freebsd-stable@freebsd.org Tue Oct 13 09:20:01 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3AF5943B4D4; Tue, 13 Oct 2020 09:20:01 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9VPY0s1Wz4StM; Tue, 13 Oct 2020 09:20:01 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id DC2E61501D; Tue, 13 Oct 2020 09:20:00 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 124423703E; Tue, 13 Oct 2020 11:19:59 +0200 (CEST) From: "Kristof Provost" To: "Eugene M. Zheganin" Cc: freebsd-net@freebsd.org, freebsd-stable Subject: Re: pf and hnX interfaces Date: Tue, 13 Oct 2020 11:19:58 +0200 X-Mailer: MailMate (1.13.2r5673) Message-ID: <5FB9EFF9-0D95-4FC6-9469-2FC29D479379@FreeBSD.org> In-Reply-To: <7166d87e-7547-6be8-42a7-b0957ca4f543@norma.perm.ru> References: <7166d87e-7547-6be8-42a7-b0957ca4f543@norma.perm.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 09:20:01 -0000 On 13 Oct 2020, at 10:58, Eugene M. Zheganin wrote: > I'm running a FreeBSD 12.1 server as a VM under Hyper-V. And although > this letter will make an impression of another lame post blaming > FreeBSD for all of the issues while the author should blame himselm, > I'm atm out of another explanation. The thing is: I'm getting loads of > sendmail errors like: > > > ===Cut=== > > Oct 13 13:49:33 gw1 sm-mta[95760]: 09D8mN2P092173: SYSERR(root): > putbody: write error: Permission denied > Oct 13 13:49:33 gw1 sm-mta[95760]: 09D8mN2P092173: SYSERR(root): > timeout writing message to .mail.protection.outlook.com.: > Permission denied > > ===Cut=== > A “Permission denied” on outbound packets can indeed happen when pf decides to block the packet. > The relay address is just random. The thing is, I can successfully > connect to it via telnet. Even send some commands. But when this is > done by senamil - and when it's actually sending messages, I get > random errors. Firstly I was blaming myself and trying to get the rule > that actually blocks something. I ended up having none of the block > rules without log clause, and in the same time tcpdump -netti pflog0 > shows no droppen packets, but sendmail still eventually complains. > > If it matters, I have relatively high rps on this interface, about 25 > Kpps. > > I've also found several posting mentionsing that hnX is badly handling > the TSO and LRO mode, so I switched it off. No luck however, with > vlanhwtag and vlanmtu, which for some reason just cannot be switched > off. the if_hn also lacks a man page for some reason, so it's unclear > how to tweak it right. > While it’s possible that there are issues with TSO/LRO those wouldn’t look like this. (As an aside, I am interested in any reproducible setups where pf has issues with TSO/LRO. As far as I’ve been able to see all such issues have been resolved.) > And the most mysterious part  - when I switch the pf off, the errors > stops to appear. This would clearly mean that pf blocks some packets, > but then again, this way the pflog0 would show them up, right (and yes > - it's "UP" )? > It’s possible for pf to drop packets without triggering log rules. For example, if pf decides to drop the packet before it matches any rule (e.g. it’s a corrupt packet) it won’t show up in pflog. > Is there some issue with pf and hn interfaces that I'm unaware about? > There’s no interface specific code in pf, so it wouldn’t be specific to hn interfaces. > Are these symptoms of a bug ? > Perhaps. It can also be a symptom of resource exhaustion. Are there any signs of memory allocation failures, or incrementing error counters (in netstat or in pfctl)? Best regards, Kristof