public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Fedor Pchelkin <pchelkin@ispras.ru>
Cc: stable@vger.kernel.org, Johannes Berg <johannes@sipsolutions.net>,
	Pavel Skripkin <paskripkin@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Bob Copeland <me@bobcopeland.com>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Alexey Khoroshilov <khoroshilov@ispras.ru>,
	lvc-project@linuxtesting.org,
	syzbot+860268315ba86ea6b96b@syzkaller.appspotmail.com,
	Johannes Berg <johannes.berg@intel.com>
Subject: Re: [PATCH 5.4/5.10 1/1] mac80211: mesh: embedd mesh_paths and mpp_paths into ieee80211_if_mesh
Date: Thu, 23 Feb 2023 10:11:39 +0100	[thread overview]
Message-ID: <Y/ctyzCtbPwyrrDI@kroah.com> (raw)
In-Reply-To: <20230222200301.254791-2-pchelkin@ispras.ru>

On Wed, Feb 22, 2023 at 11:03:01PM +0300, Fedor Pchelkin wrote:
> From: Pavel Skripkin <paskripkin@gmail.com>
> 
> commit 8b5cb7e41d9d77ffca036b0239177de123394a55 upstream.
> 
> Syzbot hit NULL deref in rhashtable_free_and_destroy(). The problem was
> in mesh_paths and mpp_paths being NULL.
> 
> mesh_pathtbl_init() could fail in case of memory allocation failure, but
> nobody cared, since ieee80211_mesh_init_sdata() returns void. It led to
> leaving 2 pointers as NULL. Syzbot has found null deref on exit path,
> but it could happen anywhere else, because code assumes these pointers are
> valid.
> 
> Since all ieee80211_*_setup_sdata functions are void and do not fail,
> let's embedd mesh_paths and mpp_paths into parent struct to avoid
> adding error handling on higher levels and follow the pattern of others
> setup_sdata functions
> 
> Fixes: 60854fd94573 ("mac80211: mesh: convert path table to rhashtable")
> Reported-and-tested-by: syzbot+860268315ba86ea6b96b@syzkaller.appspotmail.com
> Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> Link: https://lore.kernel.org/r/20211230195547.23977-1-paskripkin@gmail.com
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> [pchelkin@ispras.ru: adapt a comment spell fixing issue]
> Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
> ---

This also worked for 4.19.y, but not 4.14.y, care to also fix it there?

thanks,

greg k-h

  reply	other threads:[~2023-02-23  9:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 20:03 [PATCH 5.4/5.10 0/1] mac80211: mesh: embedd mesh_paths and mpp_paths into ieee80211_if_mesh Fedor Pchelkin
2023-02-22 20:03 ` [PATCH 5.4/5.10 1/1] " Fedor Pchelkin
2023-02-23  9:11   ` Greg Kroah-Hartman [this message]
2023-02-23 10:39     ` Fedor Pchelkin

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=Y/ctyzCtbPwyrrDI@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=khoroshilov@ispras.ru \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=me@bobcopeland.com \
    --cc=netdev@vger.kernel.org \
    --cc=paskripkin@gmail.com \
    --cc=pchelkin@ispras.ru \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+860268315ba86ea6b96b@syzkaller.appspotmail.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