Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp200111rdb; Mon, 22 Jan 2024 00:54:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOC0lp5RY4vbTqzYtBdX/EU9W/jrSmjBdkI0OEnokRZWUldrBlqB1b6ownUB6IRRf8dBz0 X-Received: by 2002:aa7:d842:0:b0:559:f620:1a6c with SMTP id f2-20020aa7d842000000b00559f6201a6cmr991515eds.71.1705913680501; Mon, 22 Jan 2024 00:54:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705913680; cv=pass; d=google.com; s=arc-20160816; b=qCV0avmpxhljDEuhg4J6jCxXecdLkwO3GvpxAmQdPwP5CCnhJ/x3B5CzrchrrameQX eNaJcG5n/6aUbQ4lYsnFFxsmnhAPlv5Qgudtb5pUwH2xzravTBWI3L22H2/2WHfZMCuP kXcShBcgJ7BgP3CGHY5fIhNAqlupWVOGM3pbEaR6fGqPK8Lxzyw8V8FBaZxo3RY1Nbvv /G/MWeGsrru3blETPdJSU+a1BeKuNLqAeVHJB7b6Mc7WI5Tlx555m19VoX1W0SgZOTVm umplZsUbW870bW/Ocug2U4aigOg4AjP7BzRFIipjYFb4L6OOidIR99yxtMgIU+7qkXJT s1wA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:dkim-signature:message-id; bh=lRUsv1GPag3hvBW68P9fUo86vXVS9tXvByMFvo4Foag=; fh=/od56fgx4cw8wkIjYbhq2tAlUF2NyMzExPFftHYBU7A=; b=sHKgL8eIcwDzHJ5fVC6Lx44sE06nOZyPu+ORuAYhl6odUY3DWhgig0FFqt0Mutintx O9NGSTFsSE1Nz2Q4PVbNthps01D6R4449ZuSEnhNkW4lFdWJs9hCHmfxDCCS4pcxYSUY El8sBHSUVisVbCJSrYYGLfPQ8pgS5495TNsC0OokHYV4f1bF6CjbcsWlPm+ykjDDCXew cOOtoVBA3MAgPlf0AmCgrw7NqMvctkr88xxuzahjLkyDajFdtB1ZFbwSbpjk3KLt0yvK ZZLoVYV0PmHdwhaEndifUGgIrmVn5ItSZjzkS0WEylx7J1Y8XBXC1tQyGmscMEBBiEtJ hp6w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kTk+oUuT; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-32569-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32569-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j15-20020a05640211cf00b0055a04b424aasi4567705edw.56.2024.01.22.00.54.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 00:54:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32569-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kTk+oUuT; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-32569-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32569-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 45BF81F21A67 for ; Mon, 22 Jan 2024 08:54:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC3273A8C1; Mon, 22 Jan 2024 08:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="kTk+oUuT" Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B82E3D54F for ; Mon, 22 Jan 2024 08:49:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705913365; cv=none; b=mpgKEmxe9puJgDqjFHoO8FNEib7f1HgYTkBcfyP2flHhwoGG5Sf4u5LfXEdnk/gHJWvp81Ffw0lBWKcLkwiroDTHvqkvpJ1siCl+ejAsik3EgULUyGO4S98qFhxjtbMef6F8Bhns6B2HQyqVgdVeHPlzGkn/gmyUPL217JqnPS0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705913365; c=relaxed/simple; bh=bNH3ZpjBAKn5TeoM1nK6+6sD5RKl/6zFsJkHG6oXOcA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cUPrphX8XrH6ythrTaxL5lbvq+PqVd9zfd+/WvUfzuRo6Kc0kYeI+0Zo2coPdFPoGoH+MHhsR6JSj9c/BHdxRIdOIlQwgHBovEwsS/nj6uV0z0z34vSdUxgwcKii9LmljXSTupbX/Tm4vO4tVO0btFiAaiesI+kbcjY2faeVoko= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=kTk+oUuT; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <9f7eb287-543f-4865-90ca-b853e04ff126@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1705913361; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lRUsv1GPag3hvBW68P9fUo86vXVS9tXvByMFvo4Foag=; b=kTk+oUuTs9giJlWOdBKKx8r081rAhh+zGj7csG9qyiKpSD4wl63zcvowgcm8CtZn/Nwa7w r8Q8DGiof+Fi5lVNBXd+6LMthdA1SF4IK2fZGFojGHqmjw6y9z8xvuApt8DPH06PZstbK5 uMTQSkdtb7NYjFy628QGNQHtKh9eJKs= Date: Mon, 22 Jan 2024 16:49:07 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [Linux Kernel Bug] UBSAN: array-index-out-of-bounds in rds_cmsg_recv To: Randy Dunlap , Chenyuan Yang , santosh.shilimkar@oracle.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, "syzkaller@googlegroups.com" , Zijie Zhao References: <27319d3d-61dd-41e3-be6c-ccc08b9b3688@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Zhu Yanjun In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 在 2024/1/22 13:48, Randy Dunlap 写道: > Hi, > > > On 1/21/24 00:34, Zhu Yanjun wrote: >> 在 2024/1/19 22:29, Chenyuan Yang 写道: >>> Dear Linux Kernel Developers for Network RDS, >>> >>> We encountered "UBSAN: array-index-out-of-bounds in rds_cmsg_recv" >>> when testing the RDS with our generated specifications. The C >>> reproduce program and logs for this crash are attached. >>> >>> This crash happens when RDS receives messages by using >>> `rds_cmsg_recv`, which reads the `j+1` index of the array >>> `inc->i_rx_lat_trace` >>> (https://elixir.bootlin.com/linux/v6.7/source/net/rds/recv.c#L585). >>> The length of `inc->i_rx_lat_trace` array is 4 (defined by >>> `RDS_RX_MAX_TRACES`, >>> https://elixir.bootlin.com/linux/v6.7/source/net/rds/rds.h#L289) while >>> `j` is the value stored in another array `rs->rs_rx_trace` >>> (https://elixir.bootlin.com/linux/v6.7/source/net/rds/recv.c#L583), >>> which is sent from others and could be arbitrary value. >> >> I recommend to use the latest rds to make tests. The rds in linux kernel upstream is too old. The rds in oracle linux is newer. > > Why is the upstream kernel lagging behind? Is the RDS maintainer going > to submit patches to update mainline? When I was in Oracle and worked with RDS, I have planned to upgrade kernel rds to the latest. But after I submitted several patch series, Oracle Developing Center of China was shutdown. I can not finish the plan. But the UEK kernel in Oracle linux has the latest RDS. If you want to make tests with rds, I recommend to use UEK kernel in Oracle Linux. Or you can install UEK kernel in RedHat. IMO, this UEK kernel can also work in RedHat Linux. Zhu Yanjun > > Thanks. > >> Zhu Yanjun >> >>> >>> This crash might be exploited to read the value out-of-bound from the >>> array by setting arbitrary values for the array `rs->rs_rx_trace`. >>> >>> If you have any questions or require more information, please feel >>> free to contact us. >>> >>> Best, >>> Chenyuan >> >> >