From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 EDF6D283C82 for ; Sat, 18 Jul 2026 17:21:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784395292; cv=none; b=EjlJ63fJYwYv7i1wDaZhPg/RUwpYKmBhpdznl1NnYS8tVEq1Fmofwgcg6IpIHfUY8+UzcN784tiBXTiZ9fmbAVg/4K6lU/G23Oma1xZZijyDnQPRkznxn0yZvOUel4ytr5yd53yoG3kg976j2CudN1c71EbDmTTgTuzhgS428oI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784395292; c=relaxed/simple; bh=RPyyj2ZwL934neIFjFiEega1Hsw3vi8T+eaL8Ksji5s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=laIR37I47YyHSUK87oNgPhTOgcDRnM4D5EzVJqbKd8cyYxkP8rb/xVE7A9XyfY5khp7y2ywSHDrtJng4rS/D/Aj9V8+JIkIjn2KwbFeolExdAK8Rrt9PMRo0qXsrcyudI7OzQdfS9ejzMv3xN/XPQvPxwkl0oTZsb/7sFBq/r1U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=UHVq2md/; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=q465eYLH; arc=none smtp.client-ip=170.10.129.124 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) header.d=redhat.com header.i=@redhat.com header.b="UHVq2md/"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="q465eYLH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784395287; 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=PhTRQ5Df2kHb9ziDbG6P62pb0TyzB0oRg1TJubTYfds=; b=UHVq2md/YWjvGdAxwG58S4aBc4vq81UiQPuHJJhIwEpFDPy3ZrhXxmmVvidYrDJxl+YJAl hC2RB5bzN5DnyE/aouBIN7SsY44N4kuQib/g/OvBc8UhuN2MNhs8Ma1Z0gqIn41wgqvEjG +lOMJXAhecly2+RJmBGLi/hfg05mmC8= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-197-XWu_EB3MMSuPaArWL690_w-1; Sat, 18 Jul 2026 13:21:26 -0400 X-MC-Unique: XWu_EB3MMSuPaArWL690_w-1 X-Mimecast-MFC-AGG-ID: XWu_EB3MMSuPaArWL690_w_1784395285 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-473e18559b2so3314061f8f.0 for ; Sat, 18 Jul 2026 10:21:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784395285; x=1785000085; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=PhTRQ5Df2kHb9ziDbG6P62pb0TyzB0oRg1TJubTYfds=; b=q465eYLH1RvoUuN9DgY+l8WOByEJ5itUC7i+6+FCrZhFCbWf+UTQbyZRzD8FAfnKUv CRJKnPdfMa2BMMnRNZ+hNq+FG2iuiAyaoGa7wX/ZuhjKHivW6ksLjvR+uEdSlHCVdS80 GK1sDCOMz2XGrwdTNzjf2eRVuSEB3oEjpyGAIBzBkc9d6+2AFkKyjwl/olVXIxiYFXt7 7G0MzJZRdgoK0qNeXpGa9yLH0VYk0hfhZnnDcYUXZe6URKmwyZ+hFa55bSbId0vdQdVi eX59aCzChHi32lDPyxjOhOh74fe3FfgXN5szgx7X16Wbfofid286G4ZsIIzboqgJMF20 lAig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784395285; x=1785000085; h=in-reply-to:content-transfer-encoding:content-disposition :content-type: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:content-type; bh=PhTRQ5Df2kHb9ziDbG6P62pb0TyzB0oRg1TJubTYfds=; b=lX0bmnH+JP3zgtlDKLZmhoGV+Iks77CRWgGtEY7ItUyvN/lTIS7MhRTD5Oox14W3+I +GL5In5i+N3eYbAkBbdl1aNIpZfb6gmF1xXLOk97AViVplneqOwTz5mr9CKyabjAfCoc n+uGW+PHbVgvb7ntHFPQ72r+KLn5BsM0R2X0oNT+ZHJs9KkCAYPXHwHBXpptT4TY/AHw u/o7Fqo7WPGfkJjsuq8PLYUjHNwDb2TX6djh+kHrFTHIRAZdGVY4M3rJ0OArEB3uLrsj V8yfX9ozglwicVtI0IMl8uYnyl7riyoozrpft3oNewmmQM4iRNFzCRnUALud2pLplPSc kkWg== X-Forwarded-Encrypted: i=1; AHgh+RqqtNRVMNOWNgmC0M7hRfUbH+mnaVClTpvTu3uI2I4RcWiXa3jEQpb24rxMDpFHGShlPWVkoWiWpcHTRJA=@vger.kernel.org X-Gm-Message-State: AOJu0YzrF7Yf3IQCaeNTVITHj+iqYmKGuUvM9W4B+jWWITqdEMBFOml0 kNg4kGtS8vXEUvbnnJ1yK104VCryZNdJjQY8s2dZuA0OVM0z1ENjOAIzVBSBRmJh+nX/jb8ZM2M kOelJSymIWkXz8vBw86satz6UXE9iUoX7WQatpfUseUg0f6VpdD22g/cvTVEZ0CNIFFEEPegp1A == X-Gm-Gg: AfdE7cnqAMd5F7x0X5dzH3UWTNuRf5QfA+8OULgxtbjhi08tajJu7a+QgiqRUpz3mAq szSeZl3gx92CBOKbSbXef0Bz/k8E00OvaUBExjggWNQcv/ObL+kurjaRHdgllJDIvYFoPFCNhBF 1tliWPPRIGQsbnCrrnzCkklxHuSUL+BjwT5UuX1LckwASkf7nu6hOPMgHwKk3rqbOVf6qoV7auX edVx4c4dB7yz2EkGG46LZX0vi75rkb31kBoQHUxBKrGpPUMdf9Q+UjG33i/O2GSAAeLFSK7IGFD RUv8Kjdd1XSJ9Hv3xvO4ECUaBUbTMBcc3CQCefk3WAckouG21lSrmkVEzyfKf2HfRliL8xvxMfD eKD6vCO5hywGFwIpWvfpooreZqHzDVEI= X-Received: by 2002:a05:600c:1f94:b0:495:3da3:beb with SMTP id 5b1f17b1804b1-4954a3dc491mr80087765e9.10.1784395284899; Sat, 18 Jul 2026 10:21:24 -0700 (PDT) X-Received: by 2002:a05:600c:1f94:b0:495:3da3:beb with SMTP id 5b1f17b1804b1-4954a3dc491mr80087355e9.10.1784395284397; Sat, 18 Jul 2026 10:21:24 -0700 (PDT) Received: from redhat.com (bzq-79-177-145-168.red.bezeqint.net. [79.177.145.168]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f63ec7f55sm12590903f8f.18.2026.07.18.10.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jul 2026 10:21:23 -0700 (PDT) Date: Sat, 18 Jul 2026 13:21:20 -0400 From: "Michael S. Tsirkin" To: Carlos Bilbao Cc: Greg Kroah-Hartman , "David Hildenbrand (Arm)" , Hari Mishal , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, elena.reshetova@intel.com, huster@cs.uni-goettingen.de, mhollick@seemoo.de, jiska.classen@hpi.de Subject: Re: [PATCH v2 1/4] virtio-mem: validate device-reported block size Message-ID: <20260718131715-mutt-send-email-mst@kernel.org> References: <20260717060822-mutt-send-email-mst@kernel.org> <2026071757-grout-composer-165d@gregkh> <20260717061901-mutt-send-email-mst@kernel.org> <2026071724-asleep-pedigree-ea54@gregkh> <20260717065219-mutt-send-email-mst@kernel.org> <2026071759-thermal-synopsis-7568@gregkh> <20260717085838-mutt-send-email-mst@kernel.org> <1fe328d1-edf9-4e72-a145-be74ede20e60@gmail.com> <2026071803-passage-dares-8240@gregkh> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat, Jul 18, 2026 at 10:07:30AM -0700, Carlos Bilbao wrote: > On 7/17/26 22:29, Greg Kroah-Hartman wrote: > > > On Fri, Jul 17, 2026 at 08:31:09PM -0700, Carlos Bilbao wrote: > > > Historically, one of the biggest criticisms of coco, especially around > > > device hardening, was that there were too many values that a > > > malicious/buggy device could misreport, making it a losing battle. That is > > > no longer the case with LLMs, and we have the advantage (and challenge) of > > > open-source dev, which allows us to receive many of these fixes "for free". > > > If others want to burn their tokens, let them :) > > I have lots of tokens to burn :) > > > > So along those lines, any suggestions on how best to fuzz these code > > paths? Any workloads you all use for testing that I can take advantage > > of? > > > We've the virtio-mem config struct layout and the kernel source, so for > obvious fixes like a NULL check, static analysis is better than fuzzing. > Claude took a few mins to find me two examples: > > Patch 1: virtio-mem: reject non-power-of-two device_block_size > This one is for virtio_mem_init() to check if > !is_power_of_2(vm->device_block_size) > > Patch 2: virto-mem: validate region_size and usable_region_size > THis one checks region_size != 0 and vm->usable_reion_size > > vm->region_size. > > An endless factory of "silly" checks like these are low hanging fruit. At the same time, these checks don't actually help within the coco threat model, do they? > Now, for harder bugs, looking around for fuzz options, VirtFuzz [1] looks > like a great candidate for those interested in pursuing this direction. > > > Their PoC fuzzes wireless/Bluetooth stack, but nothing our AI overlords > can't quickly adapt for virtio-mem and other virtio drivers; the JSON > definition to describe device behavior is easily extensible. Their threat > model [2] describes an external attacker, but in the context of coco, the > virtio device itself is the attacker. What we need, however, is to exclude DoS attacks - these are outside the threat model. If people try to address all DoS attacks uncritically we just get a churn of changes which just might introduce issues of their own. Example: BUG_ON(!is_power_of_2(....)); panics, non exploitable. if(!is_power_of_2(....)) goto error; can become exploitable if the cleanup is done wrong. > Here's a vibe coded PR of what I mean: > > https://github.com/seemoo-lab/VirtFuzz/pull/7 > > CCed the creators/authors, thanks for open sourcing this! > > Thanks, > Carlos > > [1] https://github.com/seemoo-lab/VirtFuzz > > On 7/17/26 22:29, Greg Kroah-Hartman wrote: > > > On Fri, Jul 17, 2026 at 08:31:09PM -0700, Carlos Bilbao wrote: > > > Historically, one of the biggest criticisms of coco, especially around > > > device hardening, was that there were too many values that a > > > malicious/buggy device could misreport, making it a losing battle. That is > > > no longer the case with LLMs, and we have the advantage (and challenge) of > > > open-source dev, which allows us to receive many of these fixes "for free". > > > If others want to burn their tokens, let them :) > > I have lots of tokens to burn :) > > > > So along those lines, any suggestions on how best to fuzz these code > > paths? Any workloads you all use for testing that I can take advantage > > of? > > > We've the virto-mem config struct layout and the kernel source, so for > obvious fixes like a NULL check, static analysis is better than fuzzing. > Claude took a few mins to find me two examples: > > Patch 1: virtio-mem: reject non-power-of-two device_block_size > This one is for virtio_mem_init() to check if > !is_power_of_2(vm->device_block_size) > > Patch 2: virto-mem: validate region_size and usable_region_size > THis one checks region_size != 0 and vm->usable_reion_size > > vm->region_size. > > An endless factory of "silly" checks like these are low hanging fruit. > > Now, for harder bugs, looking around for fuzz options, VirtFuzz [1] looks > like a great candidate for those interested in pursuing this direction. > > > Their PoC fuzzes wireless/Bluetooth stack, but nothing our AI overlords > can't quickly adapt for virtio-mem and other virtio drivers; the JSON > definition to describe device behavior is easily extensible. Their threat > model [2] describes an external attacker, but in the context of coco, the > virtio device itself is the attacker. Here's a vibe coded PR of what I mean: > > https://github.com/seemoo-lab/VirtFuzz/pull/7 > > CCed the creators/authors, thanks for open sourcing this! > > Thanks, > Carlos > > [1] https://github.com/seemoo-lab/VirtFuzz > [2] https://www.computer.org/csdl/proceedings-article/sp/2024/313000a024/1RjEa0y9RMQ > > > > thanks, > > > > greg k-h > > [2] https://www.computer.org/csdl/proceedings-article/sp/2024/313000a024/1RjEa0y9RMQ > > > > > > thanks, > > > > greg k-h