Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1832362rwb; Sun, 18 Sep 2022 15:39:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Hjp+Jmwt5ESYl/pOYiq0B9e7Um9ZteVFg501PJxmSMlgT/qUiCuq6yeW6HUKBt1AAK6Bt X-Received: by 2002:a17:902:ec83:b0:178:39e5:abee with SMTP id x3-20020a170902ec8300b0017839e5abeemr10409594plg.84.1663540791992; Sun, 18 Sep 2022 15:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663540791; cv=none; d=google.com; s=arc-20160816; b=rcCIQPvuFucoiNJl68PNi6OYiI3apL8NTSeF1nHvHKfOUjFntEUhntQmdQkyO/61XI UaGozgJ/PYqbXwBbofIHHuqLYSNmYw26OmxmYQPySOULetTudBYt/uQOeREJmSTYqbH3 7ZgMQLvsdXUHY2hXjceYlWbvux6YehGVS/OrK1e/sPIDR4AAFOMMWXsJ02E1bI1Mklnk gYQ028/t8Te63l/aG0rHRAhWJCTGAAQ5VkDq+9ioQSMFBcKZiMGsab3/T+KgEqikONoL Q8sETxazIAXOI/4UdTwdFOBiZazUHfvetS+HhJTFNBlZFfnfEyswdiIUoi3QG75wGZo5 MS9Q== 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=SQ7jr9FOB3PGiC6S60uj/ocaJVRUvjQ/gLWgdU5nAys=; b=wPZaX6gqaIip4fywZ4z/8deRjdRIfHE4VumOKncq9lCkAgxNts28xbLcIaSR7ni8Op N2fY5BqbAEjzVeFAPoRlPN4I94nvvVDllX3mqkT+2VMRmXKGi3fg8kKPJe/L+fR6t7rz P9tBqK3fFg70AOLcjpIbkOuDCB2aVs9uBe9FKUlL/8OtKXPAO8Sb3o1iPmkqHwSL/6AR V8mzZGLKI3RpTDtMPB3MK/etCMj1XIEVdcRqUu4QKRb5VVR6OMk2TAE+aJA1u485wSSQ 9ckMtdta+NZUoxmk3teWk6wWBOySNS0oicOJJshwRjHVHW5VQNYHjnDKRf/PyGK8ljmt QRxw== 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=xmission.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o36-20020a635a24000000b0042c254ab497si27440970pgb.178.2022.09.18.15.39.25; Sun, 18 Sep 2022 15:39:51 -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=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229626AbiIRVz4 (ORCPT + 99 others); Sun, 18 Sep 2022 17:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbiIRVzw (ORCPT ); Sun, 18 Sep 2022 17:55:52 -0400 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 848C317A94 for ; Sun, 18 Sep 2022 14:55:51 -0700 (PDT) Received: from in02.mta.xmission.com ([166.70.13.52]:43960) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oa2GQ-008ozR-Sj; Sun, 18 Sep 2022 15:55:46 -0600 Received: from ip68-110-29-46.om.om.cox.net ([68.110.29.46]:47224 helo=email.froward.int.ebiederm.org.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 1oa2GP-006HsH-VI; Sun, 18 Sep 2022 15:55:46 -0600 From: "Eric W. Biederman" To: Al Viro Cc: Zhaoyang Huang , "zhaoyang.huang" , LKML , Ke Wang , Oleg Nesterov References: <1661842523-26716-1-git-send-email-zhaoyang.huang@unisoc.com> Date: Sun, 18 Sep 2022 16:55:17 -0500 In-Reply-To: (Al Viro's message of "Sun, 18 Sep 2022 03:42:53 +0100") Message-ID: <87wna073ga.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=1oa2GP-006HsH-VI;;;mid=<87wna073ga.fsf@email.froward.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=68.110.29.46;;;frm=ebiederm@xmission.com;;;spf=softfail X-XM-AID: U2FsdGVkX1/AkfaHDfpn6fLN77ooydSFsheLGKPGEa8= X-SA-Exim-Connect-IP: 68.110.29.46 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Al Viro X-Spam-Relay-Country: X-Spam-Timing: total 387 ms - load_scoreonly_sql: 0.20 (0.1%), signal_user_changed: 20 (5.1%), b_tie_ro: 17 (4.5%), parse: 1.10 (0.3%), extract_message_metadata: 17 (4.3%), get_uri_detail_list: 1.35 (0.3%), tests_pri_-1000: 34 (8.7%), tests_pri_-950: 1.52 (0.4%), tests_pri_-900: 1.09 (0.3%), tests_pri_-90: 80 (20.6%), check_bayes: 78 (20.1%), b_tokenize: 6 (1.5%), b_tok_get_all: 7 (1.9%), b_comp_prob: 2.5 (0.6%), b_tok_touch_all: 58 (15.1%), b_finish: 1.10 (0.3%), tests_pri_0: 212 (54.8%), check_dkim_signature: 0.61 (0.2%), check_dkim_adsp: 2.7 (0.7%), poll_dns_idle: 0.84 (0.2%), tests_pri_10: 2.9 (0.8%), tests_pri_500: 14 (3.7%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] fs: use kvmalloc for big coredump file 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 Adding Oleg as well. Al Viro writes: > On Sun, Sep 18, 2022 at 10:29:10AM +0800, Zhaoyang Huang wrote: >> loop Eric W >> >> On Tue, Aug 30, 2022 at 2:56 PM zhaoyang.huang >> wrote: >> > >> > From: Zhaoyang Huang >> > >> > High order page allocation observed which even introduce kernel panic when generating >> > coredump file, use kvmalloc_array instead of kmalloc_array > > Frankly, I would rather cap argc here - if you are trying to feed that many arguments > to your userland helper, your core_pattern is probably bogus. Yes. More than 512 arguments seems ridiculous. I only count 16 different values that can be place in corename so frankly a cap of about 20 seems sensible. I would suggest counting the number of spaces in core pattern and not allowing it to be set if the result would be more than "PAGE_SIZE/sizeof(void *)" arguments. I would reduce that by one more argument so that helper_argv is completely unnecessary. Unless I am misreading something the only reason for helper_argv is to add a NULL at the end of the argv array. It should be no problem to have format_corename do that work as well. If you have a real world case where that is a problem please post the useful corepattern so that we can stare in disbelief and finally come around to figuring out how to support such a core pattern. Thank you, Eric