Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp869319imw; Wed, 13 Jul 2022 09:24:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v7DO6pF57BroOOg+qkPMEVka+oZUCCq+f5RMI/xv5pQX3GDaSX7gI45z3VOVsRq19QHvge X-Received: by 2002:a17:906:9b14:b0:72b:313b:2df4 with SMTP id eo20-20020a1709069b1400b0072b313b2df4mr4207735ejc.99.1657729443770; Wed, 13 Jul 2022 09:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657729443; cv=none; d=google.com; s=arc-20160816; b=Xzr7jqxFP/SShY1n+XFf+cqCEJ5jT+f8FEC9JzFZT1gbD1wBmz3C/XacM2HM5fc+SF X0Y3ZvLLEafYhKBBvZ1jKecmWknGRz+aWc+CwnEOer3lARokY+DUeVzYZVf4Zawo8VIw DshKFrXZ04DgN9vwrtMIdrBR9XSk/Uq5tqfeITE+Aj0DIsv/HMO4YlzxpN+nR5IZYdga bvyfglLUsj7LCGiUgYqCDzsTf0jucnYCrhVEsrfsFYAf+AYn4ev2LGaDPGpPH+dCNn1t q/kFYaq2iFmCV3nqd9udX4DnhVqQ7Tybem3az9RF3ELeoRWX3W5axhS80ZE14pdjLQzt m4ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=NWhhvtNedj35MafqKUgxobbUIMg+S+RFU2eVuxPt0V0=; b=tXoJjKXsQFitj0SJsC4d8ojLZoSf9d+dGxI8K8gGhZGM8PAwSZPG2NUsRdGwE1k+Ul dbomSJhoOg7Pj2CZBbsTEpgNeNYNMtwJrVJ80hn9yeNjgno4k4FNQxgwfhouRLqk/CCy Zn4WvfwcqM+vJoJcxeFVa5S4owoOieEwrH+rQCIzTaU/2racCUgKd9OzZlJoUEwad2Z/ zwhb7iPvyceylWYPCqc+oJgt2BKi6nHfy2tLrtevdh/WF6AnXhrhIqSaRAodAZdn+ES/ GQC+KLJ2tJ2TiG0txFINxL5azbMY2IWkOISklXuCfhx9cCKn5YwIWYvm3bpZfv3sF+Al oznQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="saXm/2DY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne29-20020a1709077b9d00b007235473b2fbsi76268ejc.680.2022.07.13.09.23.39; Wed, 13 Jul 2022 09:24:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="saXm/2DY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237106AbiGMQCV (ORCPT + 99 others); Wed, 13 Jul 2022 12:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237111AbiGMQCO (ORCPT ); Wed, 13 Jul 2022 12:02:14 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E32AF50714 for ; Wed, 13 Jul 2022 09:02:11 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id o7so19796240lfq.9 for ; Wed, 13 Jul 2022 09:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NWhhvtNedj35MafqKUgxobbUIMg+S+RFU2eVuxPt0V0=; b=saXm/2DYYz98lsTnnnC4cZtzYwilQkVPbJz+Nt8IPEgjczMyht2rA9hFXIPsqWNa6W jI+4KGQifKOciJaWQpa3wxOyh1iDQ3qOjrX7waH11xADUvW1AIhG1JvMAeDQ7DctNFhe 6hyWOeo/UxxgdDqONL085MaflbXekwYgcWtnVe0XQnbhXnqNnuH3+u1igyds3nyyU+ec Bmk6o8eQhP+6F3ls5V7k0sXqT1WMSCC5s4lUxMiIeEvk53wyARe/cqu9v+G3jDWEmEHk 7ZiVFOQK0Fhy21v6o7n+Mmt8F/NHkiTMTH2vNkK13sxtrvtnVYPzIpjYY7y5VC9zOosC QkVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NWhhvtNedj35MafqKUgxobbUIMg+S+RFU2eVuxPt0V0=; b=Zw0uTWUs1t/KZhwgExRmglTwoL2AQX+vz3HH9AtYt51cTROuO74iAywMEoE6giEiew T+bDU1DcoOUYp1TNdab4HNrINJPFNhohLY5UcyVBLg9c0gjY218x/wtlcFZ8Fe0xh5J5 qkyuOdRza9SxAf99hwz8AtMepbjolme7bAFd9hcEuH3Vwkukq77smGd+7detenNm21m2 XGk1WxpZHnRg1i+GCmryPEghFmgu8d9WPHAXAkJgseEAV300mUAm9RrWaXdCB1+Hgg+9 QSbigEwFmWf70E/7mp3xDn9CbbIBMVgHMaK7pLQqVjyvbKq0q3NEgH0R0PojSJ2T0Bqk i3Vw== X-Gm-Message-State: AJIora8lAn4uMOTe/P0PH61EklcX6doMmhoQxEINeFCGuQiP4l6wI1kf u2yzM0VBcY2TpbmGH3+tWmuimvgIFWWL/vcEqRugIQ== X-Received: by 2002:ac2:4c46:0:b0:489:e93c:69b with SMTP id o6-20020ac24c46000000b00489e93c069bmr2291049lfk.403.1657728129923; Wed, 13 Jul 2022 09:02:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nick Desaulniers Date: Wed, 13 Jul 2022 09:01:58 -0700 Message-ID: Subject: Re: objtool "'naked' return found in RETHUNK build" with clang + CONFIG_K{A,C}SAN=y To: Nathan Chancellor Cc: Josh Poimboeuf , Peter Zijlstra , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 On Wed, Jul 13, 2022 at 8:48 AM Nathan Chancellor wrote: > > Hi Josh and Peter, > > After commit 9bb2ec608a20 ("objtool: Update Retpoline validation") and > commit f43b9876e857 ("x86/retbleed: Add fine grained Kconfig knobs"), I > see a spew of objtool warnings when building certain configurations with > clang. Examples below, they appear to trigger in every single file. > > With x86_64_defconfig + CONFIG_KASAN=y: > > arch/x86/ia32/audit.o: warning: objtool: asan.module_ctor+0x11: 'naked' return found in RETHUNK build > arch/x86/ia32/audit.o: warning: objtool: asan.module_dtor+0x11: 'naked' return found in RETHUNK build > init/version.o: warning: objtool: asan.module_ctor+0x11: 'naked' return found in RETHUNK build > init/version.o: warning: objtool: asan.module_dtor+0x11: 'naked' return found in RETHUNK build > arch/x86/kernel/cpu/rdrand.o: warning: objtool: asan.module_ctor+0x11: 'naked' return found in RETHUNK build > arch/x86/kernel/cpu/rdrand.o: warning: objtool: asan.module_dtor+0x11: 'naked' return found in RETHUNK build > arch/x86/kernel/fpu/bugs.o: warning: objtool: asan.module_ctor+0x11: 'naked' return found in RETHUNK build > arch/x86/kernel/fpu/bugs.o: warning: objtool: asan.module_dtor+0x11: 'naked' return found in RETHUNK build > arch/x86/kernel/platform-quirks.o: warning: objtool: asan.module_ctor+0x0: 'naked' return found in RETHUNK build > init/calibrate.o: warning: objtool: asan.module_ctor+0x11: 'naked' return found in RETHUNK build > init/calibrate.o: warning: objtool: asan.module_dtor+0x11: 'naked' return found in RETHUNK build > > With x86_64_defconfig + CONFIG_KCSAN=y: > > arch/x86/ia32/audit.o: warning: objtool: tsan.module_ctor+0x5: 'naked' return found in RETHUNK build > init/calibrate.o: warning: objtool: tsan.module_ctor+0x5: 'naked' return found in RETHUNK build > init/version.o: warning: objtool: tsan.module_ctor+0x5: 'naked' return found in RETHUNK build > arch/x86/kernel/fpu/bugs.o: warning: objtool: tsan.module_ctor+0x5: 'naked' return found in RETHUNK build > arch/x86/kernel/cpu/rdrand.o: warning: objtool: tsan.module_ctor+0x5: 'naked' return found in RETHUNK build > arch/x86/events/probe.o: warning: objtool: tsan.module_ctor+0x5: 'naked' return found in RETHUNK build > arch/x86/kernel/apic/ipi.o: warning: objtool: tsan.module_ctor+0x5: 'naked' return found in RETHUNK build Thanks for the report. I wonder if this might be a compiler bug; it seems like the {a|t}san.module_{c|d}tor functions are being emitted with ret instructions? If you have one of these builds lying around still, can you provide: $ llvm-objdump -dr --disassemble-symbols=tsan.module_ctor arch/x86/kernel/fpu/bugs.o (I'm about to head into a bunch of meetings now, but can check more this afternoon; see you at Noon) If Peter and Josh are bored, feel free to stop by https://meet.google.com/yjf-jyqk-iaz at Noon PDT / 19:00 UTV today. > > If there is any additional information I can provide or patches I can > test, I am happy to do so! > > Cheers, > Nathan > -- Thanks, ~Nick Desaulniers