From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792424167; b=PkZ/NVf/ZfB7iVS6lbzuqL5fGcLvaNvS5sqNndyGFbEcjIb0gNaYIGT8fqXM7vagYG+L lGsWNfN+an1zS7oHGFZ5QgeuokpRtIffHCbocbefB7lfJxCLiMAMz4AGjU9NMqRSgQktF vq0WR2bwpyjCUBLpR3Kw/j8fNOpmBzoeCqeL99wNpQVbAFjJIpYJOTkdL9P7msA+R+5tJ UdWAwaa11IEzWf5jryZiy42PFcI7MfF0kgWZQcqA1USKAq8YYG6KKSZ4U3Gga/I/44qJP AHnrvvbgtSHAQjuBm/aJtjCF9XlVqy5KVw7rJcdX1rjpvlchlkIORbEJwsxwg3uxdjg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792424167; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Scanned-By; bh=P/5dqfj7vTG/lINlWEYXcU+uCyfa82tRccYJR49wXCs=; b=pFhkIsz+5kzniaJ9nPrtr3aKUSQOH5LfxUVLtOafsj4IHQfYCY7Qy5SfLY/6K2HWOaR0 nSLBYXT320BSgEzlnKFZQ7MQWJLuPl1j8fZQqO+JXJXdxtJaREE9/AvkZFemCF7CXv+/p k0LYocBAK18B1lS4POhrwaqm4hM1CZduEy555T5BbPoutbc8UcxaGGcDpgfcoSHlFlF1q o6mokftKiijgySdkBArdT1XDzF8mDOhqjU+IrqNdFV88EhiovLHipXjeM5IzKW6lVqyta ops7L+gf74Hw/gz5J5xdfPCr+tPFWqfibqDkVwh01djajg+abFIN4hBZKLH5ANNb8tA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=A6X3d117; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65F9A606EFF5 for ; Mon, 19 Oct 2026 15:36:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 65F9A606EFF5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=A6X3d117 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792424166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=P/5dqfj7vTG/lINlWEYXcU+uCyfa82tRccYJR49wXCs=; b=A6X3d117whShrfPmMAG+qlvrNNVAR5ccqHRSoIydHAPmdXILxdAxciD7ltZYB54NFd01sw 2IuJSIGeZ4l6mZyjiLcAifhKr129biY9o9ZAFwRm+dFA5ip7RQLVy8Kgbu6ZKGOyvf/21z Wut8VG39WOs4QSwhK7cTei39AwcS4HA= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-119-18dsTZefNZGqODH-NofnOQ-1; Mon, 19 Oct 2026 15:36:02 +0000 X-MC-Unique: 18dsTZefNZGqODH-NofnOQ-1 X-Mimecast-MFC-AGG-ID: 18dsTZefNZGqODH-NofnOQ_1792424160 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 383941955F29; Mon, 19 Oct 2026 15:36:00 +0000 (UTC) Received: from onestero-thinkpadp1gen7.tpbc.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 4839230000E3; Mon, 19 Oct 2026 15:35:55 +0000 (UTC) Received: by onestero-thinkpadp1gen7.tpbc.csb (nbSMTP-1.00) for uid 13628 oleg@redhat.com; Mon, 19 Oct 2026 17:35:59 +0200 (CEST) Date: Mon, 19 Oct 2026 17:35:54 +0200 From: Oleg Nesterov To: Joel Granados , Allison Henderson Cc: kernel test robot , oe-lkp@lists.linux.dev, lkp@intel.com, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, wireguard@lists.zx2c4.com, rds-devel@oss.oracle.com Subject: Re: [linus:master] [sysctl] 8d75c338f0: BUG:KASAN:slab-use-after-free_in_touch_wq_lockdep_map Message-ID: References: <202610190310.9737b2e3-lkp@intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 On 10/19, Oleg Nesterov wrote: > > But. rds_init() can also fail even if CONFIG_SYSCTL=y, after > rds_sysctl_init(), so to me this looks like a bug in net/rds/. > > > In any case, I guess net/rds/ init paths should not fail if > CONFIG_SYSCTL=n ? So I think that something like the uncompiled/untested patch below makes sense anyway even if doesn't fix all the potential problems with rds_wq. What do you think? Oleg. --- diff --git a/net/rds/ib_sysctl.c b/net/rds/ib_sysctl.c index 2af678e71e3c..bccdb5c4df1d 100644 --- a/net/rds/ib_sysctl.c +++ b/net/rds/ib_sysctl.c @@ -36,19 +36,10 @@ #include "ib.h" -static struct ctl_table_header *rds_ib_sysctl_hdr; - unsigned long rds_ib_sysctl_max_send_wr = RDS_IB_DEFAULT_SEND_WR; unsigned long rds_ib_sysctl_max_recv_wr = RDS_IB_DEFAULT_RECV_WR; unsigned long rds_ib_sysctl_max_recv_allocation = (128 * 1024 * 1024) / RDS_FRAG_SIZE; -static unsigned long rds_ib_sysctl_max_wr_min = 1; -/* hardware will fail CQ creation long before this */ -static unsigned long rds_ib_sysctl_max_wr_max = (u32)~0; - unsigned long rds_ib_sysctl_max_unsig_wrs = 16; -static unsigned long rds_ib_sysctl_max_unsig_wr_min = 1; -static unsigned long rds_ib_sysctl_max_unsig_wr_max = 64; - /* * This sysctl does nothing. * @@ -61,6 +52,14 @@ static unsigned long rds_ib_sysctl_max_unsig_wr_max = 64; */ unsigned int rds_ib_sysctl_flow_control = 0; +#ifdef CONFIG_SYSCTL +static unsigned long rds_ib_sysctl_max_wr_min = 1; +/* hardware will fail CQ creation long before this */ +static unsigned long rds_ib_sysctl_max_wr_max = (u32)~0; + +static unsigned long rds_ib_sysctl_max_unsig_wr_min = 1; +static unsigned long rds_ib_sysctl_max_unsig_wr_max = 64; + static struct ctl_table rds_ib_sysctl_table[] = { { .procname = "max_send_wr", @@ -105,6 +104,8 @@ static struct ctl_table rds_ib_sysctl_table[] = { }, }; +static struct ctl_table_header *rds_ib_sysctl_hdr; + void rds_ib_sysctl_exit(void) { if (rds_ib_sysctl_hdr) @@ -118,3 +119,15 @@ int rds_ib_sysctl_init(void) return -ENOMEM; return 0; } + +#else + +void rds_ib_sysctl_exit(void) +{ +} + +int rds_ib_sysctl_init(void) +{ + return 0; +} +#endif diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c index 025f518a4349..a0673a41633a 100644 --- a/net/rds/sysctl.c +++ b/net/rds/sysctl.c @@ -36,11 +36,6 @@ #include "rds.h" -static struct ctl_table_header *rds_sysctl_reg_table; - -static unsigned long rds_sysctl_reconnect_min = 1; -static unsigned long rds_sysctl_reconnect_max = ~0UL; - unsigned long rds_sysctl_reconnect_min_jiffies; unsigned long rds_sysctl_reconnect_max_jiffies = HZ; @@ -49,6 +44,10 @@ unsigned int rds_sysctl_max_unacked_bytes = (16 << 20); unsigned int rds_sysctl_ping_enable = 1; +#ifdef CONFIG_SYSCTL +static unsigned long rds_sysctl_reconnect_min = 1; +static unsigned long rds_sysctl_reconnect_max = ~0UL; + static struct ctl_table rds_sysctl_rds_table[] = { { .procname = "reconnect_min_delay_ms", @@ -91,6 +90,8 @@ static struct ctl_table rds_sysctl_rds_table[] = { }, }; +static struct ctl_table_header *rds_sysctl_reg_table; + void rds_sysctl_exit(void) { unregister_net_sysctl_table(rds_sysctl_reg_table); @@ -107,3 +108,15 @@ int rds_sysctl_init(void) return -ENOMEM; return 0; } + +#else + +void rds_sysctl_exit(void) +{ +} + +int rds_sysctl_init(void) +{ + return 0; +} +#endif