Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1214940rdb; Wed, 16 Aug 2023 05:24:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6v4YtLawieV6uLMuS6UEEo14u+3lgQgb88xVVdLbzjTgTubz3bPdma+AiTlfeJpv2yoSD X-Received: by 2002:a05:6830:20c9:b0:6bc:c9e6:30b7 with SMTP id z9-20020a05683020c900b006bcc9e630b7mr1668780otq.26.1692188650969; Wed, 16 Aug 2023 05:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692188650; cv=none; d=google.com; s=arc-20160816; b=tH5+ghuXaM0a2sqYGz+RFsDq6975BR5Pe5b8PNff7gXWU1gB4Eeql+reF7r52vykSt LbZcD1ZMYgrrsv3wsqbZvo2/RhG7IzFhPVcxqJGCXFmZJZIzgueMMfDMS3nfUP1svqjL 87MSvgmaCBnVdtFff/IqkaEjRhRDSllQFoXNyhIlxqWz4JCH7hBrq7P+WaT2Y9T+1X65 Xhz7YE9cyTiZo74pbrj4lwMHsTEgRk4uWcYrjykxTUgccheYOgyy5uThSJVuRpuhd+FW PxMT1Em9xacOB3SyzPet+mVJ62bEefBKhJNvviu/EX5+P4OZR9qzurwb5XnyvlV2eINL qJ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=ZwkBeBinb1qkVOoanoBdeUUnq0O6kGZa6erTBfzA0Lg=; fh=9WMooSPswIiyW+ciKr830Brif7AK+Ls04G54nHP4hw8=; b=WErvvOvzAkI+Y2V8LvFNDHAvagNg4ygXcwB3Cd9q38VDUaJ6AoCxP865MM8FnmGY3i LVqG9XzVeebuo/yifVKaid9lBDg2xOUxywXM9ClE9iEP0/UfmOr5wGz/clcw5zYFwGEz wTc/u97bbAE6BquxQlkqbO4i/OBs25lJ1j0OP2bBpRPwj3H8xg3gEoF17f3V4Svte7WS pTy2Hed0sf/dNQXTMLZD1+P8z4wvmj7Z19lQE9ZuYTxVet3UMn+eXTSxGIq7tGHe2VjC uoYDA4X5ERr4R+0SHyQswCqRBbcNhJfMvfNG/wLBxXi1sUSFEDO/KA3aoVSB48d1NgWf udtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h62-20020a638341000000b005539899e4cdsi2074591pge.813.2023.08.16.05.23.58; Wed, 16 Aug 2023 05:24:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237689AbjHOOr3 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 15 Aug 2023 10:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237799AbjHOOrO (ORCPT ); Tue, 15 Aug 2023 10:47:14 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8453493 for ; Tue, 15 Aug 2023 07:47:13 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-283-aQY9xdUMN3GeVjFFocRg_w-1; Tue, 15 Aug 2023 15:47:10 +0100 X-MC-Unique: aQY9xdUMN3GeVjFFocRg_w-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 15 Aug 2023 15:47:07 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Tue, 15 Aug 2023 15:47:07 +0100 From: David Laight To: 'Oleg Nesterov' , "Eric W. Biederman" CC: Petr Skocik , Kees Cook , "Thomas Gleixner" , Peter Zijlstra , "Marco Elver" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] signal: Fix the error return of kill -1 Thread-Topic: [PATCH] signal: Fix the error return of kill -1 Thread-Index: AQHZzsZurwDqks8Mx0Ka5moH+T06/q/rb+fw Date: Tue, 15 Aug 2023 14:47:07 +0000 Message-ID: <3b14ae8091e3403bbc4ef1bee6dcf4f6@AcuMS.aculab.com> References: <20221122161240.137570-1-pskocik@gmail.com> <202211220913.AF86992@keescook> <878rai7u0l.fsf@email.froward.int.ebiederm.org> <336ae9be-c66c-d87f-61fe-b916e9f04ffc@gmail.com> <87pm3t2rvl.fsf@email.froward.int.ebiederm.org> <87jzu12pjh.fsf_-_@email.froward.int.ebiederm.org> <20230814140652.GA30596@redhat.com> <20230814154351.GA4203@redhat.com> In-Reply-To: <20230814154351.GA4203@redhat.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oleg Nesterov > Sent: 14 August 2023 16:44 ... > Even simpler > > } else { > struct task_struct * p; > bool success = false; > int err = -ESRCH; int err; ret = -ESRCH; > > for_each_process(p) { > if (task_pid_vnr(p) > 1 && > !same_thread_group(p, current)) { > err = group_send_sig_info(sig, info, p, > PIDTYPE_MAX); > success |= !err; > } > } > ret = success ? 0 : err; > } or maybe even: } else { struct task_struct * p; int err; ret = -ESRCH; for_each_process(p) { if (task_pid_vnr(p) > 1 && !same_thread_group(p, current)) { err = group_send_sig_info(sig, info, p, PIDTYPE_MAX); if (ret) ret = err; } } } David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)