Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp966658pxj; Wed, 2 Jun 2021 16:39:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwSkObPtidMw7nH1aL+Ad+lOu246H1LGID8pOFI5eVtkcs36wGszUjCI1cKAbjGwQyXD5y X-Received: by 2002:aa7:c0cb:: with SMTP id j11mr21248511edp.177.1622677159327; Wed, 02 Jun 2021 16:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622677159; cv=none; d=google.com; s=arc-20160816; b=uH8WHDNa7Y82lxbSVzape7/eJsNpYWvRyspMRMe1QYcZUOdlsqkl5eBHzUJ3hSMv9N +XYX+21ZVobqGahxDvEb3TX6TQ4+RRIZA9F3mtu1EGeA63A/nSPM1ZLQbRy8i8g0e2dn /HK12Na893ZI0hcL2tUsNcLt4ZlrGnm7T7F5EW7wkf7+IsWPVQdkSeohER0s98MtcGiR TFQEUMP2rYM9SWD7kG/4FJ0QUl0kt4S//zfTSiUayRAWXlyl1bYvvwT48FEIo4i8X2RU W5n592osAuKlvX/Mz5HdlzcC2PdFn7z6oLSQKu64F/GXsd6/kNWWnJsEAm2IWkTmQ294 LfLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=rJY8gI86dN6SxBNUHW9Q60rIJvaElqGD6EGXhx/y0ME=; b=m0NPK/YhvO+7b+9ugbIRnviruq+QGphJ7HjcIYzSmJYHtZQx6p3ZZgY76gHB0pjG1W 9ND4xS8yoTNJ2MeDnTX+0CFON3DCWRF1eqkZLluuf6Nu6hUe7A1MZv3A2ORvI7SukKtg e3woI0Bk6E+bL49V7PDRSF9i2bPOijWE7enqtIgZXp8Vl8Xf/aosWR05mRoYdOmViq3k S+jaibUGeiY/abO7aH4YBhYipBaN71c3n36is5cR7VSvEjBFU94WOAsyN9OHbahICCs7 GO8uDgVo/NwtJ2kIn07wrYubh0pMTDu2FzdZYDIonaUfrfCldZ3z0QR96EwQV+UgpJyX 1FNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb19si985941ejc.713.2021.06.02.16.38.56; Wed, 02 Jun 2021 16:39:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbhFBXhD (ORCPT + 99 others); Wed, 2 Jun 2021 19:37:03 -0400 Received: from mga07.intel.com ([134.134.136.100]:40062 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhFBXhC (ORCPT ); Wed, 2 Jun 2021 19:37:02 -0400 IronPort-SDR: h01bxdGvwnoLZQYpZwaQI+30ZfgIYm+pcesEGExnLesCDWzwNnfxu8l5lM0SsuRpeQk8Cbggtw mek2cbBfQ8lw== X-IronPort-AV: E=McAfee;i="6200,9189,10003"; a="267793181" X-IronPort-AV: E=Sophos;i="5.83,244,1616482800"; d="scan'208";a="267793181" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 16:35:13 -0700 IronPort-SDR: TY/3vp8j2UJAdB+5YHVpmtbplCRFpT9ECukUksTHe7HIVNb0KByfUn5AzkdN7szhcXLi6SLtGF AYD72W8cOiGw== X-IronPort-AV: E=Sophos;i="5.83,244,1616482800"; d="scan'208";a="550480767" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.209.87.193]) ([10.209.87.193]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 16:35:12 -0700 Subject: Re: [syzbot] KASAN: stack-out-of-bounds Read in profile_pc To: Josh Poimboeuf , syzbot Cc: bp@alien8.de, hpa@zytor.com, inglorion@google.com, linux-kernel@vger.kernel.org, mingo@redhat.com, syzkaller-bugs@googlegroups.com, tglx@linutronix.de, x86@kernel.org, Peter Zijlstra , Andy Lutomirski References: <00000000000030293b05c39afd6f@google.com> <20210602230054.vyqama2q3koc4bpo@treble> From: Andi Kleen Message-ID: <527ad07e-eec2-a211-03e7-afafe5196100@linux.intel.com> Date: Wed, 2 Jun 2021 16:35:11 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210602230054.vyqama2q3koc4bpo@treble> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > profile_pc() assumes the return address is either directly at regs->sp, > or one word adjacent to it due to saved flags, both of which are just > completely wrong. This code has probably never worked with ORC, and > nobody noticed apparently. I presume it used to work because the lock functions were really simple, but that's not true anymore. > > We could just use ORC to unwind to the next frame. Though, isn't > /proc/profile redundant, compared to all the more sophisticated options > nowadays? Is there still a distinct use case for it or can we just > remove it? It's still needed for some special cases. For example there is no other viable way to profile early boot without a VM I would just drop the hack to unwind, at least for the early boot profile use case locking profiling is usually not needed. -Andi