From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 C4F3421ADA4 for ; Mon, 13 Apr 2026 13:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776087967; cv=none; b=uHND9YTVpgzQSTlV+LLxUWrJ2In9Db0lfN5xHgnPdf6vbQ4AWVInLSTOaRlW2A8G0oQqq6IWBwNKQU1PKeAeMFwj8WawNoxhth0ntQqHxuq3pj8bT+R/huAGuKIEQqsCRXg5p23Rs3hwUWcjIDLSr7j6XiiOBJa8M1rQ2XlHT88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776087967; c=relaxed/simple; bh=SKDyDeGLAKxeIgYcE/qZKnwcFXAE4s0elS0LgRHfpcQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MAhaummM0LJicjZHd18PHSf16TT1bOvU55hQgrhUyUKsKpp+c/BbEvGfpIfxYz+6swfbV0qYpvR3IXIB0hbviepQ8S2IobPWssZCoGBQCrDZHncxmlNitt5eUbC10wyeZDZz5yN7tRqqpsqvyBus9n8l2RcbK7RDClBTHe/0EbA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=f/TW0Bx+; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="f/TW0Bx+" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-8d583bfc415so697311085a.2 for ; Mon, 13 Apr 2026 06:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1776087965; x=1776692765; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Rx2nTgwnCEnXXRiMkiTBuROyOk5YN+wYsn+Y4QhOS7Y=; b=f/TW0Bx+rkGxH3UsA8E8/yvYJXo+e0k96pGH27Kt2SzqKf6T+nL4Zh+vFD4AiWtT8A sSJZuatZcfRBCeCj7EBvfmzK8wz39zWeKAFRTFSjfBgOfy1KryEVXM6nkISDEHp++ptv SoZXa3h7R34NjuxEg2pAgTxLsNf7AzCKaczdupu7DjkVL+fjzYibfq1zj84FXowKcMhT 5HtmadyhT2RQRLY+Wqw2aIYZITHXZPmLh6kifzaPvj9LR+GVCP79SecqNOUWH2mcr1uW MQ1XHuji/D+g/xO60/IOosD1sWEG0t5WuDCks0FgliUuIboUEFYMMhKznhhtRb89AJ1H dwBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776087965; x=1776692765; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rx2nTgwnCEnXXRiMkiTBuROyOk5YN+wYsn+Y4QhOS7Y=; b=mKgcbV9wYXqnd2V3qG0EFCxiaCuAbRbRiWMSybercmGBbQCdAZz8Z8IKUkiiiTNzVt uccFxweGJsLLYu1iP5Jdr7jYDaQMOIPqwT5+PL8U14npZYXaio2wv4wU49rz4j62I41Q aWGzFeofYFQLneCm7dMx0KLptfuJe2FGPw3iRwe3vehkt93Aau/bxg2iSHMwHogMPfOy XkJYGRNhO3ddRTto08UJ92qm09o2GnkUGO+/8PltEXr+oUaqXQdDYnnegoKQxpwVrlOk VV6qSZqy0FHIHYmxYCv8CEGenAcths50H9XBgzhAdu/lIFn/9m3R0l1jnITv2cFbOTuq WpMw== X-Forwarded-Encrypted: i=1; AFNElJ9wb4Evj7a+Fi/ShfRR1ijjGOUNP5tNRniRJfjjzHQRCkvYKuDit5yKpA2c8ZHCSxuh3kXeQM/IYTDTYB4=@vger.kernel.org X-Gm-Message-State: AOJu0YwcarAeQt16l5ynxSC1KMTHCkgNBpB7kJp3eR7/J2MVOi5FxNV7 qBrQT1SnuFRSpgBaDhbnaYVa11YrzU+Ov9Xr8UghX69b8sRc+kpWGVu/jcSkPudpBtc= X-Gm-Gg: AeBDiev80+lz+P0PWcHDVCVmX6ArdPswj7n5PZSCf/QQf2dKt74stq95ULtc5F9t+Rt Wp+lqUJqCIcxzB9j6FaOyFP2XIDZ2gGqnAiC0HdrR313CtNBJ/UtzhpXn/Hi2spmTFyZrc0sulM uMkfOqFj0/RY5AhVCXrRFo2pVRI+PjvGfGG4ChftWSqosDOLWRMSMHUUEGJRllYEc3dIEeQfZRo GR01RP/1URE2M+Z/d+/AzMs7jRej8RxhuG/zTJKoXH0kt2d9UcBpI1Y76re4VGKHNk7PEGziBb3 7lMp6WI3zz68owQjnpoewsoqq7lg7xvKkEwYr27/DbjYB1frkmwpfOm9itE+wiqyqXjCKg+b+Ep OdGUgQws+E55tVheos1iXje3AqgxTgwNpqTHrr6qtEiTCFq4LD7ZdRYbXSaMAmlTqlv5yRTKkWw P9krCcTGOGXjtnPIQcwx0J5n+7xqpzjz80YE+lMitWqPZQYFd6fynXADLbmMC8fGIM1eCVc1N0A H5t9g== X-Received: by 2002:a05:620a:31a8:b0:8cd:b33a:a4da with SMTP id af79cd13be357-8ddd00a8a98mr1835861985a.55.1776087964542; Mon, 13 Apr 2026 06:46:04 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8e07730d836sm381231385a.3.2026.04.13.06.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2026 06:46:03 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wCHc2-00000005BFb-48oy; Mon, 13 Apr 2026 10:46:02 -0300 Date: Mon, 13 Apr 2026 10:46:02 -0300 From: Jason Gunthorpe To: Long Li Cc: Leon Romanovsky , Erni Sri Satya Vennela , Konstantin Taranov , "linux-rdma@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [EXTERNAL] Re: [PATCH rdma-next v2] RDMA/mana_ib: hardening: Clamp adapter capability values from MANA_IB_GET_ADAPTER_CAP Message-ID: <20260413134602.GL3694781@ziepe.ca> References: <20260312181642.989735-1-ernis@linux.microsoft.com> <20260316194929.GI61385@unreal> <20260317094408.GR61385@unreal> <20260410154327.GA2551565@ziepe.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Apr 10, 2026 at 10:29:45PM +0000, Long Li wrote: > > On Sat, Mar 21, 2026 at 12:56:39AM +0000, Long Li wrote: > > > > > How we rephrase this in this way: the driver should not corrupt or > > > overflow other parts of the kernel if its device is misbehaving (or > > > has a bug). > > > > If we are going to do this CC hardening stuff I think I want to see a more > > comphrensive approach, like if we detect an attack then the kernel instantly > > crashes or something. Or at least an approach in general agreed to by the CC and > > kernel community. > > > > Igoring the issue and continuing seems just wrong. > > > > This sprinkling of random checks in this series doesn't feel comprehensive or > > cohesive to me. > > > > Jason > > Can we follow the virtio BAD_RING()/vq->broken pattern in > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/virtio/virtio_ring.c#n57. > > Add a broken flag to mana_ib_dev. When any hardware response > contains out-of-range values, mark the device broken and fail the > operation - during probe this prevents device registration entirely, > at runtime all subsequent operations return -EIO. If that's the plan I would think it should be struct device based, but yeah, I'm more comfortable with this sort of direction as a CC hardening plan. Jason