Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5051350pxj; Tue, 22 Jun 2021 14:04:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkfnAK25c/n1cQSS1euz9h1LSXWlsR73iOdzFitZcQr350+0gh5EVQjVE+jPubCN+CoplD X-Received: by 2002:a17:906:5ace:: with SMTP id x14mr5978522ejs.507.1624395860436; Tue, 22 Jun 2021 14:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624395860; cv=none; d=google.com; s=arc-20160816; b=ZnXYnZLmLbsIXzW7Kkxhkzz+e3FUAL0np5YHH4UrVbx5hKpLtihPQYVNQc3FVaokSw qs9D/5Ce18UkVDqpRUzbntVSg71vzVS6Vig2pZMYhB7gmSbGdzMNKCCMH6hAV3eNwYmr aOTT389maKIV3CMMwwoSzDhDCrvy9QF7Iu92ZO3pos1gaBHc3QCw8UyIxOj/dBSVy6Vl nBOLfRB1r1/MQDk/rQ8zZXBazjq7lYPk+PuqB4nfXq9kQ2jsR/sCr1whdLz+xu6DoO1W ZGvobQaJQOGnqCC1YVKiszaPxaTjbsK3A7dX/m8PKZMAGfJS60a6wX4tcmT4GQunKOXd hUqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:user-agent:message-id :in-reply-to:date:references:cc:to:from; bh=Wl19OUomjbZ4AVg+bw2EYxFkqcW0TMDvTqycxvJrLPo=; b=VctTOyQned1hqKWGS0QO0VnTf8U/Bm1msvNb9UPvu4CXrZlDkyPXIORFsUutS1aBBU WHr0gjmu/FWBMAoPNC4323kYo75DGHHHnREMWkiYMRA7ASwtvEcQaqGesTQ0OPI7wvTh UWSTu+pNGecbQqU7m0Y1jowVndk0egPppggSjfOI88RgtgXisY1/uw1owCrumGjq78nB POmAIpSoKb2rl17pCXG9TMRT16s8DV4CaKxmc/p6C7zgVvkLebUWhNZBbWvcuoJUr/Ef Yv/25E8msvXFmavhZs44H1chxP6tw2Fq16CMXZ738o4qYpszS9Db1fbwKVLREHBagSVt V6hQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si15081141eds.538.2021.06.22.14.03.57; Tue, 22 Jun 2021 14:04:20 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbhFVVFP (ORCPT + 99 others); Tue, 22 Jun 2021 17:05:15 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:46740 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbhFVVFO (ORCPT ); Tue, 22 Jun 2021 17:05:14 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lvnXs-0044vo-6k; Tue, 22 Jun 2021 15:02:56 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=email.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lvnXq-00Gefl-Rt; Tue, 22 Jun 2021 15:02:55 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Linus Torvalds Cc: Al Viro , Michael Schmitz , linux-arch , Jens Axboe , Oleg Nesterov , Linux Kernel Mailing List , Richard Henderson , Ivan Kokshaysky , Matt Turner , alpha , Geert Uytterhoeven , linux-m68k , Arnd Bergmann , Ley Foon Tan , Tejun Heo , Kees Cook , Tetsuo Handa References: <924ec53c-2fd9-2e1c-bbb1-3fda49809be4@gmail.com> <87eed4v2dc.fsf@disp2133> <5929e116-fa61-b211-342a-c706dcb834ca@gmail.com> <87fsxjorgs.fsf@disp2133> Date: Tue, 22 Jun 2021 16:02:46 -0500 In-Reply-To: (Linus Torvalds's message of "Mon, 21 Jun 2021 16:36:33 -0700") Message-ID: <87h7hpbojt.fsf@disp2133> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1lvnXq-00Gefl-Rt;;;mid=<87h7hpbojt.fsf@disp2133>;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19uEzD4RxF7EsGUMi05fkwCV4KqKwu700c= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa07.xmission.com X-Spam-Level: X-Spam-Status: No, score=0.7 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,XMSubLong,XM_B_SpammyWords autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.2 XM_B_SpammyWords One or more commonly used spammy words X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Linus Torvalds X-Spam-Relay-Country: X-Spam-Timing: total 545 ms - load_scoreonly_sql: 0.13 (0.0%), signal_user_changed: 12 (2.1%), b_tie_ro: 10 (1.8%), parse: 1.06 (0.2%), extract_message_metadata: 15 (2.8%), get_uri_detail_list: 1.46 (0.3%), tests_pri_-1000: 20 (3.6%), tests_pri_-950: 1.37 (0.3%), tests_pri_-900: 1.07 (0.2%), tests_pri_-90: 164 (30.1%), check_bayes: 161 (29.5%), b_tokenize: 8 (1.5%), b_tok_get_all: 24 (4.4%), b_comp_prob: 2.8 (0.5%), b_tok_touch_all: 122 (22.3%), b_finish: 0.95 (0.2%), tests_pri_0: 315 (57.8%), check_dkim_signature: 0.91 (0.2%), check_dkim_adsp: 4.0 (0.7%), poll_dns_idle: 0.90 (0.2%), tests_pri_10: 2.1 (0.4%), tests_pri_500: 10 (1.9%), rewrite_mail: 0.00 (0.0%) Subject: Re: Kernel stack read with PTRACE_EVENT_EXIT and io_uring threads X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds writes: > On Mon, Jun 21, 2021 at 4:23 PM Al Viro wrote: >> >> How would it help e.g. oopsen on the way out of timer interrupts? >> IMO we simply shouldn't allow ptrace access if the tracee is in that kind >> of state, on any architecture... > > Yeah no, we can't do the "wait for ptrace" when the exit is due to an > oops. Although honestly, we have other cases like that where do_exit() > isn't 100% robust if you kill something in an interrupt. Like all the > locks it leaves locked etc. > > So do_exit() from a timer interrupt is going to cause problems > regardless. I agree it's probably a good idea to try to avoid causing > even more with the odd ptrace thing, but I don't think ptrace_event is > some really "fundamental" problem at that point - it's just one detail > among many many. > > So I was more thinking of the debug patch for m68k to catch all the > _regular_ cases, and all the other random cases of ptrace_event() or > ptrace_notify(). > > Although maybe we've really caught them all. The exit case was clearly > missing, and the thread fork case was scrogged. There are patches for > the known problems. The patches I really don't like are the > verification ones to find any unknown ones.. We still have nios2 which copied the m68k logic at some point. I think that is a processor that is still ``shipping'' and that people might still be using in new designs. I haven't looked closely enough to see what the other architectures with caller saved registers are doing. The challenging ones are /proc/pid/syscall and seccomp which want to see all of the system call arguments. I think every architecture always saves the system call arguments unconditionally, so those cases are probably not as interesting. But they certain look like they could be trouble. Eric