Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1958138rdb; Sun, 21 Jan 2024 00:35:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzFXrlghhCqeN23D1+YSbnKq0WTN4QS1CdLfKiIpcbqoTQ9FDn16DmcGx8T1qxeyWq2wzN X-Received: by 2002:a05:6a20:769d:b0:19b:1eee:23f with SMTP id k29-20020a056a20769d00b0019b1eee023fmr791865pzf.26.1705826141029; Sun, 21 Jan 2024 00:35:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705826141; cv=pass; d=google.com; s=arc-20160816; b=RgEZp/hNYQmWd5iODspmjJXZFyfTFo3c/4C8K3BHB+cCWcr3YrPP0tUBQK9kW/hZNS u1lu/iPBx5ipZugmiUmN2WExczGsxAQGoVYkJFeqaSaOZvk9XBwH2oY+U755e7cIaEXs cuWtzdNi8FzY54DdGeGhqEOBpQ1DULjGCxjjuxRRCilBGM7at+8SQJHgoQ7H1YmHSNCj asVAc5tRYVFlLni2g+cE6SOIPg8j0tzdSOPH5xrrCCjGxPV1wKPkjuWT2Eph7DRDGdup Oi+Zzja0xoZkhEbaVYWmu/rl9yRdokChSW0Nr0oqhKSxf46b1hHjDGIKJ88eEq23Ln2+ laNA== 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=C+nKUquRVnsiH6ByWnfEanFY19iANj8L7VwJgB+g6PQ=; fh=Ou3tCf+HFvV11cNL/EVZa5xKw5UAtV+Yp6sKldV6Pe4=; b=VMgSXgohTrNUXzd0DfR6qYRy89nA5IyyDaWIvuS7FXBLna8CMb2DxuvtXf6Qe9fYPx eBYJxp5kqwrx1MEsPJ53HaA3bipp1MoSF/4x23LHjKoN9L04C/PlkSW8z8t7AXLIv14p HRSdpB3DB7M5nzc3JRscXhYvM5kD6q8AdKTKPcyj61azXRLtg2akjsrxWwW4+xfs774O SppShr7+HSsGU8Jo0PayAdaxZTY83RmDnMNEFDEzCpI06gG1oV92at9lBhZGT1W1LmAv 1xcUvp6X06Wyimh3RuQpbpbwQdLxyx61OyumDoS34XtN8k/5wwvB4JOAxMBoy2yFct5x IElg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ID4niUS6; 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-31986-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31986-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q8-20020a170902788800b001d701415821si6304732pll.352.2024.01.21.00.35.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 00:35:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31986-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ID4niUS6; 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-31986-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31986-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 288F0B23A0E for ; Sun, 21 Jan 2024 08:35:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A57DB22086; Sun, 21 Jan 2024 08:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ID4niUS6" Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 0B590101FA for ; Sun, 21 Jan 2024 08:35:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705826125; cv=none; b=Vfv89iag+PQgyXji8f7vXtIcAJczzrcQsvKkVBmRCVFvZNb5EhX7M/Zpmm4u4dB+gtL+wMNW3f1y70Fr/MemhK5b59IFD7romo3vfBHodkfMrxc14c+kuKUc+10WrOXtQcS+yMUHj3nulGQibCrpSidB4nVbIWfA0khk1QYyPoQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705826125; c=relaxed/simple; bh=E1j4lbGFKciuXk1Yg1UrA3T+hieubxNYeula/VLi/l4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EzlOKENIM9bBKwB7N1Wc57HdGAqPclTIjhGEpgXNpsRgPWB2U7sCfj1uz4s08GCI3ZjWRazltLe0+MX/npbyAE+yKHVoemCC8kUBrsHjsab7v+o1ABL80ccs0/TI7kDzSDZDPl2akNuisSheONxpC4TXFj6hQpXSKy3S9y88EjA= 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=ID4niUS6; arc=none smtp.client-ip=95.215.58.189 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: <27319d3d-61dd-41e3-be6c-ccc08b9b3688@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1705826119; 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=C+nKUquRVnsiH6ByWnfEanFY19iANj8L7VwJgB+g6PQ=; b=ID4niUS6btI4yknwMoJD2+kTFdn7M75cHav8CR/B+ezHxDwlWG4Pzvu8SUvG/lvDekjZN9 v1QDEEgSL2mZApw6FtqFgNKAWIf7pdnrafm3xvkoHswrxrbQJRnPi6fDt62Qq5XbQlyvXk q0lkR9tyN1Vb61M3GOZiVrCrATcjaFk= Date: Sun, 21 Jan 2024 16:34:58 +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: 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: 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/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. 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