From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f172.google.com (mail-dy1-f172.google.com [74.125.82.172]) (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 CFE38224AFA for ; Sun, 5 Apr 2026 03:28:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775359685; cv=none; b=s0MyVN12DiueiYRX7Nd80pI2m3gP21FVuLpEUPmWUNxXQHnQGDExuTSh5VG8THY76QZ31tULRkUmKPdSVbCMqbd8G/ppYGxvuyvrRdHAZPTnnzAcZWbSPcHLvxTT4aW6//Sj4KOfmoayPjwrWCcuO6A9u909Xti2YDaeD3eZ0HI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775359685; c=relaxed/simple; bh=RHuAfpAtDI8q2ZAJvwlfLapMc7KWUO9JrIAFMlF/IOE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XFH7mh1Br/3HB+tWvc2hr/dC/4hZ4QltAOmWMj0gGrqjtIIxSWjAeudJtV+gwnbr2xL61M295o3FAAL43Kd5LKIZ1JaLY+5Fpwr1MBn13Yq14zOKtsk3bzAPBpODvwUn4MmUWB7cZsDjXWGgEsz6FYfMVKiT3x7/yJMg+txFUJA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d5K0Z9KT; arc=none smtp.client-ip=74.125.82.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d5K0Z9KT" Received: by mail-dy1-f172.google.com with SMTP id 5a478bee46e88-2cc4c693d59so4324562eec.1 for ; Sat, 04 Apr 2026 20:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775359683; x=1775964483; 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=wqQ0dY5T6aoukbdxTtADqJiwNgfD3DdHEcXDDm50GnE=; b=d5K0Z9KTPKk/9Ww8SpQbuioP6upOfn6ncGYgzrQ+QmVL3nd6/hA6qvT87X+AW5JFtz RNnhL7XiR8xKaePWS22qrRGaLOCy/WAXYtzo2bSBlERwT9Oh9oftLAg9Z/VjfVlJ3jh4 0cX5CzypM/36/6DKU12lUlZgzt1BGfs6rvhuY4+U9RAb7c3/qWqoOE1fxBzlWKeoYfr+ h/zJCHfMcYsBT80VonCJ/i9AeImISCNjglXyPS+Xoj7/pXNfUxL35jm5YMXy6o5VqqZN CBk3OtjaovYUV2+gpj6VQ/RSfOlI9l6E5f2kcKg4Kluw7jeiW9irmteWFS2EEfzGFMbQ NUpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775359683; x=1775964483; 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=wqQ0dY5T6aoukbdxTtADqJiwNgfD3DdHEcXDDm50GnE=; b=U90024EzAnko+QAFOSBjtuH/XlXQMalOnhwsBF9fmKQSghWkmusksmQk/ewugytaVo /Rpv7aep7FJT4GkxrXdDsKU6tkARLpNNf3TOK+xlAjiWpCr/b4/aZvrTA29M33xvIE6F X7hy1/8G6SBjmgm8K18lSYWScUTr08rWSIlD5rJZSq+gERCeUXtKaUBZ+cPRkGv469QS ypbxSMO/uLGWzA99HhrbjrDYOO/jLCwd8NawA6GpB6eLJm6n+UtuTq12gz4LBSB5zLRq foAGqvg+e2XuG8JjzgEqzNR7Sk/pDXBNRliICDJ2FPB6A+RJD1xHpb+GfmxUa2BHYII2 QDLg== X-Forwarded-Encrypted: i=1; AJvYcCXK0ZBdZw1Ttf5CaHZlTkr5kPDp/B7mKF7wqS79lFwQywWaCYsnOv8gA90r1opPGuRFIAjCrVUVdCfzC5Q=@vger.kernel.org X-Gm-Message-State: AOJu0YwtHkWzOnsUa3KaeRsZ1VRLhLTHfBDO8tb4pDmg69kCZ8/6hLa7 3DREcA6/byY5b2MY5vvd0qg7/tGaJtofT1JDdbhU9Ik9W4Ih5/cR03nL X-Gm-Gg: AeBDietWHMeqlI6y9P4e7N/Pa+ag6X4RirIdZ688dzO9lwGYMTVy4udIKho1yqQbTWn 0grOP0pio0QI7dfa5FCVEcT9qgPq4xHiSuIu4/3jDf/wYzFAKhRW4K3ZndcUZCeCHw3vW2enqsx nuF1nnYI8JNQcVAQqBffyZ5GMmMKHymeHDsaNuB6sUHZW9Ivi4f7O3qk4rXYsY/rzQ/wa8zK02s LgHuijI0SjdMax3B01i/rnseoMWU3MH/IqZRI9tf3q+EVnbCUCTwY5JIGikw7SD5pTZkcBKrPFv Pxax8xq/Zjj+72jSopz7qGhZcHOJXwO/MBweB7FLwxqGsw7W3P47eQdqDj3cA8W0DvQ5maxs+iS Oa1xFSCdY1Dd8Nn20ctLKB83HO0YWkP0qLT18CNkHKYGuLOS38MWyImPj4jgJGLwlpMylBxB5aT BF82i25YszhHjJ+HHF6Mpim0tZTTZ4tXUFvrQJ020sQCX3a1xOD/FNAQInhIs8m5GV X-Received: by 2002:a05:7301:1688:b0:2c6:cdb3:bd5e with SMTP id 5a478bee46e88-2cbfc365473mr4057705eec.28.1775359682847; Sat, 04 Apr 2026 20:28:02 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:d488:726d:822f:a13a]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2ca7c20c151sm10108101eec.19.2026.04.04.20.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Apr 2026 20:28:01 -0700 (PDT) Date: Sat, 4 Apr 2026 20:27:58 -0700 From: Dmitry Torokhov To: Andy Shevchenko Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Hans de Goede , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Daniel Scally , Heikki Krogerus , Sakari Ailus , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, driver-core@lists.linux.dev Subject: Re: [PATCH v2 3/4] software node: verify that property data is not on stack Message-ID: References: <20260329-property-gpio-fix-v2-0-3cca5ba136d8@gmail.com> <20260329-property-gpio-fix-v2-3-3cca5ba136d8@gmail.com> 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 Tue, Mar 31, 2026 at 11:33:10AM +0300, Andy Shevchenko wrote: > On Tue, Mar 31, 2026 at 11:02:13AM +0300, Andy Shevchenko wrote: > > On Mon, Mar 30, 2026 at 02:49:52PM -0700, Dmitry Torokhov wrote: > > > On Mon, Mar 30, 2026 at 01:33:47PM +0300, Andy Shevchenko wrote: > > > > On Sun, Mar 29, 2026 at 07:27:50PM -0700, Dmitry Torokhov wrote: > > ... > > > > > > + for (prop = node->properties; prop && prop->name; prop++) { > > > > > + if (!prop->is_inline && object_is_on_stack(prop->pointer)) { > > > > > > > > I read more about this... Any code that uses vmalloc() (or potentially may > > > > switch to it from regular allocator with help of kvalloc() and similar) will > > > > fail now. While it might be no issue right now, this may become a such. So > > > > with this check in place you put a requirement that properties can only be > > > > allocated from a kernel low memory heap and not vm. > > > > > > Can you tell me more about this? As far as I can see it will actually > > > have false negatives with CONFIG_VMAP_STACK, but should be OK not > > > trigger with vmalloced memory... But I am genuinely interested to know > > > more. > > > > I dug into the history of this macro. It was added for the block and ide > > subsystems to make sure that there is no buffer supplied that may not be DMAed. > > As we know vmalloc():ed buffers may not be DMAed. In some commit messages > > it was explicitly mentioned that this macro fails on vmalloc():ed memory. > > > > Note, I haven't checked the actual behaviour by trying that on the HW. > > OTOH, the check itself covers only 16kB of memory range. I don't understand > how it can give true for anything outside that area... > You probably mean b4a0f533e597 ("dma-api: Teach the "DMA-from-stack" check about vmapped stacks") but it says that for vmapped stacks object_is_on_stack() will produce false negative (which is tolerable here). I am not sure why object_is_on_stack() was not extended to also handle this. From the cursory glance it looks like a lot of callsites do not detect vmapped stacks... Let's add Andy Lutomirski... Thanks. -- Dmitry