From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1289DC433EF for ; Fri, 18 Mar 2022 14:45:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236501AbiCROrF (ORCPT ); Fri, 18 Mar 2022 10:47:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237433AbiCROrE (ORCPT ); Fri, 18 Mar 2022 10:47:04 -0400 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3192B105A9B; Fri, 18 Mar 2022 07:45:45 -0700 (PDT) Received: from in01.mta.xmission.com ([166.70.13.51]:55336) by out02.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nVDqJ-00HBmm-SI; Fri, 18 Mar 2022 08:44:39 -0600 Received: from ip68-227-174-4.om.om.cox.net ([68.227.174.4]:38506 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nVDqI-006Fhl-W2; Fri, 18 Mar 2022 08:44:39 -0600 From: "Eric W. Biederman" To: Kees Cook Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Alexey Gladkov , Kyle Huey , Oleg Nesterov , Al Viro , linux-api@vger.kernel.org, Jens Axboe References: <87a6ha4zsd.fsf@email.froward.int.ebiederm.org> <87bl1kunjj.fsf@email.froward.int.ebiederm.org> <87r19opkx1.fsf_-_@email.froward.int.ebiederm.org> <87o82gdlu9.fsf_-_@email.froward.int.ebiederm.org> <87tubyx0rg.fsf_-_@email.froward.int.ebiederm.org> <87bky67qfv.fsf_-_@email.froward.int.ebiederm.org> <202203171209.FC87C7B08@keescook> Date: Fri, 18 Mar 2022 09:44:30 -0500 In-Reply-To: <202203171209.FC87C7B08@keescook> (Kees Cook's message of "Thu, 17 Mar 2022 12:10:16 -0700") Message-ID: <87fsnf2ucx.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1nVDqI-006Fhl-W2;;;mid=<87fsnf2ucx.fsf@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.227.174.4;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18c/C30UgmTCpKstYbDp2Va3pJS8t12OoI= X-SA-Exim-Connect-IP: 68.227.174.4 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH 1/2] ptrace: Move setting/clearing ptrace_message into ptrace_stop X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org Kees Cook writes: > On Tue, Mar 15, 2022 at 06:21:08PM -0500, Eric W. Biederman wrote: >> >> Today ptrace_message is easy to overlook as it not a core part of >> ptrace_stop. It has been overlooked so much that there are places >> that set ptrace_message and don't clear it, and places that never set >> it. So if you get an unlucky sequence of events the ptracer may be >> able to read a ptrace_message that does not apply to the current >> ptrace stop. >> >> Move setting of ptrace_message into ptrace_stop so that it always gets >> set before the stop, and always gets cleared after the stop. This >> prevents non-sense from being reported to userspace and makes >> ptrace_message more visible in the ptrace helper functions so that >> kernel developers can see it. >> >> Signed-off-by: "Eric W. Biederman" > > This looks good to me. Did you happen to run the seccomp selftests > before/after these changes? I did not. This is a pure ptrace change. Do you see a way that seccomp could be involved? Eric