From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 876272517AF for ; Mon, 22 Dec 2025 09:50:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766397059; cv=none; b=FDo4Lz9fkT+xAbdbpfpaLUrCYZ8xRhLDDZUkAfiPk2EfMZBF5qyKdC1Dm7amvZnLz1QvAPIv41xvz/qNcsk4u6d+ZcMCfsw9h5FphChZ1GS+BJu17I5Y0EwjlWhfY2R8e+HOqXtKNQsn51Mm+EyAgieImBWkFtjup6v6JKZttz8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766397059; c=relaxed/simple; bh=uFkodAP1YjVoTO7EAUP8f0mJB68YUc7dI3xVaM7AjPk=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=aw/tAqmZPhO5uqKfS9Z+ydjVlB+Pg+pL9xL91lJ8LACNQH77vxqluzfzu0FeRXPxC4mklQLZMDudJTIhhq/29ZkWqsYHs0V2L3MX6Is7cLpy9EIxG6wTn1mDq4BBh4xmixKvQ48r2EuWNcEoKdSg4uXSCW92INk+njiMsNFw22w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.210.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-ot1-f70.google.com with SMTP id 46e09a7af769-7c75798bfacso7851002a34.1 for ; Mon, 22 Dec 2025 01:50:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766397056; x=1767001856; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kkbPNgtm6RHNMgzrxv7qqd78ljwmlk61oCxKCrLcUZ0=; b=ntvWcszwLIR/ImWpm2qY9dxML1jQXi23X1EQpdQC8iFs4bp/uu3THikUrghVYjMvZ7 VsUdRlwNdRuDjpG5XIIW/DNocG6p339jebdPQMoxLd2MXm9CrPwAXa2wReNcpnowKmHX CCpZelwYWSeeZ5/G5y9v1spvH2VBPCeS+lw0TW5IY2IxE/ovz27iDg66O9kO63cbdbEl P1BSsI42+NWLOJepv1sJqjmFZ8zLIj8LbxpwVLD1Tu8YVd/Ztqo5gGvN6g/p+EAmzH04 6mufNZ8ZRnvAPwdkUF7JUcaRx4rbzP0eCSiAVG1m3jZWCzboK2S4mMUqSsgi/UMuA8iV QLvA== X-Gm-Message-State: AOJu0Yxn/kuqans15ZWZneGtKiiQZzIp1rpKT9PjrX1LGV9LdUBwi3s1 RmYYuPpqs4E3Yrs8XNK8JFJge1fYJW2SW4p+sO7Yl9T1Qzpl4yu/zp0Z35IM5btzOcSwBmQC52w 6/4ZFavSlGGckhCBZW/UTibn/pUYMrlQf6MaoK5DsmbZCFzFu8TKR8Df+O9M= X-Google-Smtp-Source: AGHT+IF6QjKd/f7haJttztxkaudqJ4o9ZWa3xU68ZI/aycjVe/mFO8vmOZlgXlOFw547WDDv8xCKbvTzzhRgtVsGtvUEA4EBeU3N Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:610e:b0:659:9a49:8f98 with SMTP id 006d021491bc7-65d0e9fe6d8mr2567388eaf.17.1766397056312; Mon, 22 Dec 2025 01:50:56 -0800 (PST) Date: Mon, 22 Dec 2025 01:50:56 -0800 In-Reply-To: <000000000000fabef5061f429db7@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69491480.050a0220.1b4e0c.0036.GAE@google.com> Subject: Forwarded: Re: [PATCH net] net/smc: Initialize smc hashtables before registering users From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: [PATCH net] net/smc: Initialize smc hashtables before registering users Author: wintera@linux.ibm.com On 17.12.25 16:25, Dust Li wrote: > On 2025-12-17 12:48:19, Alexandra Winter wrote: >> During initialisation of the SMC module initialize smc_v4/6_hashinfo before >> calling smc_nl_init(), proto_register() or sock_register(), to avoid a race >> that can cause use of an uninitialised pointer in case an smc protocol is >> called before the module is done initialising. >> >> syzbot report: >> KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] >> Call Trace: >> >> smc_diag_dump+0x59/0xa0 net/smc/smc_diag.c:236 >> netlink_dump+0x647/0xd80 net/netlink/af_netlink.c:2325 >> __netlink_dump_start+0x59f/0x780 net/netlink/af_netlink.c:2440 >> netlink_dump_start include/linux/netlink.h:339 [inline] >> smc_diag_handler_dump+0x1ab/0x250 net/smc/smc_diag.c:251 >> sock_diag_rcv_msg+0x3dc/0x5f0 >> netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2550 >> netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] >> netlink_unicast+0x7f0/0x990 net/netlink/af_netlink.c:1357 >> netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1901 > > I don't think this is related to smc_nl_init(). > > Here the calltrace is smc_diag_dump(), which was registered in > sock_diag_register(&smc_diag_handler). > > But smc_nl_init() is registering the general netlink in SMC, > which is unrelated to smc_diag_dump(). I had assumed some dependency between the smc netlink diag socket and smc_nl_init() and wrongly assumed that the smc_diag_init() and smc_init() could race. I now understand that modprobe will ensure smc_diag_init() is called before smc_init(), so you are right: this patch is indeed NOT a fix for this sysbot report [1] > I think the root cause should be related to the initializing between > smc_diag.ko and smc_v4/6_hashinfo.ht. Given modprobe initializes the modules sequentially, I do not see how these could race. I guess this syszbot report was fixed by f584239a9ed2 ("net/smc: fix general protection fault in __smc_diag_dump") as reported in [2] . I'm not sure about the correct procedure, if nobody recommends a better action, I'll send a #syz dup: general protection fault in __smc_diag_dump to syzbot+f69bfae0a4eb29976e44@syzkaller.appspotmail.com (this one: general protection fault in smc_diag_dump_proto [1]) I still think initializing the hashtables before smc_nl_init() makes sense. I'll resend this patch without mentioning syzbot. ----- [1] https://syzkaller.appspot.com/bug?extid=f69bfae0a4eb29976e44 [2] https://syzkaller.appspot.com/bug?extid=f775be4458668f7d220e