From owner-freebsd-net@freebsd.org Fri Oct 9 12:49:38 2020 Return-Path: Delivered-To: freebsd-net@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 7201D3F9ACE for ; Fri, 9 Oct 2020 12:49:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C77FF4y2Dz4LYC for ; Fri, 9 Oct 2020 12:49:37 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x730.google.com with SMTP id 140so8651484qko.2 for ; Fri, 09 Oct 2020 05:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=GwUVfpZwomT4pF8wHEHwpAxa0evn4Hrync6th8j/zMQ=; b=kb0eu91zG8BHj7cD7su1HwBzlaUntkOQVNfxZ0pKYPPs0ogovDduE0cS7ZVRsrKBH6 cdUjWM0mfgsZGNWwxOpdSGMx/21Ti9mQI7fbPVl8XUePpJfNHiTBq0w1JU6n3buGMQJu +dxGPhTRhmxB2+1fT2Ovf73yD4ExzfOxK3ZqohR2Dc85MvxmzWYHxEQT/FrAVovk+PFX pla3IRkxHPurzp5Rb1qVzBpxtGeE/hAdVHzQi6KKS76iPpqUmhfHc0ly45iBKTK4jYgR iRv/qaHHp/JcSBQdg9cEC+e2oTZP2gcakS3oU7Rxgv0bWnAfLl4dAyP53MM8/JXfypWV liGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=GwUVfpZwomT4pF8wHEHwpAxa0evn4Hrync6th8j/zMQ=; b=T9dlRG5SSdwXX16pbGvK4T3azUwLJ8wal/pWJPj5F5K2gEmio9bdwD7fk4Ct1QR7Ug kNmb3nNVYaXxrdHtCHGHIwuEZkPLt9Y/IvUavcVYrvJ9H4D+LloXUwjwYpYhqzC89m74 GiBxjBGb6uTww9e7Aa9fgzuEpBXmjS0BDyqXMvrend0eIdqtMYbOsBca6ygpZ5Vnk+A6 GFj4JrXqEMYJ/8C3mBiRgyeBd/kZlutxm+lU8lnLgO9JQ4A5DP7MDeE+A7fhmpYZtUzC /qTVU8YeV4W39DDjfheZOQjGP7nwzeQmridKgg58WTVnpBdkd5MOxCZEGTBtDHGiv2bk VpyA== X-Gm-Message-State: AOAM530qqBIqsTQDjIy8/zZ3Wnp/L82ANoKcJu25hxna22or7qzyPfUU 00BrSta6q09YV99upmc+gCcE1Zx7Mgw= X-Google-Smtp-Source: ABdhPJyeWlJrXjvZnB/A4IvytLZvyH6XJIK55X0/IraP3c7LXTU1Oa/yzgWaGeN3jgjZysdXri4Jaw== X-Received: by 2002:a05:620a:15b8:: with SMTP id f24mr7316051qkk.167.1602247776760; Fri, 09 Oct 2020 05:49:36 -0700 (PDT) Received: from raichu (toroon0560w-lp130-01-174-88-77-103.dsl.bell.ca. [174.88.77.103]) by smtp.gmail.com with ESMTPSA id d47sm6332114qtk.53.2020.10.09.05.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2020 05:49:35 -0700 (PDT) Sender: Mark Johnston Date: Fri, 9 Oct 2020 08:49:33 -0400 From: Mark Johnston To: "Leverett, Bruce" Cc: "freebsd-net@freebsd.org" Subject: Re: kernel: page fault in unp_pcb_owned_lock2_slowpath Message-ID: <20201009124933.GB29607@raichu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4C77FF4y2Dz4LYC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=kb0eu91z; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::730 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.91)[-0.908]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.04)[-1.044]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.05)[-1.051]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::730:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-net] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2020 12:49:38 -0000 On Thu, Oct 08, 2020 at 09:58:09PM +0000, Leverett, Bruce wrote: > In 12.1, we are seeing a page fault in unp_pcb_owned_lock2_slowpath, while trying to lock unp2. Examination of the crash dump shows that unp2's reference count is down to zero, which it shouldn't be, since the function took a reference on it before unlocking unp. > > Could this be a bug that has been fixed in recent versions? I would look into upgrading, or back-porting the fix, if a fix is known. I recently fixed a few issues with the unix domain socket locking code. The commits were merged to stable/12 in r366488. There's a few earlier fixes in uipc_usrreq.c that were merged after 12.1, so you might have luck backporting those as well. I'm not sure what the specific bug is in your case; a backtrace at least might be enough to pinpoint it.