Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1035970rdb; Wed, 24 Jan 2024 02:58:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+eV9RTcCgqatjZBquJDzSR26mLD+hAvL3mwJsLeAA/A0W6aBq7KUhmSseMvCePNheZrCA X-Received: by 2002:a17:907:930:b0:a27:bac8:1000 with SMTP id au16-20020a170907093000b00a27bac81000mr613005ejc.96.1706093893685; Wed, 24 Jan 2024 02:58:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706093893; cv=pass; d=google.com; s=arc-20160816; b=ro+htVVpkxR5pOWkYmByF8MOZpKt3n3eJW13oR+6rlapPX0SlummzMG2rEiZu+zsLR NVmPnXGB0rLAw3pidVR8/0CI9DHURMIpsaKXbj7apaWc5wTYJcvKYNwhbGcyxE9jI5Xi ESakQZrjDb10NTr15dhIHKPehavRK1+zTipMtpQfuVNgW5ik0gKFxy7wA2ImmfuNB/O6 lfLfx8JP86z9by/ipYPFQK8Hk36KPFyKZqcZfHCKO7rDMUOTMGAbyMIjFmV9z9Hpb20i 94rUSW4RAyJKNLgV0MWzGi8aBcAN7dz0sG9I53yY6qKanGkLUP2c8UWno0rvK8A33/Bq YgjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=095eySjr9UdkzN6h8F///pYrDXdNnhrwqoAvJkhHULs=; fh=JygxOP7Nfrdap3XX5IiecCrdXj9tmE36zoAvU3VUGj4=; b=jhGydnRVvLprwkG7h0gOkdmXXiJ+COjNKe3ZUUgy55TaVQHYaI4cNvcyDQg5OJpe0W mqmaWEWgkUmcrUAJ8YEj6WEeNO2YnYz/cqBDYbit5OIlRBNXQAVwK5aFdU3Y3UiniKXh FZw/QGdiAmxbVULmfGSSmmngKpEPPsl5iUAIBObXF3cOeYsIYjEVX8tlr3GH7zgsWNZX pHq1vz6QC9G3HiHKqi0xt0QiNLgIBkF6T6Mkem+6ypClRcniK6eqSHAUTe4IKV88PkW6 7Sk/eTpJT4kH4/8p2HHszjBbrL1JvuL1RvNK9uO5/n/y6L/OshRqLA+gQtSv3vEX+n+h VJrA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=e1L+sDet; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-36819-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36819-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r18-20020a1709067fd200b00a30e6243456si1124442ejs.810.2024.01.24.02.58.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 02:58:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36819-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=e1L+sDet; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-36819-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36819-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 733A51F2373B for ; Wed, 24 Jan 2024 10:58:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A533F1AACC; Wed, 24 Jan 2024 10:58:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="e1L+sDet" Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 0FB171AAB1 for ; Wed, 24 Jan 2024 10:58:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706093882; cv=none; b=BYtJqiwjVG2XJ2WlAK/HU829bQjuOYR/GZKwYz+bIvNj8W9zGjLUUR3ZOYGQjxopCMsg2M9y23YUFydIMM35wvp3NyPlk88QpJWoznazQsECA/xIFpEpHI8wZCq2mlWBqfmvM/ugu9dy0iYXZh3s/WlztACBOlSY9WAqseUAOZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706093882; c=relaxed/simple; bh=095eySjr9UdkzN6h8F///pYrDXdNnhrwqoAvJkhHULs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bUaSXeBWAbVkayChUj6qHF58mVfTZz1SV13ESCzIOyk2rVRiJkVMjSKuLWsHuDrbCvXkN6chwohTKXg6m+xYsr3pl/RbBjbyzIYe/5q+Hr5XPj8UKpT85bmYUi5Num8UxeZVxJPDvOKh89J7DpxGlu7vABqOUFlPcS+IPAOZmok= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=e1L+sDet; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-55818b7053eso13555a12.0 for ; Wed, 24 Jan 2024 02:58:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706093879; x=1706698679; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=095eySjr9UdkzN6h8F///pYrDXdNnhrwqoAvJkhHULs=; b=e1L+sDetBI1YtsLpOjLl+VO4HeiNaLjIEvXNzSSEKart/kF+Zh6xzqkOW0x4ipMz/y YGzzHomAOoc6Jrusyrzvc69L/20aHhm3Enkn+nii0MngahBGvW1JVMW3WwNDlgKqRqgH WX7w60pRllwL7r52s2vyLW1YIZETzlZKU4aOgqfJtddLV5XManymdP/g8Q4mDiwD92WT oFjvB3rfkEuumsOpHPxg67f/1dANoY9Qi4DhiAoDyhEAVs9NX5FQ9gbbV2By8iNeo3Dj pk3I9B88iCcQ8fPqBaGOPhjYT9stq+vWZZauR06GB3mHu5P9TOnXZix3WQ2BAqiTk3Vq ZjGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706093879; x=1706698679; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=095eySjr9UdkzN6h8F///pYrDXdNnhrwqoAvJkhHULs=; b=XOhnw+eR3vZYjwJ/iLcNbJvka2riqC9v72ctUmEJET67BurpOBISBTGcsMVC/GeSbL yNP2tlqh5TyvJVC+cFwdyVPGNEHg4i1SJluAylpu1/Qc8yJ1YRE3tlrEnWE2yeugMZ3f eVFPI8428nGC7PIJ62NbugZECpwHIwq1DhdKG3TXAWx10gWZIhSIT2bNM6IZSfdaI+Hp WbTM5L6SulEe2zO4BioH0l+rSK99agHMTIoIYjRhC7TqvwkLxeN+Emcvgobt8KAk1+BE 6qEL42zLbxXNX1PrhUPoKnVL56V7XKP+ELWMpYAdvfxbo+ALHzWENYJnqBsHamrL39c2 LD0w== X-Gm-Message-State: AOJu0Yxo7p29XUmGtDzrdf6ukVYb3AYIoqAD+AMI69PmntQUi2l3tK+g FUGu5C+dJgJvsDNs0hR0OXsTqEV0NypxI7eIXfWpc+s2tkakf0smr7juIGVU/lbk/O7Me92mwCE MjUdlwY4rIco/FA9oPnRLBMvYGGNOaW0pu+Md X-Received: by 2002:a05:6402:1d84:b0:55a:4959:4978 with SMTP id dk4-20020a0564021d8400b0055a49594978mr44083edb.7.1706093878885; Wed, 24 Jan 2024 02:57:58 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240124101404.161655-1-kovalev@altlinux.org> <20240124101404.161655-2-kovalev@altlinux.org> In-Reply-To: <20240124101404.161655-2-kovalev@altlinux.org> From: Eric Dumazet Date: Wed, 24 Jan 2024 11:57:47 +0100 Message-ID: Subject: Re: [PATCH 1/1] gtp: fix use-after-free and null-ptr-deref in gtp_genl_dump_pdp() To: kovalev@altlinux.org Cc: pablo@netfilter.org, laforge@gnumonks.org, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, osmocom-net-gprs@lists.osmocom.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, nickel@altlinux.org, oficerovas@altlinux.org, dutyrok@altlinux.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 24, 2024 at 11:14=E2=80=AFAM wrote: > > From: Vasiliy Kovalev > > After unloading the module, an instance continues to exist that accesses > outdated memory addresses. > > To prevent this, the dump_pdp_en flag has been added, which blocks the > dump of pdp contexts by a false value. And only after these checks can > the net_generic() function be called. > > These errors were found using the syzkaller program: > > Syzkaller hit 'general protection fault in gtp_genl_dump_pdp' bug. > gtp: GTP module loaded (pdp ctx size 104 bytes) > gtp: GTP module unloaded > general protection fault, probably for non-canonical address > 0xdffffc0000000001:0000 [#1] SMP KASAN NOPTI > KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] > CPU: 0 PID: 2782 Comm: syz-executor139 Not tainted 5.10.200-std-def-alt1 = #1 Oh wait, this is a 5.10 kernel ? Please generate a stack trace using a recent tree, it is possible the bug has been fixed already.