Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2051947ybf; Mon, 2 Mar 2020 00:48:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzMB887CCZgFZJIPNBjJx8LLItctAzXRLX2m+u3lzxrrR26g7hVWBkoEJgnPIK3LWriQX6E X-Received: by 2002:a9d:6b12:: with SMTP id g18mr11914474otp.211.1583138901228; Mon, 02 Mar 2020 00:48:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583138901; cv=none; d=google.com; s=arc-20160816; b=EMQJKPNOOryxNUiK61VRMnfqjP631XrxumBUGCsiQ3aSQORF83CfI57sOWufrCH200 KNTZJfB3yY0cuz/+nlKDlgWiN8spm9CwZIo9mo0Z9VzLd8vL0FtqhAkYyoyOWEa9pyWH ALsSZlBDj/O7Owi2qlK+Za/jQxBuVn+7zrycJBbpU09PIh1g93fAP4xRZSvuJuBCIh4C QSX6YYNnG1WDiRWq3MSpxgle/cyPSbxJaROKexB7dRZtXSAlrFF5HzDISp6wOoF/2Y1t u5LV+S8k/ECfffZk0iSPdD9CV3kd91oKvxNxd9iBeKybLOoPtLSCIymfT+bMPxmt2cuk HQcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BmwrfLdolJExYHdRRMhCPOOjmUkO4JEtLsceb4ov8ok=; b=1I4E+LHarO6Nz1NpFRsIHDxFJ8VTR6hRu4z/Pd/npsKKf5JQTRhNrFs0E0o3wIeaEF oVpHpSfQNr0WsHU2EHEGEn47I40a9fn0QcZIZetxQEPCHHXJEruEdABssomwUmM57jJD 68OOLKSCKBXGkLz30Uow6oriwxpwMZvcI9dDB+sVG/a6hqdYu3Ouy92gQhdiYdRT1zAX 2opxm/9mSpyB1tWcUVQGucRd3QUxOO37x60szZ0eTXJ7cusciRb2AIPivedCXUEslN4N UqHTrEBUBcdKx4qZWV9E69BrAzSEcckIyB2INW6zCrajj2j766hoRtT1SEJbBk8POFe5 tLnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=O24DpWH2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si6439749oth.158.2020.03.02.00.48.09; Mon, 02 Mar 2020 00:48:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=O24DpWH2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727311AbgCBIre (ORCPT + 99 others); Mon, 2 Mar 2020 03:47:34 -0500 Received: from mail-qv1-f65.google.com ([209.85.219.65]:34467 "EHLO mail-qv1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727060AbgCBIre (ORCPT ); Mon, 2 Mar 2020 03:47:34 -0500 Received: by mail-qv1-f65.google.com with SMTP id o18so4492584qvf.1 for ; Mon, 02 Mar 2020 00:47:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BmwrfLdolJExYHdRRMhCPOOjmUkO4JEtLsceb4ov8ok=; b=O24DpWH2UfeWkTRI08K50mJ4S30GRrYHgISHsOKT6vo1Cs8n4fFZEy84+LGKxJ4hFB YmyzHDnmkXa1ZeyLdp9sYwRyd0OQyPzhzryH69yTcPD9M5Fs2r/mQCPbZNaGfTFw/tnw hIyolisv6vXfElx23HnGllHqfOMoJlJ9bZHtaMFrQCw+C1+zQ/Ab8Wxxb/UzqYEvWU7f iNtVRXobmDNJicpR3IS4cpSGHISIYm7KszMUIBT4vjuuhVKPLDKRnWJFwNfqlobMmp+o j6JJlUEQ4ToJwB0PSrB1EZpQ8HU24fS0IsBlBKVPjrULFPLe/apgTVLfoeOMTp/44D0U ZHxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BmwrfLdolJExYHdRRMhCPOOjmUkO4JEtLsceb4ov8ok=; b=lmcnAdzHM0POmakJRY9FlJAYvxNR5Qvz8ULdYCKB9BXHb5L2Q1zF1HaB793rF9zD1h dlXOjZoVoB0NEAIYAQhB4jKU9oRLZyTbaaeVG/RZ2cRa5ybPUzaOf6Kp3uipodxX+ya+ AWEVmtiGwiDVcFIfxbhK5k+Bv61SHFltVUkrHxoA9ApI92mlToKlXXgsC24EOOZByPwD EKqfAuaTbT2y14MA44XvpNYqQEYB9nmdjDJ3PSQwsmNQewTI19R+lb3KZpR6VWWEbhaW Oa+viV3XYaIxD5BGTYK9FbEvb0nYvnDyocyOgIRYmkFHMBcHJUlLbDCiCQtNXvVDXx1r Eang== X-Gm-Message-State: ANhLgQ0hIEi+iJZxfBOYMlUQsPMBswXMd3bPvv/cQ3csBjMTjLXv2AqO 2sE2QEt1hQwIllJBICiRfRV4BVVa4RYoMelaLlYHZA== X-Received: by 2002:ad4:4bc6:: with SMTP id l6mr7506991qvw.34.1583138852812; Mon, 02 Mar 2020 00:47:32 -0800 (PST) MIME-Version: 1.0 References: <0000000000003cbb40059f4e0346@google.com> <17916d0509978e14d9a5e9eb52d760fa57460542.camel@redhat.com> <55b362f2-9e6b-2121-ad1f-61d34517520b@i-love.sakura.ne.jp> In-Reply-To: From: Dmitry Vyukov Date: Mon, 2 Mar 2020 09:47:21 +0100 Message-ID: Subject: Re: kernel panic: audit: backlog limit exceeded To: Paul Moore Cc: Tetsuo Handa , syzbot , LKML , syzkaller-bugs , syzkaller Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 28, 2020 at 2:09 PM Paul Moore wrote: > > On Fri, Feb 28, 2020 at 5:03 AM Tetsuo Handa > wrote: > > On 2020/02/28 9:14, Paul Moore wrote: > > > We could consider adding a fuzz-friendly build time config which would > > > disable the panic failsafe, but it probably isn't worth it at the > > > moment considering the syzbot's pid namespace limitations. > > > > I think adding a fuzz-friendly build time config does worth. For example, > > we have locations where printk() emits "BUG:" or "WARNING:" and fuzzer > > misunderstands that a crash occurred. PID namespace is irrelevant. > > I proposed one at > > https://lkml.kernel.org/r/20191216095955.9886-1-penguin-kernel@I-love.SAKURA.ne.jp . > > I appreciate your response. > > To be clear, I was talking specifically about the intentional panic in > audit_panic(). It is different from every other panic I've ever seen > (perhaps there are others?) in that it doesn't indicate a serious > error condition in the kernel, it indicates that audit records were > dropped. It seems extreme to most people, but some use cases require > that the system panic rather than lose audit records. > > My suggestion was that we could introduce a Kconfig build flag that > syzbot (and other fuzzers) could use to make the AUDIT_FAIL_PANIC case > in audit_panic() less panicky. However, as syzbot isn't currently > able to test the kernel's audit code due to it's pid namespace > restrictions, it doesn't make much sense to add this capability. If > syzbot removes that restriction, or when we get to the point that we > support multiple audit daemons, we can revisit this. Yes, we need some story for both panic and pid ns. We also use a separate net ns, but allow fuzzer to create some sockets in the init net ns to overcome similar limitations. This is done using a pseudo-syscall hack: https://github.com/google/syzkaller/blob/4a4e0509de520c7139ca2b5606712cbadc550db2/executor/common_linux.h#L1546-L1562 But the pid ns is different and looks a bit harder as we need it during send of netlink messages. As a strawman proposal: the comment there says "for now": /* Only support auditd and auditctl in initial pid namespace * for now. */ if (task_active_pid_ns(current) != &init_pid_ns) return -EPERM; What does that mean? Is it a kind of TODO? I mean if removing that limitation is useful for other reasons, then maybe we could kill 2 birds with 1 stone.