From nobody Sat Sep 25 16:38:11 2021 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 235D517D067F for ; Sat, 25 Sep 2021 16:38:13 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HGvj10ZYlz4p95; Sat, 25 Sep 2021 16:38:13 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from [192.168.0.88] (unknown [195.64.148.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: avg/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 94527C72E; Sat, 25 Sep 2021 16:38:12 +0000 (UTC) (envelope-from avg@freebsd.org) From: Andriy Gapon Subject: Re: page fault in pfioctl To: Kristof Provost Cc: net@freebsd.org References: <980E0B5C-41CF-466E-AD45-7B93532199F4@freebsd.org> Message-ID: Date: Sat, 25 Sep 2021 19:38:11 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 25/09/2021 19:34, Kristof Provost wrote: > On 25 Sep 2021, at 18:25, Andriy Gapon wrote: >> On 13/06/2021 11:19, Kristof Provost wrote: >>> On 13 Jun 2021, at 09:41, Andriy Gapon wrote: >>>> Based on >>>> the panic message (page fault with non-sleepable locks held), it seems that >>>> the problem is with holding the lock across the copyout. Usually that >>>> won't panic, but if the destination happens to be paged out... And only >>>> with INVARIANTS, I guess... >>> >>> Oh right. Thanks. I’ve gotten bitten by that one before, but had clearly >>> garbage collected the memory. >>> >>> I’ll fix this one and check for others on Monday. >>> >>> I’ll also see of we can persuade copyout to always panic on this bug, not >>> just when the destination memory is actually paged out. That way we’ll catch >>> this in the regression tests in the future. >> >> I upgraded to the latest stable/13 and hit a fresh panic of the same type. >> This time it's in pf_getstatus() and it's a copyout while 'pf rulesets' lock is held. >> > I believe that’s fixed by https://cgit.freebsd.org/src/commit/sys/netpfil/pf/pf_ioctl.c?id=cb13059663e455b3fc69c293dadec53c164490dc Thank you for the pointer! I believe it should help with the witness warning. Still not sure what's going on with copyout_nosmap_std(). -- Andriy Gapon