Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2056015pxu; Tue, 24 Nov 2020 16:04:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWm5N+83lg9/o2DS4QIVE0lMP+TY7QFLg2Br84J0YOwXYtP7XKmS78a/iDckFdvvfnzzKD X-Received: by 2002:a50:bb25:: with SMTP id y34mr984535ede.249.1606262665989; Tue, 24 Nov 2020 16:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606262665; cv=none; d=google.com; s=arc-20160816; b=PC0E+fyTzRKz5jKNs83HUN0MrzxIh/1FCBJ3rMWz431wnw9Chc69MPkVBge/lsg5P/ FR1wIouXMUh0/0t23MmBS//ThuL7ODJHlfJU2xEuxuEIUtk1PXKhr5n4Ky2mfHaSZ5WP wa5RYKFeWCtL/8KwuuXnC+kjybb12khS5v8jmyKeOoNGNSTBrtOALPvx6DEWL9On8tWY MpOf0jMgjxGXUlgjM0eLAaFjns8LhBauAl1rq6Fjhj71czNcxUNSTBk1EcDkbTK/kpjw asjv8wRFrElrrqq1fcntaCMte9ntpmY3fbMi5m4E3M24Q26p4aBhP6MSU8ap5UmQxOEu 0Kvg== 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=qUk28dgg2DUj1+6HYL179P0h9eGbzR54HIME/VXKOvg=; b=vYuq+EIcmBuz6CCR8THQkPcPIaSQ7tHgksnHPGIlKDpkD8JLsHxw6WSORlSLgWB8Vz RlgAMO18aaVUg3fGpvLtNi3/TGzRtk7TyLi5fZ7FowBp+R2xTovtVPrvfSHDg6izTnB/ sZ/tdxTUQ/N9483LBo+Mkt//oGWZ+Gi3ZQIy6bCyTvyf3l9imExtk6RJc6yvdYm4SX6l rbNHzxYQxjtMJUbR1RyWe1XW1QNbeDRO1sbDMf9T2YVWTPoUAo5fb/2yBne5+xCDz3PE cn5BK3SEehYG8cyRbDS1rkA12FbkBB/YsXvxJZY3tMR2OJrA5UAY9yCBF9JDq1LCEHk9 QHwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eRM5pcDj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s12si177126edj.90.2020.11.24.16.04.03; Tue, 24 Nov 2020 16:04:25 -0800 (PST) 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; dkim=pass header.i=@chromium.org header.s=google header.b=eRM5pcDj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733296AbgKXVpp (ORCPT + 99 others); Tue, 24 Nov 2020 16:45:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729194AbgKXVpo (ORCPT ); Tue, 24 Nov 2020 16:45:44 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46B63C0613D6 for ; Tue, 24 Nov 2020 13:45:44 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id n137so340891pfd.3 for ; Tue, 24 Nov 2020 13:45:44 -0800 (PST) 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=qUk28dgg2DUj1+6HYL179P0h9eGbzR54HIME/VXKOvg=; b=eRM5pcDjTejd77WL4qH2l3Waz69TXUmimfeFmBp2KHeoI2kfUj04HHD+5AX5l7h/w1 itFs9VMoa+OfcKZEFM2+nNziTHhP1TuagNH1mSUGrd7szPzTIDoItWAQpcFZaq7E0jDr YVscjYb/iBIjuSqEbH0Z5p2PzgyBUZdEvhQRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qUk28dgg2DUj1+6HYL179P0h9eGbzR54HIME/VXKOvg=; b=OSh3sTHKrFl/c/IGHYyDewKwveGKyJ1BIOvh0L1z5NoD5SSyGHTCcYLJjy0gLpJ4cR qmvNC+AAL87hXKBB0e5vMpnrwC8XCTbULVWVub6k8iuHtqaZCfO8ejP2u562/KHs92JB kFe1TxLvE/ryGuaTSx9LqzuSnJj/AqjkADAgR1vEA0VQoNlLzedEavE+OoLc2HWZa7WP urglQT4wTeWpxdtGn95xyAMnNToZkNk+G9pRxQJhxPL7Y5Dt8etWNAwm5s57jD1LC2z5 R6a/EoAX7CoiDy4UvWHzuPVyAktW1RKIH1O57qXSzUqEolYVRNy4bAeZPuEIibEHhOBg IjwQ== X-Gm-Message-State: AOAM531Q6a1rzwXtdEDkZ7BForg/lzpzPD1MvJBpAaGWBPZ6fxxe/I+R TO3DsWn7xcSrVpYGlXoY0duh8A== X-Received: by 2002:a63:cf52:: with SMTP id b18mr344446pgj.338.1606254343911; Tue, 24 Nov 2020 13:45:43 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z10sm17931pfa.149.2020.11.24.13.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 13:45:43 -0800 (PST) Date: Tue, 24 Nov 2020 13:45:42 -0800 From: Kees Cook To: Gabriel Krisman Bertazi Cc: Jann Horn , Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , Naresh Kamboju , open list , Netdev , bpf , lkft-triage@lists.linaro.org, Linux ARM , Daniel Borkmann , Andrii Nakryiko , Song Liu , Yonghong Song , Andy Lutomirski , Sumit Semwal , Arnd Bergmann , YiFei Zhu Subject: Re: [PATCH] entry: Fix boot for !CONFIG_GENERIC_ENTRY Message-ID: <202011241345.FAF4D7E@keescook> References: <87h7pgqhdf.fsf@collabora.com> <87a6v8qd9p.fsf_-_@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a6v8qd9p.fsf_-_@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 23, 2020 at 10:54:58AM -0500, Gabriel Krisman Bertazi wrote: > Gabriel Krisman Bertazi writes: > > > Jann Horn writes: > >> As part of fixing this, it might be a good idea to put "enum > >> syscall_work_bit" behind a "#ifdef CONFIG_GENERIC_ENTRY" to avoid > >> future accidents like this? > > > > Hi Jan, Arnd, > > > > That is correct. This is a copy pasta mistake. My apologies. I didn't > > have a !GENERIC_ENTRY device to test, but just the ifdef would have > > caught it. > > I have patched it as suggested. Tested on qemu for arm32 and on bare > metal for x86-64. > > Once again, my apologies for the mistake. > > -- >8 -- > Subject: [PATCH] entry: Fix boot for !CONFIG_GENERIC_ENTRY > > A copy-pasta mistake tries to set SYSCALL_WORK flags instead of TIF > flags for !CONFIG_GENERIC_ENTRY. Also, add safeguards to catch this at > compilation time. > > Reported-by: Naresh Kamboju > Suggested-by: Jann Horn > Signed-off-by: Gabriel Krisman Bertazi Thanks for getting this fixed! 3136b93c3fb2 ("entry: Expose helpers to migrate TIF to SYSCALL_WORK flags") Reviewed-by: Kees Cook -- Kees Cook