netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Fedor Pchelkin <pchelkin@ispras.ru>
Cc: Julian Anastasov <ja@ssi.bg>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Florian Westphal <fw@strlen.de>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Dwip Banerjee <dwip@linux.vnet.ibm.com>,
	netdev@vger.kernel.org, lvs-devel@vger.kernel.org,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	linux-kernel@vger.kernel.org,
	Alexey Khoroshilov <khoroshilov@ispras.ru>,
	lvc-project@linuxtesting.org
Subject: Re: [PATCH net] net: ipvs: avoid stat macros calls from preemptible context
Date: Tue, 16 Jan 2024 16:03:29 +0000	[thread overview]
Message-ID: <20240116160329.GB588419@kernel.org> (raw)
In-Reply-To: <20240115143923.31243-1-pchelkin@ispras.ru>

On Mon, Jan 15, 2024 at 05:39:22PM +0300, Fedor Pchelkin wrote:
> Inside decrement_ttl() upon discovering that the packet ttl has exceeded,
> __IP_INC_STATS and __IP6_INC_STATS macros can be called from preemptible
> context having the following backtrace:
> 
> check_preemption_disabled: 48 callbacks suppressed
> BUG: using __this_cpu_add() in preemptible [00000000] code: curl/1177
> caller is decrement_ttl+0x217/0x830
> CPU: 5 PID: 1177 Comm: curl Not tainted 6.7.0+ #34
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 04/01/2014
> Call Trace:
>  <TASK>
>  dump_stack_lvl+0xbd/0xe0
>  check_preemption_disabled+0xd1/0xe0
>  decrement_ttl+0x217/0x830
>  __ip_vs_get_out_rt+0x4e0/0x1ef0
>  ip_vs_nat_xmit+0x205/0xcd0
>  ip_vs_in_hook+0x9b1/0x26a0
>  nf_hook_slow+0xc2/0x210
>  nf_hook+0x1fb/0x770
>  __ip_local_out+0x33b/0x640
>  ip_local_out+0x2a/0x490
>  __ip_queue_xmit+0x990/0x1d10
>  __tcp_transmit_skb+0x288b/0x3d10
>  tcp_connect+0x3466/0x5180
>  tcp_v4_connect+0x1535/0x1bb0
>  __inet_stream_connect+0x40d/0x1040
>  inet_stream_connect+0x57/0xa0
>  __sys_connect_file+0x162/0x1a0
>  __sys_connect+0x137/0x160
>  __x64_sys_connect+0x72/0xb0
>  do_syscall_64+0x6f/0x140
>  entry_SYSCALL_64_after_hwframe+0x6e/0x76
> RIP: 0033:0x7fe6dbbc34e0
> 
> Use the corresponding preemption-aware variants: IP_INC_STATS and
> IP6_INC_STATS.
> 
> Found by Linux Verification Center (linuxtesting.org).
> 
> Fixes: 8d8e20e2d7bb ("ipvs: Decrement ttl")
> Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>

Acked-by: Simon Horman <horms@kernel.org>


  parent reply	other threads:[~2024-01-16 16:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 14:39 [PATCH net] net: ipvs: avoid stat macros calls from preemptible context Fedor Pchelkin
2024-01-16 11:11 ` Julian Anastasov
2024-01-16 16:03 ` Simon Horman [this message]
2024-01-17 12:44 ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116160329.GB588419@kernel.org \
    --to=horms@kernel.org \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=dwip@linux.vnet.ibm.com \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=ja@ssi.bg \
    --cc=kadlec@netfilter.org \
    --cc=khoroshilov@ispras.ru \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=lvs-devel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=pchelkin@ispras.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).