Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp83193pxu; Tue, 24 Nov 2020 19:40:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxcW0LtFBtlebSvr1aBhhRoJslvYQIZD8YgHW56XE63EzPXo/KgaHAI4Zv9il1sHMACb81 X-Received: by 2002:a05:6402:8d5:: with SMTP id d21mr1604867edz.11.1606275626568; Tue, 24 Nov 2020 19:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606275626; cv=none; d=google.com; s=arc-20160816; b=w/KkFUf9npTx1W9MitCB76V55f3LKYUiK9X12IFY4ZpBcc0FSk62XHiXRY/q9UpvKr L9/gl3LURirfK1CXAVq6qqhx+9/ekOh+h9XtY3xX+yvYVYj44sU6AdyNoBfaFs0YizWt VrGDnwcPkR5zGlhV3j4fP3Uh6Q8AJXFVLldP2DpBuTlvitFPJzE3Z2LkJF3cgusrtgcu q9pfI6PbWbZ7oIodTuXBl7xoVvJ9zJCgk25OnPmniIQpIEY9VOQXLOApdayw0rhlowMg qsM+mm45AGc5WDbjreY/POKnM6KkrYSeBke9+RvlNKQT2xX8MWh4rieb26uE+LCzjXnN KeTA== 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=1VK4ZeW7Nz+CFyAfbJgfsEqmJxnrRpFVEOk6d97DaLw=; b=nwLHRh4YxJPbEkK4cfyZoiKK5ZjqE5qN1oEavnkWygTbYo+ZhbJT4ldwxDD9f7U1o+ 0lgaI+gNgESe9U5XVDra/p4yRN4wJCrQCXmGzMP88Iw8P116jQrrIy0836B1nztOs3kc LHdZie/hf/50RGGoPbZuESgsHzUU9ElTZLxtRmGTT7W1DMOJQorn5hCq8xg729FRDTmx MaDxOga2yksqRczjDiHwj0RsdsWtf2Fry2BMfWVujffc3gE0zdduRyfnXLooPbE5AoT1 mK7DLGSQ799t5uVFAtVIDnyb8LU3LaPrd0h7ZZZ6odizxejNmDtPDWQ1UE6tFDxUZat+ ua8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iJBbIXRc; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gq17si540207ejb.178.2020.11.24.19.40.02; Tue, 24 Nov 2020 19:40:26 -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=@linaro.org header.s=google header.b=iJBbIXRc; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727520AbgKYDgc (ORCPT + 99 others); Tue, 24 Nov 2020 22:36:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727365AbgKYDgc (ORCPT ); Tue, 24 Nov 2020 22:36:32 -0500 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93C87C061A4D for ; Tue, 24 Nov 2020 19:36:31 -0800 (PST) Received: by mail-ej1-x641.google.com with SMTP id 7so1032606ejm.0 for ; Tue, 24 Nov 2020 19:36:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1VK4ZeW7Nz+CFyAfbJgfsEqmJxnrRpFVEOk6d97DaLw=; b=iJBbIXRcabK8sZM5rr4sYbAeByFeIxnyFkX052Ugs+GRIjpmaDd52gB1Z3rMMeYqHH zV80GGTWxytr3wVkGWS1VsoXZsQUF8EkU6KxZbcCpJ1qfok1xc3TyzwNKoB9gP5II2dh PMzr3yU1eVf7n90z+DIUqcbeVDd9DGYRyTFTzKAC7U5APJQKuD8Gr0ZtTSqgodZvJxdx mzE41diVzfXn7vtz6APS2WIgtD2k6s9v8qGj7wW/IVPzPT3F7GbXZOC5KjBoPe4H74He 44Y50PrC/ZNkqpgvMT3jEdxhVoYxdiPnNwXmiGN4Lb9rjusgRH2X70BsojC/3lTRtVUu eqqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1VK4ZeW7Nz+CFyAfbJgfsEqmJxnrRpFVEOk6d97DaLw=; b=MXTMCP5gAmoPNSctrZ04hPLocmnGbgT2U5ZUJl4KOpyoLaDAYOdsMyZ/bciH00h+OA 33gRBxfE7I9sg0PGLntbTsFFk+dppxqz9KVMAWmGciAJ4ALAJCLW2fQIa9I+opLp4PB1 FzfTR9C5t3EjXjr2Zr6nChwhuVHbk9ze5JEwqExsoW/5VDIdGCTL6/tnUy+nBibKIImQ +ogqXSgmnY1Sdn+PwuwKOo2PQ+/DHXe1K5XcGslwMXbsJSfAah+hVstd8yZAfXcfsxdb O1hFcVqV1/kJBAL6seAHDI+MaDiDNzPGkaEr8RJHWbhlpH+rlBI47ZuQZgz0Ib+hbiWR qTVQ== X-Gm-Message-State: AOAM532OweiZlLDNbl/u8/SZPK2v6OFWOg5DY7ByNKNNck4pmciBH0X4 xulKqdhg3DQwXAGSKiF/7OYqLIPupbuh+OH1TyJBcg== X-Received: by 2002:a17:906:a195:: with SMTP id s21mr1422714ejy.146.1606275390123; Tue, 24 Nov 2020 19:36:30 -0800 (PST) MIME-Version: 1.0 References: <87h7pgqhdf.fsf@collabora.com> <87a6v8qd9p.fsf_-_@collabora.com> <202011241345.FAF4D7E@keescook> In-Reply-To: <202011241345.FAF4D7E@keescook> From: Naresh Kamboju Date: Wed, 25 Nov 2020 09:06:18 +0530 Message-ID: Subject: Re: [PATCH] entry: Fix boot for !CONFIG_GENERIC_ENTRY To: Kees Cook Cc: Gabriel Krisman Bertazi , Jann Horn , Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Nov 2020 at 03:15, Kees Cook wrote: > > 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. This patch tested on arm64, arm, x86_64 and i386 and the reported issue got fixed. > > > > 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 Tested-by: Naresh Kamboju - Naresh