From patchwork Mon Jun 17 12:31:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 167003 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2803947ilk; Mon, 17 Jun 2019 05:31:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzY1uXYReLUPEaTqv1AUd7CHQNL1UX9r6TyjjCl+mcjWMJBcrPx9i+F8VifzWD9ElvZNfFo X-Received: by 2002:a63:1316:: with SMTP id i22mr50684756pgl.274.1560774705396; Mon, 17 Jun 2019 05:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560774705; cv=none; d=google.com; s=arc-20160816; b=zqXAkHVayUOcoWTZYSzxQ7yKde6dqGmgqj2cIVpDTm27Ar7uDqqn14UCMGyCWpB+Ja ncwO0fz0SvcmG/JFmMhd0TKaoDa1Dfvg5gD+jPAxSQdw+1LSKNgDAnFxEnMltST2Pej9 4UuIoZ5/bCN8HegQw6BT10H54FVqJFiJQkiGi7kDXm+AjcUe9FzADMcPqO6lnVSG5Ze8 OLLaViDagQ1WcMqDTi06IzWLVifII/vt/ShAbXtW3bLiziEm0zVxlN1HmnTIkFSx/EQm iYhMxEq861NPvL2hrDttwAG4hNeMuE/DpkX4UFBP1KXu4FxjgLibmbDvORyMCcZ7mu9P 8uGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=mstdkW+i3aHnx27xSlZz6sYwBqtFN5w2vAadecwyTTo=; b=QNcyS/v2Q0HEJRmVgeVDZdxRAfSH4GU1Sx9oQwKXqO07t+P6KcgV8Qsu9EPguAXbLh OxZmrTBA7cm6YI4UpiffoVhWb+4Gw+X+KnCWrZPCiTz71AnU/vl9PuqS1nP18Uc580EB ResXDYe0LkgElKAwRjUhmjw9liOuvD5puSLdngEmx8YlNhikWHPY1ac9j3stfWz27+vJ dwmzM/eU+ApnEhXnOl3Cktdseu/S5HQwOtEPpXwNv706k14kkh6dCu0up9bUqAa2/0vH qDr/wTuaSLhqx3qTrdiZVck/Dq7dlMFdASy4kkF2T3Aiev2cwH4H2u53xpgEtZgKrj7H 6hNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi8si9746595plb.352.2019.06.17.05.31.44; Mon, 17 Jun 2019 05:31:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726336AbfFQMbo (ORCPT + 14 others); Mon, 17 Jun 2019 08:31:44 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:53495 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfFQMbo (ORCPT ); Mon, 17 Jun 2019 08:31:44 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MhlbM-1iGKPA0jWS-00djt7; Mon, 17 Jun 2019 14:31:20 +0200 From: Arnd Bergmann To: Andrey Ryabinin , akpm@linux-foundation.org Cc: Josh Poimboeuf , Peter Zijlstra , linux-kernel@vger.kernel.org, Arnd Bergmann , stable@vger.kernel.org Subject: [PATCH] ubsan: mark ubsan_type_mismatch_common inline Date: Mon, 17 Jun 2019 14:31:09 +0200 Message-Id: <20190617123109.667090-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:RdrPG7YYozPOO4moFcrupalm1fFjUIeD1Q8rHF6IwUGNo79JcXH miKAhPNzei6GuU9U1bsgDZ8kG1jVk32osA4MHetoIE5ZsIYqMyTgCvnG+vMgAlYviqXB8aN a9wfzrI6f8gpze1TZWcSRXEgaozaMk4T3JwjusG3CMr7ZP2P8xxhrSDPn+Hjdzc0nXiljhb gAQj1zphITg1lfCVb1zlw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:OtOLG0VadSQ=:XsrhptSTyA02Et1uaEtCuI BLtI2n1fQrB7hHBYUluxjNkET7dy8P1RWzr6u8ltKIroe8fL3tMp5BOhzyD6oWF5sC62a1IKp NVnjSaTn/KQN1TCXTF04NJBMGUzH2E1KS9tapWvGMgEsL+Xn5kSFBI6uQrkp9Em2V4Kt5Mczd 8121xcgyrMya6GNS+xexw6fU2mfymI6X47yQefgyFsH64DN2ugUfEs2gyu/nYBYWt2C56Kp2o rhhsZo5VIwK2Bug5WrzOWLr8ZNLkn27J55n0Hycluj6h5UNogfQv3rQDPd8aE5oMn6Lry/Nqs SIDyZUuv3doxaFGfEY+xwB3ekAFtU/ZXk1biWw6OgvwZhj+CIbrZ09+1/9R1YoJLexrOM6ihz ZauPN9BevksogYmUc5whKUqg4hLSolBCEZereObQRocrz6deopDGt7xJtcetvv91eYIRAXXLS oUmmPVdFOgH2tuE7kjqOTO8gqrK34qrv7+40BwbH74izvdaKiM01Xs+p5t8KEQZFyvFgoscJY E3KLyEzZkKU65G25+4A0G46Hx6m+zr1afShcfYNo5jsNIv1Oom057fImFi8zbm8z+hLAUj7nA bV1uI8nRN4yZf9/KQuusEdi7XHXmLXnbcp1i8COCDZkIeNRLl9EKbADF6MFtcLqeC08RG85Hs ekBZKOpRFi5YTyTKqTX7PCFsIyYHX1AdIfPQ8qpCz0cUxDNdsu1ni5GzxKHrXXzvIpa0q9WKj Bhp8Ec+4/uFOookVQleHJ4RTlsMu3Nz/ieF8RQ== Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org objtool points out a condition that it does not like: lib/ubsan.o: warning: objtool: __ubsan_handle_type_mismatch()+0x4a: call to stackleak_track_stack() with UACCESS enabled lib/ubsan.o: warning: objtool: __ubsan_handle_type_mismatch_v1()+0x4a: call to stackleak_track_stack() with UACCESS enabled I guess this is related to the call ubsan_type_mismatch_common() not being inline before it calls user_access_restore(), though I don't fully understand why that is a problem. Marking the function inline shuts up the warning and might be the right thing to do. The patch that caused this is marked for stable backports, so this one should probably be backported as well. Fixes: 42440c1f9911 ("lib/ubsan: add type mismatch handler for new GCC/Clang") Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann --- lib/ubsan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.0 diff --git a/lib/ubsan.c b/lib/ubsan.c index ecc179338094..3d8836f0fc5c 100644 --- a/lib/ubsan.c +++ b/lib/ubsan.c @@ -309,7 +309,7 @@ static void handle_object_size_mismatch(struct type_mismatch_data_common *data, ubsan_epilogue(&flags); } -static void ubsan_type_mismatch_common(struct type_mismatch_data_common *data, +static __always_inline void ubsan_type_mismatch_common(struct type_mismatch_data_common *data, unsigned long ptr) { unsigned long flags = user_access_save();