From nobody Fri Jun 12 17:16:55 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A79E448C8A5 for ; Wed, 13 May 2026 17:25:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778693116; cv=none; b=LEc3nWT+Hu2sk2ZytZNeL05mwMzuaJ9o2YUIQKH9TgKB15bl9VSzw9yBqFGIiml0bGY7L30F3Wdsa4RlTTNHU/PBbML6MSaVBnNbC5A+yeuyA0AQGS3DxEwgfdZ/hlJegxzbqnCrz24Ly7/DytQThgaRbaYhapLMBGVsCKBBd7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778693116; c=relaxed/simple; bh=0l3K1Vx6dDHrT4K/Ky69g1F83Rx5pkBVmYmgs7DnxK4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Cn0tZ3qPr6EaAvXHAcLA5M2PcS/NxqIEg96Imlw/xhynDkCu5QpHXYReDlBzYTz5GqO9v+UgmQo/A1vnXpgSKeqvqEq1njuxPgrux6Q+zqrRoIq4bXKGrlUXQAdblLz/kEtOy6ZxX09wbPAO0ChQRqOrwXHb8ltRuz/Pgcga8HI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Tp0m2xlN; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Tp0m2xlN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778693113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=P6Gxt0Syx0btkQxNHujdK6tAvcgI3DJpQWuCddcKTlE=; b=Tp0m2xlN+53whgUrCjmBMZeuzWN6XxVVZn/jZfVA9HOY7hsZW0SkdHQY2fYXzgdN08LaQd pBI8EsYxUG+JotVgyN4M8VaYNOGxg3TGYg+cbpZyP/m5L2HVlZkj5wBhq2oJFAle5imnyx cNOQwqEbP0TUubQBPalfZZtW1o6eXNQ= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-ajT9Fg5hMFel42STe0JZeg-1; Wed, 13 May 2026 13:25:08 -0400 X-MC-Unique: ajT9Fg5hMFel42STe0JZeg-1 X-Mimecast-MFC-AGG-ID: ajT9Fg5hMFel42STe0JZeg_1778693107 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2B84D1800372; Wed, 13 May 2026 17:25:07 +0000 (UTC) Received: from wsxc.redhat.com (unknown [10.96.134.76]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2678F300019F; Wed, 13 May 2026 17:25:02 +0000 (UTC) From: Ricardo Robaina To: audit@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: paul@paul-moore.com, eparis@redhat.com, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, Ricardo Robaina , Steve Grubb Subject: [PATCH v2] netlink, audit: prevent false ENOBUFS on timeout expiry Date: Wed, 13 May 2026 14:24:43 -0300 Message-ID: <20260513172443.1128496-1-rrobaina@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" When auditd is bottlenecked (e.g., by slow disk I/O), kauditd blocks on the netlink socket. If the wait timeout fully expires (timeo =3D=3D 0), netlink mistakenly interprets the zeroed timeout as a non-blocking request. It then triggers netlink_overrun that drops the event, completely bypassing the audit subsystem's internal retry queue, and falsely returns ENOBUFS to user-space, resulting in the following error: auditd[]: Error receiving audit netlink packet (No buffer space available) Fix this by detecting when a blocking sender's timeout has expired (timeo =3D=3D 0 && !nonblock) in netlink_unicast(). In this case, instead of retrying with timeo=3D0 (which would incorrectly trigger netlink_overrun on the next iteration), safely free the skb and return -EAGAIN, allowing the audit subsystem to gracefully enqueue the pending event into its internal backlog. Suggested-by: Steve Grubb Suggested-by: Paul Moore Signed-off-by: Ricardo Robaina --- Changes in v2: - Use the simple check (timeo =3D=3D 0 && !nonblock) to detect expired timeout, avoiding adding a new NETLINK flag. net/netlink/af_netlink.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 2aeb0680807d..fdc3db74b178 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1351,8 +1351,18 @@ int netlink_unicast(struct sock *ssk, struct sk_buff= *skb, } =20 err =3D netlink_attachskb(sk, skb, &timeo, ssk); - if (err =3D=3D 1) + if (err =3D=3D 1) { + /* timeo may have been zeroed by schedule_timeout inside + * netlink_attachskb. If the caller is a timed-blocking sender + * (not genuinely nonblocking), don't re-enter with timeo=3D0 as + * that would misfire netlink_overrun on the next iteration. + */ + if (timeo =3D=3D 0 && !nonblock) { + kfree_skb(skb); + return -EAGAIN; + } goto retry; + } if (err) return err; =20 --=20 2.53.0