Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3496451pxb; Mon, 4 Apr 2022 18:51:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg/yEmGycL/CGMs8q6bP8SchI/+eEzsBBnmZrMNMz7ycZUsm9ZkbJ0kbTFmHotKU12lFCF X-Received: by 2002:a63:e502:0:b0:399:40fd:1ca7 with SMTP id r2-20020a63e502000000b0039940fd1ca7mr928830pgh.452.1649123490327; Mon, 04 Apr 2022 18:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649123490; cv=none; d=google.com; s=arc-20160816; b=hjLjAwdrYypEStBxZk4UmY5SXGM6LPQrAVicTyhtbOwLIbL91XIPpgRBxXV55nbKw6 OHUzcfZUT3uSvcimcFh1QZKt6+7FYglS414z3hA4Pa6G0lbUVuJ4LSV/S+FBW1Od0VMF Gma0FtxCdP+QlRWp0J1uwEjivh5Woy64BdqFn1T1IKbokiIQfE+5WXX1EIQJ+D2qXNTt n6JM28jckZNX+o3UjFPvmO/uAi17X6cODLmFgP3DXXvuO5tmX/8HV+628GMCnlpUGA5Y eIxMCUJIHnG8RbdVgj6qiltSV9sm7cuCc15Zz6bSPhuMzztP7b3x+4Hg1v+YRny81OUD xmuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dGtvKHWRRXFlrf1Rt/BvAKG1RHxC0aWz145KvZzrENo=; b=hIQxZrxLCywgGLPqZXOBDYUAQTVeD5VzSqGiI0Kvn1Km6TXpmJEBVjU8FPa25s2yXC 4g4AMBDOLbc10FgVh00Bhu2h/6UDeDmz4UUTetmemOzt3KIIFbJOTxdMudqhGOaUwn5Y lUK9ZWFcM/Ox5QTvkz1sLBMTRFAK1AretzAsDdygEp93wYf4R1LqH6dA8V1QsYurvfnw rm/FlvmH8KO08gMiAk+UQDuRpM84AjUk9F2BSTKpuDhiLyv63BDY66HW5tGCJEiojeCu 4iUuz07pCgQkiFXeSIMo9iRXra7+fkh32Buzact9y7TFsl5vDN+jJwAUS3h17V8vBttg A6cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nOfZU7x2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y36-20020a631824000000b003816043ef49si11712883pgl.318.2022.04.04.18.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nOfZU7x2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 878212D9A1C; Mon, 4 Apr 2022 17:53:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383409AbiDDVd1 (ORCPT + 99 others); Mon, 4 Apr 2022 17:33:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379967AbiDDS3p (ORCPT ); Mon, 4 Apr 2022 14:29:45 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 066CD13F48 for ; Mon, 4 Apr 2022 11:27:49 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id h24so5424885pfo.6 for ; Mon, 04 Apr 2022 11:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dGtvKHWRRXFlrf1Rt/BvAKG1RHxC0aWz145KvZzrENo=; b=nOfZU7x2UnIeCLknzPKi2K2NV/GRMgJqR38o8eG4/fpHwDyU5NLRishBCI8R5tjwOn lM/HErpHngCQl4W2rBNP/zSGb6EYTNxwK2jdFtZuROZ8ePSlsVb1j5jwf6CesMV/4gB0 DwE8KQ9K5lEVfJlTC7Vosrkhd4fNIHxeGuJlI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dGtvKHWRRXFlrf1Rt/BvAKG1RHxC0aWz145KvZzrENo=; b=mfuAgoZdLz1eowS2TQ028yaSwUacuzT2zd+dLn5ZeeRgKVKts/8soDSTe8gwMAwqwd k72cGmaue+GyJW4wgWTsSE3n3FjcDdHbaak7CR+9wqCpg0LTKX+a9SeZ8D6UKmYHpqBj 249HvJo3AlMqXdJkKcLI82QoSbjX/Uz0wVgcooU2K1TwazKl2dQf9BmH9M7qvEfFsTz8 BB4bQ0e/xIqkMgifKv5bsu7rD1I0ee6NfX2T4vyVoPDqww9T6z+qvSBzZ5+ovseapZ/4 zeUzo1g1twZ+Xf5x/nqLqga5Dso3r3sU4UDuCD7CqOCTSlC5Ew9Mq7uXEBpofUglYDOT km9A== X-Gm-Message-State: AOAM533XHXNxvyYqyFFZGdHLdThelAUoLR7O9xYlKiw/OfI3QBUxpOHF 43Ps48AEeCksQ/2Fbt2HU6zrIQ== X-Received: by 2002:a62:1c8d:0:b0:4fa:8dcb:6da2 with SMTP id c135-20020a621c8d000000b004fa8dcb6da2mr885282pfc.19.1649096868412; Mon, 04 Apr 2022 11:27:48 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w79-20020a627b52000000b004fd8d1e5489sm12543463pfc.87.2022.04.04.11.27.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 11:27:47 -0700 (PDT) Date: Mon, 4 Apr 2022 11:27:47 -0700 From: Kees Cook To: Steven Rostedt , Josh Poimboeuf , Peter Zijlstra Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: vmlinux.o: warning: objtool: stackleak_erase()+0x35: call to ftrace_likely_update() leaves .noinstr.text section Message-ID: <202204041125.500C28FD8@keescook> References: <202204042008.sCQbEmVS-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202204042008.sCQbEmVS-lkp@intel.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Apr 04, 2022 at 08:22:33PM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 3123109284176b1532874591f7c81f3837bbdc17 > commit: dcb85f85fa6f142aae1fe86f399d4503d49f2b60 gcc-plugins/stackleak: Use noinstr in favor of notrace > date: 8 weeks ago > config: x86_64-randconfig-r012-20220404 (https://download.01.org/0day-ci/archive/20220404/202204042008.sCQbEmVS-lkp@intel.com/config) > compiler: gcc-11 (Debian 11.2.0-19) 11.2.0 > reproduce (this is a W=1 build): > # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dcb85f85fa6f142aae1fe86f399d4503d49f2b60 > git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > git fetch --no-tags linus master > git checkout dcb85f85fa6f142aae1fe86f399d4503d49f2b60 > # save the config file to linux build tree > mkdir build_dir > make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All warnings (new ones prefixed by >>): > > vmlinux.o: warning: objtool: __wrgsbase_inactive()+0x26: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: __rdgsbase_inactive()+0x23: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: fixup_bad_iret()+0x76: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: noist_exc_debug()+0x3c: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: exc_nmi()+0xaa: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: poke_int3_handler()+0x3e: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: mce_check_crashing_cpu()+0x15: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: mce_start()+0x4e: call to __kcsan_check_access() leaves .noinstr.text section > vmlinux.o: warning: objtool: mce_gather_info()+0x5f: call to v8086_mode.constprop.0() leaves .noinstr.text section > vmlinux.o: warning: objtool: mce_read_aux()+0x93: call to mca_msr_reg() leaves .noinstr.text section > vmlinux.o: warning: objtool: do_machine_check()+0x5f: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: exc_machine_check()+0x8e: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: mce_severity_amd.constprop.0()+0xca: call to mce_severity_amd_smca() leaves .noinstr.text section > vmlinux.o: warning: objtool: irqentry_nmi_enter()+0x45: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: irqentry_nmi_exit()+0x38: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: enter_from_user_mode()+0x15: call to test_bit() leaves .noinstr.text section > vmlinux.o: warning: objtool: syscall_enter_from_user_mode()+0x1a: call to test_bit() leaves .noinstr.text section > vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare()+0x15: call to test_bit() leaves .noinstr.text section > vmlinux.o: warning: objtool: irqentry_enter_from_user_mode()+0x15: call to test_bit() leaves .noinstr.text section > vmlinux.o: warning: objtool: irqentry_exit()+0x28: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: context_tracking_recursion_enter()+0x103: call to ftrace_likely_update() leaves .noinstr.text section > vmlinux.o: warning: objtool: __context_tracking_enter()+0x30: call to ftrace_likely_update() leaves .noinstr.text section > >> vmlinux.o: warning: objtool: stackleak_erase()+0x35: call to ftrace_likely_update() leaves .noinstr.text section I got CCed on this because of stackleak_erase() triggering, this, but it appears to be an existing issue for other callers too. It looks like __branch_check__() shouldn't be emitting ftrace_likely_update() calls for noinstr functions... I have no idea how a macro is meant to check for function attributes, though... :( -- Kees Cook