From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, T_DKIMWL_WL_HIGH,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1E8FC04A6B for ; Mon, 6 May 2019 14:39:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9E08206A3 for ; Mon, 6 May 2019 14:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153588; bh=YfW38Wj8yAMLTXOz0TwUClnEogQ6Up7uCe3W6uiivCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iDamRQM6AA5yyEHrWbHGxtL0XjocsLG5oLE8IKT2vJBUoimcoId9R4TrJr6n+8Go4 T1Ir8CiOZgfERQBFK+dw/ynJHgQxmnPqtJj605zHXhMmSdgnUyKats/QD5vInr273h uoJ80Tzbmzb6x4pgIhYOKXQ+323dURe0JboTjFUw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727889AbfEFOjr (ORCPT ); Mon, 6 May 2019 10:39:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:32854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726935AbfEFOjn (ORCPT ); Mon, 6 May 2019 10:39:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C369B206A3; Mon, 6 May 2019 14:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153583; bh=YfW38Wj8yAMLTXOz0TwUClnEogQ6Up7uCe3W6uiivCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jQgFPs0+3Pu9OrwMBcsQeR3AvvUN7W59f1illEcJxGWCzw0YKHQpyklnClL09hMK4 a31Z/NJE1CitvCFW6S64L8ypIuZLe/0fFVjcvYbw+brUOD2YsU3zcrDzXG2BDjtm2Z dkHKXOQ2lgrij7ECQgyTvXxcuo4GofwQHLcb+B9c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+4ece1a28b8f4730547c9@syzkaller.appspotmail.com, Johannes Berg Subject: [PATCH 4.19 03/99] mac80211: dont attempt to rename ERR_PTR() debugfs dirs Date: Mon, 6 May 2019 16:31:36 +0200 Message-Id: <20190506143054.184704313@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143053.899356316@linuxfoundation.org> References: <20190506143053.899356316@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg commit 517879147493a5e1df6b89a50f708f1133fcaddb upstream. We need to dereference the directory to get its parent to be able to rename it, so it's clearly not safe to try to do this with ERR_PTR() pointers. Skip in this case. It seems that this is most likely what was causing the report by syzbot, but I'm not entirely sure as it didn't come with a reproducer this time. Cc: stable@vger.kernel.org Reported-by: syzbot+4ece1a28b8f4730547c9@syzkaller.appspotmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/debugfs_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c @@ -838,7 +838,7 @@ void ieee80211_debugfs_rename_netdev(str dir = sdata->vif.debugfs_dir; - if (!dir) + if (IS_ERR_OR_NULL(dir)) return; sprintf(buf, "netdev:%s", sdata->name);