netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	davem@davemloft.net, Vasiliy Kulikov <segoon@openwall.com>
Subject: Re: [PATCH net] ping: fix the dif and sdif check in ping_lookup
Date: Thu, 17 Feb 2022 07:57:12 -0800	[thread overview]
Message-ID: <20220217075712.6bf6368c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <ea03066bc7256ab86df8d3501f3440819305be57.1644988852.git.lucien.xin@gmail.com>

On Wed, 16 Feb 2022 00:20:52 -0500 Xin Long wrote:
>  	if (skb->protocol == htons(ETH_P_IP)) {
> +		dif = inet_iif(skb);
> +		sdif = inet_sdif(skb);
>  		pr_debug("try to find: num = %d, daddr = %pI4, dif = %d\n",
>  			 (int)ident, &ip_hdr(skb)->daddr, dif);
>  #if IS_ENABLED(CONFIG_IPV6)
>  	} else if (skb->protocol == htons(ETH_P_IPV6)) {
> +		dif = inet6_iif(skb);
> +		sdif = inet6_sdif(skb);
>  		pr_debug("try to find: num = %d, daddr = %pI6c, dif = %d\n",
>  			 (int)ident, &ipv6_hdr(skb)->daddr, dif);
>  #endif
> +	} else {
> +		pr_err("ping: protocol(%x) is not supported\n", ntohs(skb->protocol));
> +		return NULL;
>  	}

Are you sure this is not reachable from some networking path allowing
attacker (or local user) to DoS the kernel logs?

  parent reply	other threads:[~2022-02-17 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16  5:20 [PATCH net] ping: fix the dif and sdif check in ping_lookup Xin Long
2022-02-17 15:10 ` patchwork-bot+netdevbpf
2022-02-17 15:57 ` Jakub Kicinski [this message]
2022-02-23  6:08   ` Xin Long
2022-02-23 15:52     ` Jakub Kicinski

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=20220217075712.6bf6368c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=segoon@openwall.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 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).