Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp700182rdh; Wed, 14 Feb 2024 08:51:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVd4CwZRhXiFMLNH4oXJg93GC0unJoT1dRt4dA2HPcjfpSId2xbjpG0obHQZpRhHOSLXDPvwHGFV2FMYOFBluaQGYf2BahJHCBfRNmTbw== X-Google-Smtp-Source: AGHT+IFOJjYJIXtriy4aHaolY7EmYt6rKsgiB/sAt8xndGvAqpD5RYEa+lmMOGHau0WipirSF8qW X-Received: by 2002:a17:906:b7da:b0:a3d:14d0:f253 with SMTP id fy26-20020a170906b7da00b00a3d14d0f253mr2214765ejb.9.1707929471341; Wed, 14 Feb 2024 08:51:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707929471; cv=pass; d=google.com; s=arc-20160816; b=eDut57KWFuCHsLbaAIjOQixeNdH92fVkbLlBWHIHSbVnHJ5zDU9b+KSct+JZ6yLlOS E8nj2OCJMDgyWtqb9QGs98QE58emUc5RDW2utwcaLG5wh5DllfVBO9q9vVS7dIPfEMBZ ZJMRaab6PbP/QnyB8sMUwNMIH+b/myfYqfdfEzDPjJfo3H9JpQ7fjZNSauVjqLiZ52JV M+GC1r0zChRSPyf3TBH+4eEBPqyCvdL2rDj7oMuL1cQ57UYyAIcfxoIGyfCUAUmkyY0l KlmV0ebqVVoe3VI45n9ZYq8qZ06ZHbnDf5SIwR+lr/wP3Dfpo7jUtSQXVIspiC5/W6Sx h+RQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=Vk1ul5uS2ZBoeZFts3eT+PosFAvNWjGHCwkbGvo+pqs=; fh=EAHqQUniBbxce0KnK+zp08lfcmTvkyIsFzy5Ostth4s=; b=Tme9+efnsyxMVFh9XABavNhyY4fFcqWVDQDxJpz5zGSr7HDW+pbRLCL+B+GZkWrvxp cyVI4eCLrOfOR0kn5eIUcVWyW7b/+Wd/m3mDCBFStSba6xaTQ8otUPsl3dJ1bOFSgSo9 SLKl1DFPFGIDa/DHfaJ8043Mv/iwIlmXclwqGdvI3gbuj14nu4Y/yCjSdrAkZm4IEyGr PiRyxmYQL4PFp+pxbf6+KZeEgJqjToCGXUDK7D32CDBZSEkMFu2zC+7EoIE8UoQ6ltXn fwjclr2RxOXo8gxSK71IrvuA+lklds1DW9dk+0na95nwOp6PNm2H4X+iIwcn9sNGKIrD ZfOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=altlinux.org); spf=pass (google.com: domain of linux-kernel+bounces-65588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65588-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWRLuKeanDfC4ReGGoONK4NzKxLRSNojIpLPs6KUOPb0NQqa7Ui9A5H1MUfz+QLkcr4ZKM0Q+HYr+Pryfgc+uXjJIsluadVPvdZO8WI+A== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a19-20020a170906685300b00a3d254c3cfasi1196188ejs.577.2024.02.14.08.51.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 08:51:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65588-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; arc=pass (i=1 spf=pass spfdomain=altlinux.org); spf=pass (google.com: domain of linux-kernel+bounces-65588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65588-linux.lists.archive=gmail.com@vger.kernel.org" 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 1A9E01F2570A for ; Wed, 14 Feb 2024 16:51:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3147B605D6; Wed, 14 Feb 2024 16:51:00 +0000 (UTC) Received: from air.basealt.ru (air.basealt.ru [194.107.17.39]) (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 C9B155C5EA; Wed, 14 Feb 2024 16:50:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.107.17.39 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707929459; cv=none; b=OixhP7uhMuS0zFMGygJkno3Ih6SY2CCLQ7ATlb9YJtpEbAZjP+Xaerg7YG31szdYm484/EDyBYxegvXnMH8z87kWpnNQBov5i7u2S6av4sV2Rw4dOATjC1w5hxRDK5qPSIJvUHdgQUdouGlNJmDCpwZrTbAUjaIM71v2H8WjfSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707929459; c=relaxed/simple; bh=S42bjmD60jSOOw1MRkNUdJ295mrK6xebOQrF+1Ej8Xc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Iz6KiRMaGm4kMPIPEnLJduz2uv141/Lis5h3qBYfKTch4SJEra+ZFn6fcEVbx8VD1im42GW/3ZnKH88ZC+VcwWvme4eLI6Di0uJfU4LqVRyO3cYIBlq6B+jMVia5X7dD4Yv+UPXG2XRwx4UUZsnCUi4/SC/KvLm9u5d4Hda34eQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org; spf=pass smtp.mailfrom=altlinux.org; arc=none smtp.client-ip=194.107.17.39 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=altlinux.org Received: by air.basealt.ru (Postfix, from userid 490) id A3C842F20258; Wed, 14 Feb 2024 16:50:54 +0000 (UTC) X-Spam-Level: Received: from [192.168.0.103] (unknown [178.76.204.78]) by air.basealt.ru (Postfix) with ESMTPSA id 0D23F2F20256; Wed, 14 Feb 2024 16:50:52 +0000 (UTC) Message-ID: <6cbbecf1-eba1-f3e1-259a-24df71f44785@basealt.ru> Date: Wed, 14 Feb 2024 19:50:51 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 1/1] gtp: fix use-after-free and null-ptr-deref in gtp_genl_dump_pdp() Content-Language: en-US To: Eric Dumazet 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 References: <20240124101404.161655-1-kovalev@altlinux.org> <20240124101404.161655-2-kovalev@altlinux.org> <1144600e-52f1-4c1a-4854-c53e05af5b45@basealt.ru> From: kovalev@altlinux.org In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 09.02.2024 22:21, Eric Dumazet wrote: > Maybe, but the patch is not good, I think I and Pablo gave feedback on this ? > > Please trace __netlink_dump_start() content of control->module > > gtp_genl_family.module should be set, and we should get it. > > Otherwise, if the bug is in the core, we would need a dozen of 'work > arounds because it is better than nothing' > > Thank you. Thanks. I tracked the moment when the __netlink_dump_start() function was called, it turned out that in the gtp_init() initialization function before registering pernet subsystem (gtp_net_ops), therefore, outdated data is used, which leads to a crash. The documentation says that ops structure must be assigned before registering a generic netlink family [1]. I have fixed and sent a new patch [2]. [1] https://elixir.bootlin.com/linux/v6.8-rc4/source/net/netlink/genetlink.c#L773 [2] https://lore.kernel.org/netdev/20240214162733.34214-1-kovalev@altlinux.org/T/#u -- Regards, Vasiliy Kovalev