Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp585715rdb; Thu, 1 Feb 2024 19:02:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBBqI752TccPDMg5+GbxVK8zSbygkJY/E42Ru0AYAB8awcUhAW20iVtMiGqX2e8Bf9Ypdy X-Received: by 2002:a05:6870:6ec7:b0:219:ec5:9bd8 with SMTP id qv7-20020a0568706ec700b002190ec59bd8mr716561oab.35.1706842945918; Thu, 01 Feb 2024 19:02:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706842945; cv=pass; d=google.com; s=arc-20160816; b=UxIYQ/JBIDKVqoV8/q1l++thMmZRpRkRVhRB8WDFTHL4xQR9ZIugQe7Tp6eCtDXenc UfaarzkMdjazYWm/bm+D+nW+jAAmTLGHYVQLkQ+fK0dhf/hbvW0m6Aea+Y6tc5aVSTzv Tb7oyjoJ04SroDUfX1uV6JiGgY8f+S4/cUgG8SNY8bxdkOsPsyejTGNffZABVhO1pRxY NQtGZkSZJFbFVe9BRGAvDElWxbDOqhltmKNhPB1AiO48522dQH78KmMb39xAk4+9Jf/I loFN5N9ZSZmMrUhGnCmXzgfdaTVmLnnsv17qI2bXjx7GJnMgk0e/alIW5WV04tfLPvqp awPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=z13JQPf9sQwxso1j5bT0m3SolbFlWDJreVTqe//zgDY=; fh=x6Gu0hqQ2BjZqA9ffX+GryWY7mxJ9LtHitkXpwW9gMk=; b=j9Eg1agTwwQfyZSLceuSH4Hfo8J/GQ6aWXRhTUb6ycpsklPAAyIEwMcB8ji5Y9VMu9 9Bei0O4i+8VSdaNV+ANDa7w4sInVuaFxsMjIPitJiPelbVztrlPgdkXQikUbH31Q4mig sLjZrQME5kyBT/zrKg5aN+FHm9GsktlFhlBH5aP38lKslRM0+Efb2v/ouomVNK5uPhri UBfuhPh07hhrZm+Ip+ETHcg9D3/tQCUlycOnCbhv8nJdldCXp45pvYOghI3jkO7fVKlA JgbaySh6SWx1kXgI+mq9zcSo+l6ESCDqDD75edmavtQfFzfrXOatcZAu1HEdsXr1fT6/ qEqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XNksMmYm; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-49120-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49120-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=1; AJvYcCUlzOvKccg2tq5KSqp1RyE5m5cQaQL3nKUDtTS0NadVmsZ2hhq6HQ5HsfmbsjvhUQeggSACFHEaVcFcHl7isDrpfBt6ZgkV9IetYLNc9A== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y35-20020a634b23000000b005897813624fsi779678pga.476.2024.02.01.19.02.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 19:02:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49120-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XNksMmYm; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-49120-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49120-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DACFE28E67E for ; Fri, 2 Feb 2024 02:55:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54065C2D7; Fri, 2 Feb 2024 02:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="XNksMmYm" Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 BCDFA12FB30 for ; Fri, 2 Feb 2024 02:55:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706842514; cv=none; b=sn6gYmOAEVGuC8kG46MCplJCAOBBDC7UdIMgWFktdn5t0bdYx6waC6dj+j8mv053sjxW8dS2Gxj03vlk+bWcjGzbo61VPLsKs1ySBTM0ZVYlOqmFTpAAcgOs8zRQaK76Izt0U2cMcQMLJGbNCWJjjYr7AXpswWYF16mSjd8N8nc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706842514; c=relaxed/simple; bh=jX8V4J6he01iMdXztscH3gL+ZiT2xGSlH7VO2b3YRA4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=r9QREwsismB2K6S5xUuVnUCWiraSyO0MSDKKXOuJmHikQGU44rzq7FRiR28udMH+m5ZG8ywqTkwbbTs/6hddWSvVrDCJjbqDwmsn0lwEJwFAvRTFiDj5c2CBbEi+p9B7LNI0jSiiOcyAFqcnpT5sGFVCetm8NEkUjvJ0QUX2HlQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=XNksMmYm; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-55f15762840so1960826a12.0 for ; Thu, 01 Feb 2024 18:55:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706842510; x=1707447310; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=z13JQPf9sQwxso1j5bT0m3SolbFlWDJreVTqe//zgDY=; b=XNksMmYmERlcareKCqGrL/t2gqbdt7572KXZvtbZJ6mZH3KpDzekHrk5pzSyfEPKh6 xfiL8FUcE8qeyHP+WWKUKDYkaatphnSrDFgE64fFCQwsJoCwC0qfI8gJjf+Z0lmg8bQo 0bnkNUxnZxnJySHWWL7iYlnrzxWKjWTyWEgxc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706842510; x=1707447310; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z13JQPf9sQwxso1j5bT0m3SolbFlWDJreVTqe//zgDY=; b=RoW8DanlB/99zNLM82h9UAiFwCHDxDIfLVMC5R2ppUyPO/B/KPlbBnaQOvMuwdeosL 2gir/0m391s7/hkJwTYdS8AS7kQGYfM8EykxfXHJJFlUElpBF/Frg3ytde30kE7w5JSm ByPYoaSbXW/hiJBT6U54z6eihHLB0bRDKkR998FUtZ3vEGweK62KUIbr/oWK0smJqlP4 IfpUVNCCuZ9mqsDUSanwwnh01WPx5TJ7emFrfy2+pO6z9O+1UGcdFFe6IRQlXyzi6Sny b5EF42iS6q4GyhJsVmC6peZb0t2C58qx57tt5YuSuxDV4V+cuqvK6dWp3z29qmwy5vCa 9HgA== X-Gm-Message-State: AOJu0YxKwD1KuPUmNwTqV0stcji0NhVQ9+XtABR1Q1ARA+UJk+Kssp4t MKGzcVBJJhiZj6j5AxUTtFZ+WFYMRVMuerV2GXmdMZGVYFF7XHbX3h/dowo/jP3Y74jX1bTocg8 bpA== X-Received: by 2002:a17:906:cf85:b0:a36:7b45:1304 with SMTP id um5-20020a170906cf8500b00a367b451304mr4242521ejb.77.1706842509456; Thu, 01 Feb 2024 18:55:09 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXUwAvs1N6c7DCS0yTTqT0ETXsBx2042XF3eTanB2IGM1nxQ9Nw6sRi9onPFhUyH6UB/KexGon2BEekfEhJsB5X2Y47fFwh+o/DuMtH Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com. [209.85.128.46]) by smtp.gmail.com with ESMTPSA id vv9-20020a170907a68900b00a35ec7eddfesm382025ejc.50.2024.02.01.18.55.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Feb 2024 18:55:08 -0800 (PST) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40f00adacfeso15715e9.1 for ; Thu, 01 Feb 2024 18:55:08 -0800 (PST) X-Received: by 2002:a05:600c:500c:b0:40f:c537:9d5 with SMTP id n12-20020a05600c500c00b0040fc53709d5mr30164wmr.5.1706842508094; Thu, 01 Feb 2024 18:55:08 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240201171159.1.Id9ad163b60d21c9e56c2d686b0cc9083a8ba7924@changeid> <20240202012249.GU2087318@ZenIV> In-Reply-To: <20240202012249.GU2087318@ZenIV> From: Doug Anderson Date: Thu, 1 Feb 2024 18:54:51 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] regset: use vmalloc() for regset_get_alloc() To: Al Viro Cc: Christian Brauner , Eric Biederman , Jan Kara , Kees Cook , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Thu, Feb 1, 2024 at 5:22=E2=80=AFPM Al Viro wr= ote: > > On Thu, Feb 01, 2024 at 05:12:03PM -0800, Douglas Anderson wrote: > > While browsing through ChromeOS crash reports, I found one with an > > allocation failure that looked like this: > > > An order 7 allocation is (1 << 7) contiguous pages, or 512K. It's not > > a surprise that this allocation failed on a system that's been running > > for a while. > > > if (size > regset->n * regset->size) > > size =3D regset->n * regset->size; > > if (!p) { > > - to_free =3D p =3D kzalloc(size, GFP_KERNEL); > > + to_free =3D p =3D vmalloc(size); > > What the hell? Which regset could have lead to that? > It would need to have the total size of register in excess of > 256K. Seriously, which regset is that about? Note that we > have just made sure that size is not greater than that product. > size is unsigned int, so it's not as if a negative value passed > to function could get through that test only to be interpreted > as large positive later... > > Details, please. I can continue to dig more, but it is easy for me to reproduce this. On the stack is elf_core_dump() and it seems like we're getting a core dump of the chrome process. So I just arbitrarily look for the chrome GPU process: $ ps aux | grep gpu-process chronos 2075 3.0 1.1 34075552 95372 ? S