From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796409587; b=F6QKk28xC0mpwyexgtcwlr+dMaNhbF9trFJ1VFkmgvGWFq7lXN3i4eDeLJRwmVDEQ/KV aY3tCXeMWZg7uQMMpUUylsAVIaTu84IR0GgnalWgtM9CuCTUcRLKbB3nkbP2P9Lk0Dujr AFzPfSqolxaGSNm4Wt/S9UTXhCyfAjjNqTf2zgtdgz68JKYUbA3Y9b79/iZ1ZkW+vkrsk B1R4kc8M0cGo7cqNzXkoXD6KZYKAErbMwKCdlctG0VVZkikjSJZ2k5aiNj8Po1NEjF6Jb 8xjYSyAoyoMlVJkt/uanHXFUZys/BQwgwEPtewkWMIHemRE1xrPrQzgIENx4K1pPxhA== 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-Forwarded-Encrypted: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=rpRA1OFxjeJ+cVWOy5ZyOiKsFP+8DhCEpaeZWfWOJCZtg09o40AT18JbR2yKAD/emP7v GXeWBoKMHXFkV1eCj8CLBRu2TWOREA5UyGNYXL7Z8KAS3iNSEG4yp9X6HTHkO/EJ/Gxm6 JjLX6jkDpx4nAHcYRJ4xAtXfz/ZdFc8poytXs/rJgQVXJofKIiF8PXbbz2Khdur5J6LAM yfuL7NKyu4iEnn6bxSK6lbV7fb8Zo3qde7+LCv3BxERdXeNsWoPtI2nIamLtKxkiHwGUs xvFp7m9U/M71+RKVy0T/+eBD/tX48aEEq8KwDDLY8i4W7XARSg+pgru774DoaGDezdA== 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.214.180 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 974FB606A32F for ; Fri, 4 Dec 2026 18:39:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 974FB606A32F 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) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oAGYE9zi Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2f03eeda984so7957095ad.2 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=XDaPGYgTQuK0OD7CnwUcayAehh9H6QHjvO8YwTXJAkZK5rUJs8jzWOUi2VC4x8jVdz 5vFuKGVl6m1KK4TlEy782ZgburW4hPs8qfjtEMh6lUGbn7UAlDPZ0YArtiszmwCBt4Jh YpVAtGNtJ5uyMXcdfHR/SXirJO5UaO6WDYtYH9CdzOSqNz5QwFX6dDL8IPAsB0OWgm0w RVZdmW9cwdKz7RRZ65H67RdYJjJ8KComPg4D/0Ew8T8PkzRGU/Ce/CHpGJVOun+UmF++ XvCfcMRKTvqi+1fSb4bnWCg8AdrlttyVd6Q59X24gC/Yg/gbMM9Dxyjc43ERCuWScBAx YRmg== X-Forwarded-Encrypted: i=1; AL+hErGSAW/vD9GE2UnueyXmfK8vRVDd0g7u+LOcGZStgWzUh4hkgdSv3DsGxPAgQ/vyBVbBTXk=@vger.kernel.org X-Gm-Message-State: AB4q+uE0bvuJNGkJIKCltIOYltJADDroFTZCHDAWT2nUMHG5gv7bhtn3 0evoq90guwa2oHoCYiER1HH/+IUaURQC3I4fcJv7WqBhFu8Dj5BWOgHp X-Gm-Gg: AZFdTZeeCAUEmy6VU4tL5mG3WN5ClwBD2G2nvhJ5z3DbG/Pdwin1AJH85ajYG42I3ei 4vCvhbeldixd4UQd3Xv/UiAEqwzxp8eilZf/t3PtOrii3qqTt6F8FlgQWSXBdiXBGUsaGXEPvb9 tBq7XkSmBlF/89Qbd2nhKOAL8/UkhkroqXgFvoSk94BqvY4/7QYx5HCYSZLU7yX+mXj9ektNgom q24wHr4KhiaYU2zrFJbUbytu3X0LSsiD81BpamAerTQ2DwhNayTp7bh5DGLwGBJTcspUikB5MfH JIu4EzWTStqy2TdLL/Ruuu0bq4rFq6cr/Rq9YyN+6uicNlBgIGGetgSQ3UihOy/FP+ONVmfy5hM 3QwYodmkZNv6z1qrXPp66s8KdA9NeHOjn5bv5uxonzaj4RV2lzoe9F0v8EJo3yTCFrsLsWsBY0F VjDbvDDanvxmlXwP27/KXP/I1iPjagsbdhwUYn0PTaaiHI3SjJdC9fVLSjELElDSf7azfeZrdHB YJVal5vnYjut7UzCQsPKsJbHvU/hCmtvFWNh/T242hes7tCv+cf9EhbmU5+h00dxOf2BMcfV3XD QIOiRxjsXeZSh2431SyTa9CcUMeoswwpfS6i1YWaZjTndDhDIHhZWdtIy8BLLu8ClrT9+T8LeVa VWxdksYrAkkYYT/5JqCVeM+q6ZEUkMGrecQ== 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: bpf@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