Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp771476pxy; Wed, 28 Apr 2021 13:58:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLVoau5oAoZG7nEPcq6t+gXga7B1uY5vP8s9UkMS4EmWkNNEc3pbUYnsii3CCVwXAFcx2k X-Received: by 2002:a05:6402:514a:: with SMTP id n10mr14490153edd.25.1619643484727; Wed, 28 Apr 2021 13:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619643484; cv=none; d=google.com; s=arc-20160816; b=FEFDxJEjbaykwbLF6qNc9F0APuTjD8cqkRXdx8VB0lwSe49YUlyJvweZDshNQ79TJG 19AVQQvMCYGuj37PYx0xQrVjOMFMQpObfBGtA/rpDrUnYekWcVjnXiXF5BWt0Ny+dePp exviWIgreJ0jRFVskBnjFHwYPPOOt74jfaGmjEJNIhGuQgI9Jq1JRmba06s0zB8Ne5RU DJZlLBSsmbdCCed/MLipwQtyd2sfCkxrgjpSIeqFMxtcWk8tahYcveNRP1PvFEEAKWcF 43wJeBF5jus1Sb6KjgAtzKNaiUQIdf2qh5ufWEIKtnQi8P7KTQlM7HibyhD641OkVTG0 JVUw== 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=Z3WAVPi6tsHxDYkM4thG7PqVeXUU++9bnDuXCoKXmi4=; b=XYNH3L0FGqHzi33rtC5p8vf8qaRQKe9pILXKJ3I96hXwiR18o447Z+xPf97ysxEepV CHB1Qa0SVFioZsLU864RlnfuikLSerI1TMP4XBS8NRvUvFsq8LPtPsflN9tSueb7KOy7 3nQeE0tsHCoTvAiUQIOi0vRtBCOK/WjeV7ZGztu3Vm1Mu5vGDiLhd17mDJx39qYnOWJ9 Ig2+QmMEMFXlI8INFc8JWKEMXQfo2oCzonZasznzU0cSYXAKboJi4GcaOilVxcWxDZGW 0CqHBh73ATsDHxKYUHFs8lYB8cuxpcvcWfR+gMsvvL0T5+93AnbyfQIlnBwEXcdf4AkI +YIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZmnkDIBH; 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 v27si1143152eja.157.2021.04.28.13.57.40; Wed, 28 Apr 2021 13:58: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; dkim=pass header.i=@chromium.org header.s=google header.b=ZmnkDIBH; 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 S242012AbhD1Uj5 (ORCPT + 99 others); Wed, 28 Apr 2021 16:39:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242013AbhD1Ujz (ORCPT ); Wed, 28 Apr 2021 16:39:55 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDA9FC06138E for ; Wed, 28 Apr 2021 13:39:08 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id p2so30143585pgh.4 for ; Wed, 28 Apr 2021 13:39:08 -0700 (PDT) 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=Z3WAVPi6tsHxDYkM4thG7PqVeXUU++9bnDuXCoKXmi4=; b=ZmnkDIBH98NF1kICfHfEsAXDmL81P1i5sho5DoEipnWM1JRdebMvTIFIB3EZrdbxZn y8ClFZHg8i8gUYF0PnrIs3G4b/r+BytJNDQ4uhlC+MiMF0Kec0BZ7gn7keoVd6VL500d WrrbVntXIXFqljgruoN87fy+qSt9FsFRYjSW4= 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=Z3WAVPi6tsHxDYkM4thG7PqVeXUU++9bnDuXCoKXmi4=; b=lZ7TU+L9aam6tuxOJvkCeYY5P6AvDUsnHafTLta4x/RAQzoTOqF+Lgszvqibaa5Ivs 8Ni5bWJEHam/lMapevAYHkuv2C1FLtevNhn/FMC72dGwcssdlLRjCmHAKHG7ZnxjuuRr unRRNUJK96a88IPZYpzdni4wh51LqZVhDLBX0eskDhFB/Nko7Ym0SmiSIt4JYYIxib6a Kp3N3tXoS+Jrsgi9xawNE3TxmsUvy6lYVAzrutKLA2/L4WAZRGaL/IcFtRx88Qm/kUrC NKyYlZyQvrdhCXVC+b+m2uS5suaVFQgum/xTFoCSEvh5uAUzcxZ+wDDn9H7yr0LMIxCm wEWQ== X-Gm-Message-State: AOAM531+T4kmUBwxZ3iTCobxd9nr+Cssr/5RJb3nwVPQL5h27zZJkyHC zmIheD2aATJKie7SP+tL/7jauw== X-Received: by 2002:a05:6a00:170c:b029:225:8851:5b3c with SMTP id h12-20020a056a00170cb029022588515b3cmr29728717pfc.0.1619642348454; Wed, 28 Apr 2021 13:39:08 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e10sm493387pfc.40.2021.04.28.13.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 13:39:07 -0700 (PDT) Date: Wed, 28 Apr 2021 13:39:07 -0700 From: Kees Cook To: Yu-cheng Yu Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Haitao Huang Subject: Re: [PATCH v26 8/9] x86/vdso/32: Add ENDBR to __kernel_vsyscall entry point Message-ID: <202104281339.F0CA6CA3E@keescook> References: <20210427204720.25007-1-yu-cheng.yu@intel.com> <20210427204720.25007-9-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210427204720.25007-9-yu-cheng.yu@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 27, 2021 at 01:47:19PM -0700, Yu-cheng Yu wrote: > From: "H.J. Lu" > > ENDBR is a special new instruction for the Indirect Branch Tracking (IBT) > component of CET. IBT prevents attacks by ensuring that (most) indirect > branches and function calls may only land at ENDBR instructions. Branches > that don't follow the rules will result in control flow (#CF) exceptions. > > ENDBR is a noop when IBT is unsupported or disabled. Most ENDBR > instructions are inserted automatically by the compiler, but branch > targets written in assembly must have ENDBR added manually. > > Add that to __kernel_vsyscall entry point. > > Signed-off-by: H.J. Lu Reviewed-by: Kees Cook -- Kees Cook