From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 332C73469F5 for ; Tue, 21 Apr 2026 17:59:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776794342; cv=none; b=Nkg58tXVolaV7zmU+7EzdTKwWJmNA9yWroyOfnuzwNytaO0HJtkR2M68MmuWDzGjMJi+7184LXWu+XSddsxucAejx8U5NI9bk6r6aFfpQ1qmJltVVfd9yfRAozQ/w4nwD6Rd/krNH1ROcsGAxJH//B9Y3aa+JrfnG2ERFR2oNI8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776794342; c=relaxed/simple; bh=UNWzQoiJLHZsycgSGADwufVDpldfq3IAxUjRrKn9GJg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CBtCe3Vh8g752cKqz62nnCxlErvAZt6JEggPTZcxClJ+WSxeTIRgDR0+OhreOY94RYKDp900oEuBMpi0psqZLctQNcQ/IAjx5fjIi1mlEKol7PVofIWFE+whG5H0hzzeJi3pjarknPqoPlLSQcfUftfGJE6vCFeP5n6WjS9PT1w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kywc/0DQ; arc=none smtp.client-ip=209.85.128.41 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.b="kywc/0DQ" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4891c0620bcso21066545e9.1 for ; Tue, 21 Apr 2026 10:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776794340; x=1777399140; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vlQuH9I8d8JGzpXuro5Nk2tmErbsbCQw/sXQZA/3BQc=; b=kywc/0DQIDli2z5hBKxQMHAFgK0HdLvpD1ZsQGeOs/+ucadM4/LyOwtmKJ/ONXlJnN MBCrgMdA6BGV3TsXKiDra+rxOf3RfvMqTsSBfVNgmjVv0PUL/Anr3vVOFbldg5CzATdz 1ySJfpaoJMulpYdFqkZThamEhG9tJVP2pKePdL9kKH/uFU/GMZ3SGm4jLfG4XDoIy0Fd KJh0D9GQkRH+LOIDj3caUrQi9rrb2+fMacqbtSS33bWI4teXuJRUB8XaOkYm8+CmVp9j hjH94X0jEjqCV5Z4yF6nsAAa2OMkKGN2/5Rmp+n9I6qmey0ZU7H2K/Sh+pSPTXCxJM3U xV/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776794340; x=1777399140; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vlQuH9I8d8JGzpXuro5Nk2tmErbsbCQw/sXQZA/3BQc=; b=aqHRvaIbfbHYv1eUvlGfIioJ2RZDjir3Y/v1SQ6IMNqar4XqPulNHDwxYXEPQB0ECP Seu3xH9VzP2cXNnv0x4GFPmqf0W7HmR0SekxFLjI7ruRaG4uN9qJRzZz/hF9xV76cqRh CF1j0D9k5ecM67By7YzrVVKUR//yT/BCvqMQBaVS65uZz+rhXAWeMjt4+GTr2KAqbxo+ 35gazrb7QTDcZYElP7gkcrXszmvr/DPWD5shCKggadLJICnFuEjzyUdVxk5hBRaW4Hxf Yj6PPy2DXOqPAI7zNYn+E+F6BzkOeizAIEEx1dsfTB7ZyXY68QgV6bBqzC0+1d/Lrlcl EYLw== X-Forwarded-Encrypted: i=1; AFNElJ84rYigk6YRzOHdF1LGI+GCHT1eEqqCL5CBp/KvTXkylTVAhFutD0g/mKSKhCjUsf5Mt8KIVa2snQrAuzs=@vger.kernel.org X-Gm-Message-State: AOJu0YxZ8ZF3k2IB5bsgBALdQm2nKh51BGpuP+WSm1zsG0Lt4kvAZxLA 9ORaigiAhrEUl4IRqXjVpFVTrgIEPmp8OBwD3rOhnuTYwwLMUb5HPy+v X-Gm-Gg: AeBDiev2YqDdFiKFBwUHf4N/7mYEu/QW2L3USmAS8jT0BI5uDDJ5ezXZ04zxN5rmYCq orRFKgmx0f3WqySB96bB3WvW0usj0wKOhfsjqalWIjQUe1zxC7hkRmbAwnwQmXZMGx6SZ4QnlpP fuf7lzCy2c56ear6GYl/amjVtCMehSJcwi2B1wIxtosxyp6QqgpdABVpJFNSTTyl2Pt6e4f/bYw rGlvZ57O/p8NFwSlOcP2nus9ftBI5PEJi5P+IuItKFY2iCbv9hkTvqrS4TVHb+R1VowzJ3KsUnU OhSYoagtBqbzwoG6BExTR9NYGT6Yk+Deg/riUHt4D52I8h+YYnRUWQnUuJW0+GAeljZSQGJTn01 kb0FB2lAjbv+sCFDfTGWjCeCpnXwTHYySGiccU6lWeJk+iAIoeH/5+K+FA5K5KS83eCJqYg/LnN P5Pc4CGbtBrAfcs++eREkzW6oXGMlHx7oejXvIRzJ+RW4m1g/gUo4ci5Rt518xNY+5HtUCDyLVN V5dsdUZTRRcPfDUT6A4CXb1Bhk= X-Received: by 2002:a05:600d:b:b0:48a:56de:d63c with SMTP id 5b1f17b1804b1-48a56dedadfmr32847085e9.27.1776794339439; Tue, 21 Apr 2026 10:58:59 -0700 (PDT) Received: from ?IPV6:2a02:a03f:a75e:9a00:7546:18b7:2c8c:e879? ([2a02:a03f:a75e:9a00:7546:18b7:2c8c:e879]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-489fec8f7cbsm121049875e9.11.2026.04.21.10.58.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Apr 2026 10:58:58 -0700 (PDT) Message-ID: Date: Tue, 21 Apr 2026 19:58:58 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gtp: disable BH before calling udp_tunnel_xmit_skb() To: Jakub Kicinski Cc: David Carlier , Pablo Neira Ayuso , Harald Welte , Andrew Lunn , Eric Dumazet , Paolo Abeni , Weiming Shi , osmocom-net-gprs@lists.osmocom.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260417055408.4667-1-devnexen@gmail.com> <20260420125815.3a920d9a@kernel.org> Content-Language: en-US From: Justin Iurman In-Reply-To: <20260420125815.3a920d9a@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/20/26 21:58, Jakub Kicinski wrote: > On Mon, 20 Apr 2026 21:02:55 +0200 Justin Iurman wrote: >> On 4/17/26 07:54, David Carlier wrote: >>> gtp_genl_send_echo_req() runs as a generic netlink doit handler in >>> process context with BH not disabled. It calls udp_tunnel_xmit_skb(), >>> which eventually invokes iptunnel_xmit() — that uses __this_cpu_inc/dec >>> on softnet_data.xmit.recursion to track the tunnel xmit recursion level. >>> >>> Without local_bh_disable(), the task may migrate between >>> dev_xmit_recursion_inc() and dev_xmit_recursion_dec(), breaking the >>> per-CPU counter pairing. The result is stale or negative recursion >>> levels that can later produce false-positive >>> SKB_DROP_REASON_RECURSION_LIMIT drops on either CPU. >>> >>> The other udp_tunnel_xmit_skb() call sites in gtp.c are unaffected: >>> the data path runs under ndo_start_xmit and the echo response handlers >>> run from the UDP encap rx softirq, both with BH already disabled. >>> >>> Fix it by disabling BH around the udp_tunnel_xmit_skb() call, mirroring >>> commit 2cd7e6971fc2 ("sctp: disable BH before calling >>> udp_tunnel_xmit_skb()"). >> >> Why not fix iptunnel_xmit() directly, rather than fixing all possible >> callers? Basically, jut like we did for lwtunnel_{output|xmit}(). The >> advantage would be that we no longer have to worry about BHs in the >> callers, and BHs would only be disabled when necessary. > > Oops, I pushed this already. The bot hasn't caught up yet. > Let's revisit this if we find another caller in process context? No worries, works for me!