From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796409587; b=fLcUMZb4ZNxDSlo78HGgtgzQzbCWWy2PJd6y7kFvUwtdPB8m37ksBOfXAoI8jRlN+Y57 HrGCwMCDXAGQ1p0wEHRbV+92MuP9+78iJ2ym+rdQ2mnqrwETCUp3GLqdlk7JDXwFSRkah rKwneJDAiSwTS7uFB8C60eslYCZsesYepZN627AOVOXkmP/BY/D9TYfCgtSRKjY/J14PS oiADB3eAPJhGmfI4V4gVjnm8wZaZE+MNcb58K77RjCbXCR17xatDIwG6ePJb79TGLInMJ 65hebavFvGxK3BbUFdGpBy1kBXaYMC6QmKqfQzp5CAdS2SeoRzy74/kvTsFrA8fxlkA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796409587; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Content-Type:Date: Message-Id:Cc:Subject:From:To:In-Reply-To:References: Content-Transfer-Encoding:MIME-Version; bh=wGfKv4QkZ5l469rfZc28weNhgd8OF7um6frizu+t3Ts=; b=48ZWccY7efNadnxpPpHMi73S4JttiA/9QxXJUPOWdogNRppjpc+ZKZpodw1ykq4RJWAy oQNYu/RmQypwYa/kUIzdFcnxq+/EIZ4MMEN9vsVQCNILBYwfgXAg6tO2lgJ9F0JB1QQSw D1f3NkMbvLf2MzawvCZbEw7K4nLgGFGIEmA9YkT9vOKojTSegWyQy9O/SqQd4Q//yuod6 9HVNoSOZfWEVPTBXo89owYvQHTmNdesxz44sweCNPqTcV7Zaa+xd0nCYDrDkXPttdTmmJ GMR8vLRutDP8eX2x/FlW9mFIS6IargwFCJJquY78KKHis6XUVBg5BEZIxbnTGm4D0aw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oAGYE9zi; arc=none smtp.remote-ip=209.85.216.48 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92ADC606A322 for ; Fri, 4 Dec 2026 18:39:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 92ADC606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oAGYE9zi Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-3b40f4d4b5dso691318a91.1 for ; Fri, 04 Dec 2026 10:39:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796409586; x=1797014386; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:from:to:cc:subject :date:message-id:reply-to:content-type; bh=wGfKv4QkZ5l469rfZc28weNhgd8OF7um6frizu+t3Ts=; b=oAGYE9ziVWfXTEwv1BNEq8QfQpcUaydfj2WZfdBDNTEMbxMYnnsB3R+JpImvRGWFed RrVJA/+zcoAVIfjFqJvrLjRKg1Y42zojV6ecqoUI0kqOdPriSgYiDZke0BmWJ4fzwnVg /yGOJufbMNOJbBk5yV7OBsjCwurfddcZlkF9MZ5v8Lw709S5/qTUdD3VKGjk7I3L2djY +zZZK76k1RJt9azcPsY+uYxBnqwDpXETlhzeRN2pEBrUoTxXXHb4Qljms9BSD18LG6fC A4YWL+SEjlgKdgsXs5yJHHRsyDFG8R53CZPcogmVwei/MqOB9K+c6BqnSQvL5D8tcR8c dxqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796409586; x=1797014386; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wGfKv4QkZ5l469rfZc28weNhgd8OF7um6frizu+t3Ts=; b=jutvTBSHODEZS5Dg883LNpvGyud4kri/+5gVjYUIPPCuRULO4wzECiMCZWNJOVfxM3 RMSDEnp5dujvK1jFAuEHMuGqoD9NBkPGEuoZo7tXdUXHsvVoOPxix+R7uMEapo82ogjf TQRp2lNdaWQ+HiNuehh3jBJir2CN/Go74vpYZfGmRNPyaEvTN272P0GltrLpmA/qmaIs +Yq5S2zbuVfbetUskdps3L3p2R87gqpCRtE7q7oxcXuC0mh/l1GREqdhzWDSUKGSjsGN 3VJKOdc7qUvZDt6DkV7qd9vcHZPVQmPkSZmvjpVMy1Oou75Nl951dnAEe3bf4LMOnHGl sd4Q== X-Gm-Message-State: AB4q+uFRgXBqA333LfNc4F88GkCMS5XWpl5PenGebGSQ07ciE4ZwFwtb yKFXie9yWki3q+lGcs/sxY1MVHzNIMWqcm2h3f/oNEA6WHa60Wjmnfac X-Gm-Gg: AZFdTZcs0vUbPthqRF5wj2/Rp2shOp+vOYz6PDnzApIDcv7YP1WmH9BTApT9a8MJzwK RBZaj7vSitHbW1uys6xkVoHZWqwJ3XMJP3szY89hSPe2NPp+9M7Z9IVv/xpqu+gyF407KDBnc9x sl3fY+2vKV67bgvZwgKondULZiXSQv54nPdNGi06QUhkg7waruCLlJQihnazFDYh/ax5dLBMvah k7OZZvrHUqB8tFXx7OqU6CP6V3dDiooTOjPsp7oe3+4/Kbzd31MalNd3G8aYGsT5NtOZD35EE0v 2WK3w2sZt0KMa94DS+ea1wk14ICX86xwtY4ncT4x0kRLxt4/fR6k5lQEZOVjUq+vKIdLdW9sods RJcvKSYsOBmykAH2jkgLBdlObrndhuX7S9qtiuzG1uTSbyBTFMl06XQc62hePrvEn4GvoUmL9D0 S5LmonTdR7vHntiPEMY1tMdPuNoag4EKK4El+8z2irbX+TieB6Phd8+EKLFWWs0vQo2I7d1x6QL giOqKJUFh+0NsQ/Lxszj3Ua+HJxGWrgEhoegK6JDlGc+LBll1ADY87Eqx3gNVv6X+LsN/P9tnbn PWSf4ZdXbTteenyHi4h8B85C9L7VFTQBignM3NzTGX6deHPqbQwtEXbZtvhBSDzFhI7Jm3dp3hF XX/hDMc6ZFlQI4XwKkIpS5tMchsO61RHagA== X-Received: by 2002:a17:90b:590f:b0:3b3:b36e:8c40 with SMTP id 98e67ed59e1d1-3b5e067e6bcmr2449239a91.62.1796409585819; Fri, 04 Dec 2026 10:39:45 -0800 (PST) Received: from localhost ([153.61.198.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5ddc37998sm5270263a91.10.2026.12.04.10.39.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 10:39:45 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Date: Fri, 04 Dec 2026 18:39:44 +0000 Message-Id: Cc: , , , , , , , , , Subject: Re: [BUG] KASAN: slab-use-after-free in bpf_skc_to_* via fexit on sk_common_release From: "Alexei Starovoitov" To: "MahnurA" , , , , , In-Reply-To: <20261204141902.605584-1-s.mahnur.a@gmail.com> References: <20261204141902.605584-1-s.mahnur.a@gmail.com> Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Fri, Dec 04, 2026 at 06:19 AM MahnurA wrote: > This plugs the hole temporarily. Not sure if this is the right way or > what could be a better way. Pls wrap your emails to ~80 char per line. imo the list is the least bad way. raw_tp_null_args[], untrusted_lsm_hooks and noreturn_deny are manual lists too. > The verifier is correctly rejecting the program, but now the error > message is not clear enough I think to highlight that this is an > attachment point issue specifically. Fair enough. btf_ctx_access() can say why, right after the "has btf_id" line. This goes on top of the diff. I didn't compile it: bpf_log(log, "func '%s' arg%d has btf_id %d type %s '%s'\n", tname, arg, info->btf_id, btf_type_str(t), __btf_name_by_offset(btf, t->name_off)); + if (bpf_prog_args_freed(prog)) + bpf_log(log, "func '%s' can free arg%d, marking it as untrusted\n", + tname, arg); Then the log has: func 'sk_common_release' arg0 has btf_id 145052 type STRUCT 'sock' func 'sk_common_release' can free arg0, marking it as untrusted