From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AA233AE6EE for ; Mon, 24 Aug 2026 10:04:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787565854; cv=none; b=pl5FauA95f8rqskl7FcxM0eHSJbrJo3ENLBFW02B/wQgv2a/d82Oc6w5KuIxYXtmD8wgrffUywO3NH3Mw6pygGzD6IkiiXVAAKMtrAG4wcKGLOVy/KdxAAMjZISnqNbO3UJvkNv7NdhhlRm2aZmJhAWhBQD8Upn1ZJr8/+C9wPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787565854; c=relaxed/simple; bh=HPvbVjJRAUx2zxnx/2JXbCymsHLLVjGfbuId3zasyvs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jz/kiL6GsoQ4yckUwQ3WX4quG8hzcvn2t5AiCLzorJXMStuDEcig/XHmL/vJUZ+ANLPPCuP6nSwzREKngkyvBwDRse6WZ9d1R93MPi+H9Opv1eCf6U+YeNYj0JzQEDKmlbCwPnGg/JQlc8unzQ4dIn8gT3fTbo1HmmJqEDrlLhU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=snu.ac.kr; spf=pass smtp.mailfrom=snu.ac.kr; dkim=pass (1024-bit key) header.d=snu.ac.kr header.i=@snu.ac.kr header.b=cLKedQEF; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=snu.ac.kr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=snu.ac.kr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=snu.ac.kr header.i=@snu.ac.kr header.b="cLKedQEF" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2ccf2360620so28078615ad.3 for ; Mon, 24 Aug 2026 03:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snu.ac.kr; s=google; t=1787565849; x=1788170649; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=PbN3euIVQaKZlKlCehEGCne8jRWCUQcC3Nf98ImKjAk=; b=cLKedQEFUprgt3TDw8sP6+l5Y1GH6IDMa/x4Smy0a2Ca7aU2NrPUJoQzzFVVktnAf/ rW+Gtwt4iqjkJUDitQtjXJ8LusKAFn9oUGmbXjqZs5yoQooASTevMOpSJZqaim5XrxqW YklVGXKOKLk4SOsW5Kntzs0ADoW9yBykqmOrc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787565849; x=1788170649; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=PbN3euIVQaKZlKlCehEGCne8jRWCUQcC3Nf98ImKjAk=; b=W+NtJgzw05HbS+3iFN5l9bpgOoGJXk06gBYW+NZdUANPknUh0jFlBqwJ+TJojy6taR YUH7GdYi9ZksJ7Cz36D3KaBvD3metPcoidQVm4xR8LofxMIdsikieuDCFEnJA23UVV8j SbgKDDHLfs/spbDY0QH5tRF4Z0VcRYDx/tt1W39UPXowC+8mIMDD3h7wYpkQPrgrKE+G IZB+9MBQKfd5CMPlOsCD1x6GxoWAerORUE9pGj/kj7u3gEV3T9J0a3DDTvdnFJShSG/E zbfq4+6PY3SUPU4R1uVeS9MT+WWybehYK0VNq+8+BFGobgw5fHedKS7vJ/3faF02WNe2 PKDw== X-Forwarded-Encrypted: i=1; AHgh+RpczxUrj9UEctldoBHhOUM8cJTGGR0B+IMp4yGNGyARZNFSm0C9e442Ztm7yjTmmepRGfZwph36FfJTBs8=@vger.kernel.org X-Gm-Message-State: AFuF++kGBpz9LzZ6uobi8/z4fPXPr4VNyXVf95iISd9iccdjdJTMrIu/ d4Em3ZvQdrrU5rcR0v+o0UAOfg5CtpP5lv66aSfXbfoXQw5BD7BD6hv9fTgNYZ8W++M= X-Gm-Gg: AR+sD12NXIVjxxcRjolAF0yU02+R0ICQ9+v3qhN+vH5Bp1vaxJgzpCsHzzhg0n6938V PXtUT853Bg+RsygCmP/vfc/lHum2PTiKhqpf6h43TpDVkHxGYzLSLIEAtEo0RJiONQiXpDRxQdU W0jcbHui6dTQuAuCItc+yR/YeMh+VoX5DC631r8j8TPzF+RnIX7S3roVoJGFWQvK8pyE3qPIF5j /UkG56ApAMXTMlfA3s8O6N+IMryoWDox/b/xGX/ur3qdytVgAL8R0X2h4goXOY+GWipW6LYJ99B 5Pr5aEdc6unKinZGfoPTE62IVSiYqJ+aXX8W2WrqCK0wJcxEp8k2OQ9nRGB0Wm7d+EFmbshH+9g mvJgoy4zf6oeHGUI9/7T57opgw7+dx+iPNzRWToQXyYSYLOGsQElsxn7JbhM04q+FUsDoyZXaZ3 jlxux+u4YIxV+N1zpOnM5Dlaabcah4Biek9BQuMKTyvO3wPLHwqaGs8TPtgRTyqLEacbJMx+2ai IxH0+dHd4/XuJlktKjYbp17OlOYlanDz+2muyTMsxjw X-Received: by 2002:a17:902:ebc2:b0:2c0:b6c7:227e with SMTP id d9443c01a7336-2d64adea473mr478553465ad.5.1787565848918; Mon, 24 Aug 2026 03:04:08 -0700 (PDT) Received: from eulgyu-desktop.localdomain ([147.46.174.223]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d67689639bsm15324615ad.54.2026.08.24.03.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 03:04:08 -0700 (PDT) From: Eulgyu Kim To: edumazet@google.com, jiayuan.chen@linux.dev, pabeni@redhat.com Cc: davem@davemloft.net, kuba@kernel.org, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, byoungyoung@snu.ac.kr, jjy600901@snu.ac.kr Subject: Re: [BUG] KASAN: slab-use-after-free Write in sk_skb_reason_drop Date: Mon, 24 Aug 2026 19:04:01 +0900 Message-ID: <20260824100401.272056-1-eulgyukim@snu.ac.kr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260423134147.1933565-1-eulgyukim@snu.ac.kr> References: <20260423134147.1933565-1-eulgyukim@snu.ac.kr> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hello, We have found that the bug still exists in v7.2. > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index fed9dfdfc..1af529b04 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -289,8 +289,11 @@ static void tun_napi_disable(struct tun_file *tfile) > > static void tun_napi_del(struct tun_file *tfile) > { > - if (tfile->napi_enabled) > + if (tfile->napi_enabled) { > + mutex_lock(&tfile->napi_mutex); > netif_napi_del(&tfile->napi); > + mutex_unlock(&tfile->napi_mutex); > + } > } > > static bool tun_napi_frags_enabled(const struct tun_file *tfile) > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index fed9dfdfc..147c80c90 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -289,8 +289,12 @@ static void tun_napi_disable(struct tun_file *tfile) > > static void tun_napi_del(struct tun_file *tfile) > { > - if (tfile->napi_enabled) > - netif_napi_del(&tfile->napi); > + if (!tfile->napi_enabled) > + return; > + > + mutex_lock(&tfile->napi_mutex); > + netif_napi_del(&tfile->napi); > + mutex_unlock(&tfile->napi_mutex); > } > > static bool tun_napi_frags_enabled(const struct tun_file *tfile) > @@ -1783,6 +1787,12 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, > > if (frags) { > mutex_lock(&tfile->napi_mutex); > + if (unlikely(tfile->detached || > + rcu_access_pointer(tfile->tun) != tun)) { > + err = -EBUSY; > + mutex_unlock(&tfile->napi_mutex); > + goto out; > + } > skb = tun_napi_alloc_frags(tfile, copylen, from); > /* tun_napi_alloc_frags() enforces a layout for the skb. > * If zerocopy is enabled, then this layout will be > @@ -1981,6 +1991,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, > mutex_unlock(&tfile->napi_mutex); > } > > +out: > return err ?: total_len; > } We have tested the both proposed patches, from Eric and Jiayuan, and our reproducer did not trigger any issue. It seems that Eric's patch is sufficient to address the reported use-after-free. However, we are not sure whether the additional state check proposed by Jiayuan is also necessary. Thanks! Best Regards, Eulgyu Kim