From mboxrd@z Thu Jan 1 00:00:00 1970 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 EF69D6A33B for ; Wed, 28 May 2025 11:40:34 +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=1748432436; cv=none; b=C/fr2SxLk4cfOJZ+ss3Ewwc6oviD5ahvxJRcUa+2RcI518wM+OcORPUsgc63jp4pkxAsIJ0nSYXLLp+V53kiFK5LAyrD+qX0OyeeHLQg8MICBthd2TcN61p0v3cvLZll6xX3xpD3P7DwoShSxvWHLiB9uqHd+c850uqRHDKdH2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748432436; c=relaxed/simple; bh=s0E/JPB2RVKM3pCSOztlMvXsSv73lgEmtqPMAp5ty3I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kvsqpFWTTWEs7xy7ZGAdiqF3KchtiNel+zOPOuB89a78vkT9A2q0u/+0BfV+Ymtr7D3WJEZp9uNUroRvWfJioqi+TS8I0AiSrXXHJ8gAnvvEiiTyaexrG5BL3FvgzTebinyAQ2dtlmkBtnX/MvC13sZ7BH+GD6lLgZJTHiRkj/c= 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=Nhsr4J8D; 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="Nhsr4J8D" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748432434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y8ytucNmkUadNY0WairdPCZtS/66pSOvaLe3O4I3fs0=; b=Nhsr4J8D51QVgdptw7vdkcTVvxx77QFtkv9wPhfn82miJKR3qnVkSLVJNtGa+Iu7Xnlo0v 5IFDF4/b8c3h+hrWy1JO38p6iWnbxsLJwFPNlDsMvp07xF4j3QfVmhzwqseWat1veoqs1v sYlRAUl30FKi0LOOFg+Kzi+GLnmcpxM= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-75-IjqQSo7qOaGW3l9gyuFj_g-1; Wed, 28 May 2025 07:40:32 -0400 X-MC-Unique: IjqQSo7qOaGW3l9gyuFj_g-1 X-Mimecast-MFC-AGG-ID: IjqQSo7qOaGW3l9gyuFj_g_1748432431 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3a4dde7eec6so1846269f8f.2 for ; Wed, 28 May 2025 04:40:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748432431; x=1749037231; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y8ytucNmkUadNY0WairdPCZtS/66pSOvaLe3O4I3fs0=; b=DoEZD+NT74oCNcY701eoU1nqlP+hlB3lP6ez4xjxhk5qtCQt4NO3Y0iB+VhoYxrRQ2 YNYElaatDeo3X0/atoLAdQbUOlYiqvxoQTj7gXEMNGZfY/hH7f/l01ljDlnBbIvY9WkY hmSahlczTMW6Oo6/2t83xOeWt9p/gSzrjAm5MUwkLARIYvczN+Infsi4foGUQkmcfnPg AX2bsn43AcMcR3FPcVBs8b2POIYAmTTDzhU7qEAYI2YMYqOW7WZUZpmhYke2/fmql6zm yGX/jxaNzvYJ4XJgFRmYqLHZf4zP3DjuuFU1JbVpj80+CQERoLZ6d5+HBZciqsV3D5zE o/Cw== X-Forwarded-Encrypted: i=1; AJvYcCVP5nG9CmwrGnAnK+c57gscp4WbGfCGzq/Go1t96VSAQgldZxvBlg+8l+IWrXMtHLCsptE8sGg=@vger.kernel.org X-Gm-Message-State: AOJu0Yx4OqjOHe59XePVppb//aJaFlVkeMfVF5xShwuPN2IK8AUG39uI QOV0cmadIhS11molNGd+FJbDtmQ7zC5e3bk82a9DcCbHwWTNyzsGg+n5Zc+JLKgN7c1zhT9zTFi ODe4K2RHNgTAY2/2u1ZtlQctcBhqyaVdOJPyPtsQIvAYi4BIUJRp7RYRonvyx3+uNqA== X-Gm-Gg: ASbGncseYdMXJYvz3hW80ARbY0rl5sT5XCxzDSjIrfReooERIpUx7Vcf501dttjbxeX benq5YlMj5NV5i+X6aWOQNWRfSM6bgAY66aCbQRWJ0astDN/Pdz2156etoQVnRcU/7verZCUWda Y1291wxz3RynWnIKsCmW67TFKPzI/cqfvqWd7pajTaXrhIP8iIu6Oo+OzB9nKQsI1aTWbcBQt10 kPSZOUYukOPSAl0qJCbM30LEhcq8qLqy2T6TZ+ZP2/Te76Pg+d1kWSXXUMnFbm/PIylZynLaUw0 lvKFJ69ZieIXrSzkWkM= X-Received: by 2002:a05:6000:4284:b0:3a3:6234:3736 with SMTP id ffacd0b85a97d-3a4cb4832d6mr13305699f8f.38.1748432430994; Wed, 28 May 2025 04:40:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCxmJKDNJ2ghluYSm6UG3A6bl8t3iznimyJvvrwX7Q1EWHm3GCXCJYX2vltE/kD3NNsSUasg== X-Received: by 2002:a05:6000:4284:b0:3a3:6234:3736 with SMTP id ffacd0b85a97d-3a4cb4832d6mr13305677f8f.38.1748432430573; Wed, 28 May 2025 04:40:30 -0700 (PDT) Received: from ?IPV6:2a0d:3344:2728:e810::f39? ([2a0d:3344:2728:e810::f39]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4eac8f128sm1267053f8f.60.2025.05.28.04.40.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 May 2025 04:40:30 -0700 (PDT) Message-ID: Date: Wed, 28 May 2025 13:40:28 +0200 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 net-next 0/9] af_unix: Introduce SO_PASSRIGHTS. To: Kuniyuki Iwashima , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Willem de Bruijn Cc: Simon Horman , Christian Brauner , Kuniyuki Iwashima , netdev@vger.kernel.org References: <20250519205820.66184-1-kuniyu@amazon.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20250519205820.66184-1-kuniyu@amazon.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/19/25 10:57 PM, Kuniyuki Iwashima wrote: > As long as recvmsg() or recvmmsg() is used with cmsg, it is not > possible to avoid receiving file descriptors via SCM_RIGHTS. > > This series introduces a new socket option, SO_PASSRIGHTS, to allow > disabling SCM_RIGHTS. The option is enabled by default. > > See patch 8 for background/context. > > This series is related to [0], but is split into a separate series, > as most of the patches are specific to af_unix. > > The v2 of the BPF LSM extension part will be posted later, once > this series is merged into net-next and has landed in bpf-next. > > [0]: https://lore.kernel.org/bpf/20250505215802.48449-1-kuniyu@amazon.com/ While booting a debug linus's tree with current net-next merged in, I see a few splat at boot time: [ 4.556951] refcount_t: underflow; use-after-free. [ 4.557466] WARNING: CPU: 0 PID: 1 at lib/refcount.c:28 refcount_warn_saturate+0xae/0x150 [ 4.558351] Modules linked in: [ 4.558692] CPU: 0 UID: 0 PID: 1 Comm: systemd Tainted: G B 6.15.0.net-next-6.16_0b31b995f034+ #3 PREEMPT(voluntary) [ 4.559887] Tainted: [B]=BAD_PAGE [ 4.560246] Hardware name: Red Hat KVM/RHEL, BIOS 1.16.3-2.el9 04/01/2014 [ 4.560913] RIP: 0010:refcount_warn_saturate+0xae/0x150 [ 4.561443] Code: c3 22 a3 03 01 e8 62 de df fe 0f 0b eb d1 80 3d b1 22 a3 03 00 75 c8 48 c7 c7 a0 77 73 b4 c6 05 a1 22 a3 03 01 e8 42 de df fe <0f> 0b eb b1 80 3d 8f 22 a3 03 00 75 a8 48 c7 c7 60 78 73 b4 c6 05 [ 4.563167] RSP: 0018:ffa000000001fac0 EFLAGS: 00010286 [ 4.563708] RAX: 0000000000000000 RBX: ff11000129544680 RCX: 0000000000000000 [ 4.564401] RDX: 0000000000000002 RSI: 0000000000000004 RDI: 0000000000000001 [ 4.565110] RBP: 0000000000000003 R08: 0000000000000001 R09: ffe21c002b27d8b1 [ 4.565817] R10: ff110001593ec58b R11: 0000000000000000 R12: ff11000129544600 [ 4.566511] R13: ff11000129542bc0 R14: 0000000000000001 R15: ff11000129542c40 [ 4.567216] FS: 00007f2c798deb40(0000) GS:ff110001a1bb3000(0000) knlGS:0000000000000000 [ 4.568005] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 4.568579] CR2: 000055c3cefb01d8 CR3: 0000000120b4c003 CR4: 0000000000771ef0 [ 4.569287] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 4.569991] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 [ 4.570688] PKRU: 55555554 [ 4.571005] Call Trace: [ 4.571285] [ 4.571538] unix_release_sock+0x9ee/0x1040 [ 4.571984] ? rcu_is_watching+0x11/0xb0 [ 4.572398] ? __pfx_unix_release_sock+0x10/0x10 [ 4.572881] ? down_write+0xb4/0x220 [ 4.573268] ? __pfx_down_write+0x10/0x10 [ 4.573687] unix_release+0x88/0xe0 [ 4.574074] __sock_release+0xa3/0x260 [ 4.574474] sock_close+0x14/0x20 [ 4.574842] __fput+0x365/0xa80 [ 4.575197] fput_close_sync+0xd9/0x190 [ 4.575599] ? __pfx_fput_close_sync+0x10/0x10 [ 4.576072] __x64_sys_close+0x79/0xd0 [ 4.576469] do_syscall_64+0x8c/0x3d0 [ 4.576873] ? __pfx___handle_mm_fault+0x10/0x10 [ 4.577354] ? lock_release+0x121/0x190 [ 4.577774] ? rcu_is_watching+0x11/0xb0 [ 4.578188] ? __count_memcg_events+0x45c/0x5c0 [ 4.578654] ? count_memcg_events_mm.constprop.0+0xd4/0x200 [ 4.579275] ? rcu_is_watching+0x11/0xb0 [ 4.579683] ? lock_release+0x121/0x190 [ 4.580100] ? count_memcg_events_mm.constprop.0+0xd9/0x200 [ 4.580658] ? handle_mm_fault+0x3cf/0x670 [ 4.581099] ? exc_page_fault+0x58/0xc0 [ 4.581505] ? rcu_is_watching+0x11/0xb0 [ 4.581925] ? lock_release+0x121/0x190 [ 4.582345] ? do_user_addr_fault+0x489/0xb10 [ 4.582806] ? rcu_is_watching+0x11/0xb0 [ 4.583221] ? trace_irq_enable.constprop.0+0x14a/0x1b0 4.583758] ? clear_bhb_loop+0x60/0xb0 [ 4.584165] ? clear_bhb_loop+0x60/0xb0 [ 4.584574] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 4.585095] RIP: 0033:0x7f2c7a638417 [ 4.585471] Code: ff e8 2d f6 01 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 41 c3 48 83 ec 18 89 7c 24 0c e8 a3 7e f8 ff [ 4.587182] RSP: 002b:00007ffc7c624c58 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 [ 4.587921] RAX: ffffffffffffffda RBX: 00007f2c798de9d0 RCX: 00007f2c7a638417 [ 4.588611] RDX: 000055c3cefcfeb0 RSI: 000055c3cef580c0 RDI: 0000000000000026 [ 4.589318] RBP: 0000000000000026 R08: 00000000ffffffff R09: 0000000000000000 [ 4.590019] R10: 0000000000000010 R11: 0000000000000246 R12: 000055c3cef54a10 [ 4.590715] R13: 0000000000000000 R14: 00007ffc7c624db0 R15: 000055c3cef57cc0 [ 4.591408] [ 4.591665] irq event stamp: 25199 [ 4.592044] hardirqs last enabled at (25199): [] asm_sysvec_apic_timer_interrupt+0x16/0x20 [ 4.592986] hardirqs last disabled at (25198): [] handle_softirqs+0x733/0x920 [ 4.593824] softirqs last enabled at (24848): [] handle_softirqs+0x5f8/0x920 [ 4.594651] softirqs last disabled at (24843): [] __irq_exit_rcu+0x11b/0x270 I'm going to blindly test a local revert of this series and/or a9194f88782afa1386641451a6c76beaa60485a0 and will report back. /P