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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25ECCC10F1A for ; Tue, 7 May 2024 16:36:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B29C36B009A; Tue, 7 May 2024 12:36:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD96E6B009B; Tue, 7 May 2024 12:36:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97A996B009C; Tue, 7 May 2024 12:36:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 726F96B009A for ; Tue, 7 May 2024 12:36:22 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1CE53A03DF for ; Tue, 7 May 2024 16:36:22 +0000 (UTC) X-FDA: 82092152604.05.6FC9B8C Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) by imf18.hostedemail.com (Postfix) with ESMTP id 6460E1C0006 for ; Tue, 7 May 2024 16:36:20 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kE3C8D8s; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of allen.lkml@gmail.com designates 209.85.217.45 as permitted sender) smtp.mailfrom=allen.lkml@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715099780; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OIH6aQmwwJHXxsNaL1gpFbq6JK/4rTlX3KH1VdDetm8=; b=PWTzGBAkEWd6xrkbc2knLV3s5C4YhvSU6cwwkYiXLYIH+HmL2iKvTpplcbjOfjns0ncdWA rmHfKZJKy9zu5fPsOqP2K1h/+r4wq4dBWT4x5FpjpJpCefmfsySCAa8U0iTDXlmzqEKXk0 y08xJHtnQwM/rPE0vTWsXEtyoEpESt8= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kE3C8D8s; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of allen.lkml@gmail.com designates 209.85.217.45 as permitted sender) smtp.mailfrom=allen.lkml@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715099780; a=rsa-sha256; cv=none; b=D1LDp6DUd9yv0Filt7wBEQhyB5HaQzpEERrA2ZYEjrxkaVxA1f/6wj+JlwcS89yAE3ZdUd 1f1RsAJxC3K4lV0PSeN0UFHsfPXlnOHtxZuXZCmxYIV+OXtlq9Eoi7AVZ6A4NiV6arepYt ei6USJbr4xuMyLWUr/82LmCROZltg8s= Received: by mail-vs1-f45.google.com with SMTP id ada2fe7eead31-47eec1bef2aso751255137.2 for ; Tue, 07 May 2024 09:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715099779; x=1715704579; darn=kvack.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OIH6aQmwwJHXxsNaL1gpFbq6JK/4rTlX3KH1VdDetm8=; b=kE3C8D8s19N15ngCP09vE1k5HoTv8Lmjjo4ZThvXLbk5RvNem/M+hhBa+S2wBSQr0D 3G+FOvMR8JzjDzJFELGwyvSfI+icuSuz8PZnWzHBRwsIySuwIXmZ8o0AO2SAFD7kdLe3 B4q/RrznxMofCdZ+Z2Gi1MgMHHWEVzrs530xmxiYtG0mrlv+8hHOtt8uL0LkeVPTXiQD S84N0vV3iYm3v+h+khJdz0XhxmosPSp9F09Lixka+OQt0xaDkE1Z+ZyA1vK2QVddp7Cq SHYGlIjNy53XN40KEbfv+orkXqetwZPmzLLjjegVovwsurFSP6fblo9uiY+Eo7ze/umy xjmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099779; x=1715704579; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OIH6aQmwwJHXxsNaL1gpFbq6JK/4rTlX3KH1VdDetm8=; b=mMvYShAswMA2cIKs0B2zduqP35EopQRLVkcHSESl4YJUGdpB9GeDqszQJh1EZCta5M YXhTC2xVhV7Q+H5dBZZ8cIUi+13DczzJrBYDeBgqaMlO58JXeeKjXNACTGnDghllKcvH 2DubB/vzbqPxeMFLGAomwd+Seu4joQowZC8rIDgHtxrl6Aj3sBXgxbNyb/wO9vK1rS9Z 1ptAPxSnujEQTTzAe9Ty4z1/8mwuErboU5XAXXYBaQw3srtUwv8+7/D4001kLN+kQiZm h6s9LukNNIdY0hSXPrd1Ih0mywAwsqqYtuvmJWfUu5GPmz/J4S9E7Q/4+TIPDo764raD s6mw== X-Forwarded-Encrypted: i=1; AJvYcCXsY9EBLa/asK3wolJfrAyLqNSyC21xfvIXbilhYIBNLnxDbjkk0seJRjdmQF72BWW3m/N1vLVHDk4N/FUfthp0HiU= X-Gm-Message-State: AOJu0YxPz1t7o6Z8g6Q4S8SD7JP/bVWfp775KP82YrkPdkS2GtzFyrPa +Tnk6+K0E0AGp2nYOMZIIQQFILJj0VxV1J4JyiqEXOyViOV3Y7OMGbpcDPoUsI+XWDP8xG19w43 n5NIZS9aswRrvoSwifvkDaEZekWI= X-Google-Smtp-Source: AGHT+IFLE7o1q4yIV5QIpQ2zwnryVHkBTr8cvfHOkMi+4EMADqYRYKPCAK7R+jI7/0heAa0+ZJFW6vFupgJDauVUo2c= X-Received: by 2002:a67:f2ca:0:b0:47e:bd11:7e5e with SMTP id a10-20020a67f2ca000000b0047ebd117e5emr16136515vsn.7.1715099777915; Tue, 07 May 2024 09:36:17 -0700 (PDT) MIME-Version: 1.0 References: <20240506193700.7884-1-apais@linux.microsoft.com> <202405072249.fLkavX40-lkp@intel.com> In-Reply-To: <202405072249.fLkavX40-lkp@intel.com> From: Allen Date: Tue, 7 May 2024 09:36:06 -0700 Message-ID: Subject: Re: [PATCH v4] fs/coredump: Enable dynamic configuration of max file note size To: kernel test robot Cc: Allen Pais , linux-fsdevel@vger.kernel.org, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, ebiederm@xmission.com, keescook@chromium.org, mcgrof@kernel.org, j.granados@samsung.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 6460E1C0006 X-Stat-Signature: wdt75a9ugqt4r83e1njxxd5assupqceb X-Rspam-User: X-HE-Tag: 1715099780-865293 X-HE-Meta: U2FsdGVkX1//UiGfz+1E+9Ae0tyut4ovCuoO7YF8oMQFCzDNkx8BBrhuDU0cyLqCFZK1UKFXxJr0bIeCYHV1RXy9yg3qCBzu7XHGQnq0NrYN8jsZU5D19ycT1HdjPRrQSNmUA6Zb7/4szxfVPtxTa0jpfKKZxo7Y327K+fNxkiRRAjT4O6JM/Ph8WibkGucn+e2fyAxMRWo3PJTyCYIWsnfZCJGWS3/15V3OWRKp9MBiL7iIU5g/tUJPG+oUSW+LLbFgNhXcxqysAz4PmpoEuRNiFx1gQe+9nkCG+otNZfeKCpeoHc8IdxkY9P2cv+rg4CkpUf3VMfdKmDi/6XYnUby/4w65nVJExtoOP267mm7IbKnjjRcHaA5EtC5irMfmL3Wa/yjs0jx8yBjCjxu1BFPDAb2nv21dhJZm5OeCUcyJ53zmPP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cjYyxezeTSYj1I3HatAzoRezKgeES6VPRxybqzds+zspS/rYQ8+OD3ocvjz6iRzqWv0ZxYHGVv/PTvkzDjCw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: > > kernel test robot noticed the following build errors: > > [auto build test ERROR on kees/for-next/execve] > [also build test ERROR on brauner-vfs/vfs.all linus/master v6.9-rc7 next-20240507] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Allen-Pais/fs-coredump-Enable-dynamic-configuration-of-max-file-note-size/20240507-033907 > base: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve > patch link: https://lore.kernel.org/r/20240506193700.7884-1-apais%40linux.microsoft.com > patch subject: [PATCH v4] fs/coredump: Enable dynamic configuration of max file note size > config: loongarch-randconfig-001-20240507 (https://download.01.org/0day-ci/archive/20240507/202405072249.fLkavX40-lkp@intel.com/config) > compiler: loongarch64-linux-gcc (GCC) 13.2.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240507/202405072249.fLkavX40-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-kbuild-all/202405072249.fLkavX40-lkp@intel.com/ > Thanks for reporting. The kernel builds fine with https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve. The issue is with loongarch-randconfig, which has CONFIG_SYSCTL set to "n". It is needed for this patch. Thanks, Allen > All errors (new ones prefixed by >>): > > fs/binfmt_elf.c: In function 'fill_files_note': > >> fs/binfmt_elf.c:1598:21: error: 'core_file_note_size_min' undeclared (first use in this function) > 1598 | if (size >= core_file_note_size_min) { > | ^~~~~~~~~~~~~~~~~~~~~~~ > fs/binfmt_elf.c:1598:21: note: each undeclared identifier is reported only once for each function it appears in > > > vim +/core_file_note_size_min +1598 fs/binfmt_elf.c > > 1569 > 1570 /* > 1571 * Format of NT_FILE note: > 1572 * > 1573 * long count -- how many files are mapped > 1574 * long page_size -- units for file_ofs > 1575 * array of [COUNT] elements of > 1576 * long start > 1577 * long end > 1578 * long file_ofs > 1579 * followed by COUNT filenames in ASCII: "FILE1" NUL "FILE2" NUL... > 1580 */ > 1581 static int fill_files_note(struct memelfnote *note, struct coredump_params *cprm) > 1582 { > 1583 unsigned count, size, names_ofs, remaining, n; > 1584 user_long_t *data; > 1585 user_long_t *start_end_ofs; > 1586 char *name_base, *name_curpos; > 1587 int i; > 1588 > 1589 /* *Estimated* file count and total data size needed */ > 1590 count = cprm->vma_count; > 1591 if (count > UINT_MAX / 64) > 1592 return -EINVAL; > 1593 size = count * 64; > 1594 > 1595 names_ofs = (2 + 3 * count) * sizeof(data[0]); > 1596 alloc: > 1597 /* paranoia check */ > > 1598 if (size >= core_file_note_size_min) { > 1599 pr_warn_once("coredump Note size too large: %u (does kernel.core_file_note_size_min sysctl need adjustment?\n", > 1600 size); > 1601 return -EINVAL; > 1602 } > 1603 size = round_up(size, PAGE_SIZE); > 1604 /* > 1605 * "size" can be 0 here legitimately. > 1606 * Let it ENOMEM and omit NT_FILE section which will be empty anyway. > 1607 */ > 1608 data = kvmalloc(size, GFP_KERNEL); > 1609 if (ZERO_OR_NULL_PTR(data)) > 1610 return -ENOMEM; > 1611 > 1612 start_end_ofs = data + 2; > 1613 name_base = name_curpos = ((char *)data) + names_ofs; > 1614 remaining = size - names_ofs; > 1615 count = 0; > 1616 for (i = 0; i < cprm->vma_count; i++) { > 1617 struct core_vma_metadata *m = &cprm->vma_meta[i]; > 1618 struct file *file; > 1619 const char *filename; > 1620 > 1621 file = m->file; > 1622 if (!file) > 1623 continue; > 1624 filename = file_path(file, name_curpos, remaining); > 1625 if (IS_ERR(filename)) { > 1626 if (PTR_ERR(filename) == -ENAMETOOLONG) { > 1627 kvfree(data); > 1628 size = size * 5 / 4; > 1629 goto alloc; > 1630 } > 1631 continue; > 1632 } > 1633 > 1634 /* file_path() fills at the end, move name down */ > 1635 /* n = strlen(filename) + 1: */ > 1636 n = (name_curpos + remaining) - filename; > 1637 remaining = filename - name_curpos; > 1638 memmove(name_curpos, filename, n); > 1639 name_curpos += n; > 1640 > 1641 *start_end_ofs++ = m->start; > 1642 *start_end_ofs++ = m->end; > 1643 *start_end_ofs++ = m->pgoff; > 1644 count++; > 1645 } > 1646 > 1647 /* Now we know exact count of files, can store it */ > 1648 data[0] = count; > 1649 data[1] = PAGE_SIZE; > 1650 /* > 1651 * Count usually is less than mm->map_count, > 1652 * we need to move filenames down. > 1653 */ > 1654 n = cprm->vma_count - count; > 1655 if (n != 0) { > 1656 unsigned shift_bytes = n * 3 * sizeof(data[0]); > 1657 memmove(name_base - shift_bytes, name_base, > 1658 name_curpos - name_base); > 1659 name_curpos -= shift_bytes; > 1660 } > 1661 > 1662 size = name_curpos - (char *)data; > 1663 fill_note(note, "CORE", NT_FILE, size, data); > 1664 return 0; > 1665 } > 1666 > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests/wiki -- - Allen