Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1790198ybt; Thu, 2 Jul 2020 14:02:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEmkxqmZ8geDaTGmc0S641YpuRrVdNSoeSkgHP6rkjFqr2gaxTE/wnLvdZcoHRcnPaHlJb X-Received: by 2002:a50:9f8c:: with SMTP id c12mr33700095edf.149.1593723724828; Thu, 02 Jul 2020 14:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593723724; cv=none; d=google.com; s=arc-20160816; b=t2t3dBkkX1LZIWyj5poobG4gd9/wRsgbCbIS4mlhQhPfY0xCpSF+RXUekuUJJYxQR6 xakFOTLRrB19NoJFSGH+ComJ7h27RsFnvB4hiB5FlNx01YhkpRb1CTYNc3PK4Pr0yqb9 Qw+YOllg7AjhDPfTiIpmCy6W/R/sH9SGlY5/HNB2THkeQmxG5/phY8cvxaLM4adcrTbP ot0ZadVuQDHfUQRtomidf5J3riWDeWVxOFui15CpE/t3ug6fjQtNdoxeWvooz1C9ZjIk 58rcjk2nVm/1q+YA63vgTCP8lpDRblSAVbqWXWutyUle21sQM/dOeyZch3OWmQeDxLdU fGVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Q6iAzX8psrZMFurfr44VIinIy860L2+Sh5nA6p3yVks=; b=otvhFhFiBq6MM/s+vyDx4BOw6H8aWvP5eGcCYkCr4nz7npkZ2/UiRU7NShnNq21an/ uqmMgTwmdclDX2TShEr1cah+3P+RH0mT44oTUs62YL6zogmLdtYE8RPYC+Hy8qb0GRdL +UHRFgVVIMWdNtZh/UAyCjhKi6J9T3mZ7sU+sH81balCo+wTD4dWBHklVenqmT8lUEsd WFy0H+k+WZ0SiQl1BHrsOOR86Tp3/XPHuny3GMED0nN4XuYKfQLKBXOYmS6fxQ/NHoJm x1aD8wZwAL5r4VNwVCNHhALaqIpeqgzwyqQzuhti4FHfan49BO9Jn9K/MXu//ayuRIDS loWQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk7si5668828edb.86.2020.07.02.14.01.42; Thu, 02 Jul 2020 14:02:04 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726147AbgGBU7M (ORCPT + 99 others); Thu, 2 Jul 2020 16:59:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725937AbgGBU7M (ORCPT ); Thu, 2 Jul 2020 16:59:12 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C22AC08C5C1 for ; Thu, 2 Jul 2020 13:59:12 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jr6IQ-004AR1-1t; Thu, 02 Jul 2020 20:59:02 +0000 Date: Thu, 2 Jul 2020 21:59:02 +0100 From: Al Viro To: Linus Torvalds Cc: Michael Ellerman , Christophe Leroy , Josh Poimboeuf , Peter Zijlstra , the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: objtool clac/stac handling change.. Message-ID: <20200702205902.GP2786714@ZenIV.linux.org.uk> References: <20200701184131.GI2786714@ZenIV.linux.org.uk> <20200701195914.GK2786714@ZenIV.linux.org.uk> <87lfk26nx4.fsf@mpe.ellerman.id.au> <20200702201755.GO2786714@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 02, 2020 at 01:32:34PM -0700, Linus Torvalds wrote: > Ugh, the above is bad anyway. > > It doesn't use _ASM_EXTABLE_UA, so it won't warn about the noncanonical cases. FWIW, the address is inside a sigframe we decided to build, so noncanonical addresses shouldn't occur in practice. > Yeah, it would need to be turned into a "jump out" instead of just "jump over". > > Which it damn well should do anyway., > > That code should be taken behind a shed and shot. It does so many > things wrong that it's not even funny. It shouldn't do stac/clac on > its own. > > At least it could use the "user_insn()" helper, which does it inside > the asm itself, has the right might_fault() marking (but not the > address check), and which can be trivially changed to have the fixup > jump be to after the "ASM_CLAC". I'm not sure it's the right solution in this case. Look at the call chain and the stuff done nearby (that __clear_user(), for example)... I'm not saying that this code is not awful - it certainly is. But it's not that simple, unfortunately ;-/