From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: netdev@vger.kernel.org,
"The UK's National Cyber Security Centre (NCSC)"
<security@ncsc.gov.uk>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
stable@kernel.org
Subject: Re: [PATCH net v2] packet: Move reference count in packet_sock to atomic_long_t
Date: Sat, 2 Dec 2023 00:02:15 +0100 [thread overview]
Message-ID: <2023120203-fracture-wieldable-484b@gregkh> (raw)
In-Reply-To: <20231201131021.19999-1-daniel@iogearbox.net>
On Fri, Dec 01, 2023 at 02:10:21PM +0100, Daniel Borkmann wrote:
> In some potential instances the reference count on struct packet_sock
> could be saturated and cause overflows which gets the kernel a bit
> confused. To prevent this, move to a 64-bit atomic reference count on
> 64-bit architectures to prevent the possibility of this type to overflow.
>
> Because we can not handle saturation, using refcount_t is not possible
> in this place. Maybe someday in the future if it changes it could be
> used. Also, instead of using plain atomic64_t, use atomic_long_t instead.
> 32-bit machines tend to be memory-limited (i.e. anything that increases
> a reference uses so much memory that you can't actually get to 2**32
> references). 32-bit architectures also tend to have serious problems
> with 64-bit atomics. Hence, atomic_long_t is the more natural solution.
>
> Reported-by: "The UK's National Cyber Security Centre (NCSC)" <security@ncsc.gov.uk>
> Co-developed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: stable@kernel.org
> ---
> [ No Fixes tag, needed for all currently maintained stable kernels. ]
>
> v1 -> v2:
> - Switch from atomic64_t to atomic_long_t (Linus)
Thanks for changing this, looks good to me!
greg k-h
next prev parent reply other threads:[~2023-12-01 23:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 13:10 [PATCH net v2] packet: Move reference count in packet_sock to atomic_long_t Daniel Borkmann
2023-12-01 15:03 ` Willem de Bruijn
2023-12-01 15:12 ` Eric Dumazet
2023-12-01 23:02 ` Greg Kroah-Hartman [this message]
2023-12-04 23:20 ` patchwork-bot+netdevbpf
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=2023120203-fracture-wieldable-484b@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=security@ncsc.gov.uk \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=willemdebruijn.kernel@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.