Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp257625rdd; Wed, 22 Nov 2023 15:21:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEZdJP5FI8wNMJSA9O/xAEbedR1EY0SY6Bg1zlJ4G3OF1qZMKs6Dyb2xmsDglW7KoTnH7q X-Received: by 2002:a17:90b:3803:b0:280:6296:3d96 with SMTP id mq3-20020a17090b380300b0028062963d96mr4117506pjb.41.1700695312917; Wed, 22 Nov 2023 15:21:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700695312; cv=none; d=google.com; s=arc-20160816; b=1KGPnL4Flhg0uQVeeMR+r7PKiCYmpL0AaJVDYwdGGmwViil5fiJv1yNl5yewL34/z0 BslafD1NE2CYKeheVeTBklYP6cQ5WndX9AQ+YZfcvlVXCW1D8lyVMLCQec62dSa2ndrh Ncf24RYltctr7ShdlJN/w3aSqD2STaLK1u25qpb3bpL6yWKEFix4wAyL8K/miyud4bU9 nFcbu8gTRdf6VemJxhOIUzfEzdHet56pRmZVODcPBqUoIgYySu7GRJs7QgmO7ZksGPr2 k2pmArtdRd9NMgYDScZjVQN4ePLIGXgsvnzmkmjnv65+dcFidETuT1yZ8TtFT6QgwJee R0qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=GPMOu3RwXvdNF1lex8uVrfBtqsdOW8GQT2GT8OxuKyU=; fh=Qbk0RS4bf6GjbhGkpgFoVgYg5V+1DfWcZ6CAErfO2MQ=; b=Key9Op0I79k2kZ9dWLnwqNyUXdUJBFU7cFZ7UgpE6ttqEYxdKaTR9OAOIE6tAYhbCN cMQ7Ff2w2dNKZnCDObPq5oyivmgoEvGjidvKvz+aZiSKtoUETjftvGQ3NYlc/M5XtLPD Ams//bJ6rPMfiMciJzsra2q4uH4D3fAq+D/wam5dCnVkXwwa4ifZyWBu5te97ku6VBVr O7sq9O9n66IKGpyzEP3ZtqBGrQsdDksNyXtz//PPYf34mdDrw4hsGKXqFsNM5aWiI8rD U1P/q1OLTOWTy3/48nHevNEHoNaezT8OuG/5X7iNvMEqXNrfgfoXjt0gQidZGaQX3rk3 KURw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=A+DzyIWo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id b5-20020a170902650500b001c4743e4a60si418034plk.197.2023.11.22.15.21.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 15:21:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=A+DzyIWo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2DE91837FA3D; Wed, 22 Nov 2023 15:21:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232953AbjKVXVe (ORCPT + 99 others); Wed, 22 Nov 2023 18:21:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjKVXVc (ORCPT ); Wed, 22 Nov 2023 18:21:32 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45654110; Wed, 22 Nov 2023 15:21:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1700695286; bh=UvTHVLrVS7yXSVngtpUNw0aaFtisHMdv5IagkHAb8Vw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=A+DzyIWop9H1iQqC4wC7ZOx+e18wBfsDCs2oqTHFLJYmu3W02n86u+DegEehx1vo5 zPnK5LHg5A1Gg9qKYUcvDua/04K/8lWDki8Nk6Hw6ybKKJJvjWzvlD3ht04llm2dg3 vqI0+I1UGmluY0dWiW/xLGaKI5pZkkW/27NZjQjk= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 23 Nov 2023 00:21:27 +0100 Subject: [PATCH 3/3] selftests/nolibc: disable coredump via setrlimit MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231123-nolibc-rlimit-v1-3-a428b131de2a@weissschuh.net> References: <20231123-nolibc-rlimit-v1-0-a428b131de2a@weissschuh.net> In-Reply-To: <20231123-nolibc-rlimit-v1-0-a428b131de2a@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1700695285; l=1257; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=UvTHVLrVS7yXSVngtpUNw0aaFtisHMdv5IagkHAb8Vw=; b=6KaZT5arNtlQH/G4RUsDPzhaYavmO+ntu3wPDXuPTC1+AZtPQ7oKArk9dQd3zjNeWdHEh79kF 0mI+PGBl1gJASvDvJ1nsyTFpMpIFBc+504WY/LcH19X3N09dwik+7xk X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 22 Nov 2023 15:21:45 -0800 (PST) qemu-user does has its own implementation of coredumping. That implementation does not respect the call to prctl(PR_SET_DUMPABLE, 0) in run_protection(). This leads to a coredump for every test run under qemu-user. Use also setrlimit() to inhibit coredump creation which is respected by qemu-user. Link: https://lore.kernel.org/qemu-devel/20231115-qemu-user-dumpable-v1-2-edbe7f0fbb02@t-8ch.de/ Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index d07cebace107..ccb8d017a3e7 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -1167,6 +1167,7 @@ static int run_protection(int min __attribute__((unused)), { pid_t pid; int llen = 0, status; + struct rlimit rlimit = { 0, 0 }; llen += printf("0 -fstackprotector "); @@ -1198,6 +1199,7 @@ static int run_protection(int min __attribute__((unused)), close(STDERR_FILENO); prctl(PR_SET_DUMPABLE, 0, 0, 0, 0); + setrlimit(RLIMIT_CORE, &rlimit); smash_stack(); return 1; -- 2.43.0