{"id":2231426,"url":"http://patchwork.ozlabs.org/api/patches/2231426/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/patch/20260430-safe_splice-v1-1-d1d919ff2a3a@suse.com/","project":{"id":59,"url":"http://patchwork.ozlabs.org/api/projects/59/?format=json","name":"Linux Test Project development","link_name":"ltp","list_id":"ltp.lists.linux.it","list_email":"ltp@lists.linux.it","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260430-safe_splice-v1-1-d1d919ff2a3a@suse.com>","list_archive_url":null,"date":"2026-04-30T17:25:29","name":"[1/2] lib: Add SAFE_SPLICE() macro","commit_ref":null,"pull_url":null,"state":"needs-review-ack","archived":false,"hash":"87d4556769c6d70e620c58e54bef58518f495e10","submitter":{"id":83220,"url":"http://patchwork.ozlabs.org/api/people/83220/?format=json","name":"Andrea Cervesato","email":"andrea.cervesato@suse.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ltp/patch/20260430-safe_splice-v1-1-d1d919ff2a3a@suse.com/mbox/","series":[{"id":502349,"url":"http://patchwork.ozlabs.org/api/series/502349/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/list/?series=502349","date":"2026-04-30T17:25:29","name":"Introduce SAFE_SPLICE()","version":1,"mbox":"http://patchwork.ozlabs.org/series/502349/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2231426/comments/","check":"fail","checks":"http://patchwork.ozlabs.org/api/patches/2231426/checks/","tags":{},"related":[],"headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=EtowRRcT;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.de\n header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=CBx+hCfN;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa\n header.b=EtowRRcT;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=CBx+hCfN;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=213.254.12.146; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)","smtp-out2.suse.de;\n\tnone"],"Received":["from picard.linux.it (picard.linux.it [213.254.12.146])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g61KF44KVz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 03:25:37 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id D7D1C3E21C6\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 19:25:34 +0200 (CEST)","from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 094833E1BEC\n for <ltp@lists.linux.it>; Thu, 30 Apr 2026 19:25:31 +0200 (CEST)","from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 6B7B120118E\n for <ltp@lists.linux.it>; Thu, 30 Apr 2026 19:25:31 +0200 (CEST)","from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out2.suse.de (Postfix) with ESMTPS id B602A5BD76;\n Thu, 30 Apr 2026 17:25:30 +0000 (UTC)","from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 96B7B593B1;\n Thu, 30 Apr 2026 17:25:30 +0000 (UTC)","from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id YJY2I4qQ82kMIQAAD6G6ig\n (envelope-from <andrea.cervesato@suse.de>); Thu, 30 Apr 2026 17:25:30 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1777569930;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=qi7kf9XmY+t2/F9XBmXW0W3CfhM2YHbAQErs1toBJ7A=;\n b=EtowRRcTmh4rKnirnRBQcQYNM4dxMtZQhWifAEumenn/ybN3UUcG5UO8ykoYBoBCwVceyz\n IMw0kmInl1WaSAoNUIhRe2ZBx38NnxfLRElCEyEKmYa7bXi4Z3lX6ML/0uf+GD01FusJ58\n Qa/L0a0ur8Ll6QObzOD1XcxRHlPbwd0=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1777569930;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=qi7kf9XmY+t2/F9XBmXW0W3CfhM2YHbAQErs1toBJ7A=;\n b=CBx+hCfN17xnErGDp7p6D0iH9vcdpHAGRi7h9hUR3j6l/Iwr2fpp7SGQPlcr188leM7u5k\n VolaFqw9mz4TvSBw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1777569930;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=qi7kf9XmY+t2/F9XBmXW0W3CfhM2YHbAQErs1toBJ7A=;\n b=EtowRRcTmh4rKnirnRBQcQYNM4dxMtZQhWifAEumenn/ybN3UUcG5UO8ykoYBoBCwVceyz\n IMw0kmInl1WaSAoNUIhRe2ZBx38NnxfLRElCEyEKmYa7bXi4Z3lX6ML/0uf+GD01FusJ58\n Qa/L0a0ur8Ll6QObzOD1XcxRHlPbwd0=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1777569930;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=qi7kf9XmY+t2/F9XBmXW0W3CfhM2YHbAQErs1toBJ7A=;\n b=CBx+hCfN17xnErGDp7p6D0iH9vcdpHAGRi7h9hUR3j6l/Iwr2fpp7SGQPlcr188leM7u5k\n VolaFqw9mz4TvSBw=="],"From":"Andrea Cervesato <andrea.cervesato@suse.de>","Date":"Thu, 30 Apr 2026 19:25:29 +0200","MIME-Version":"1.0","Message-Id":"<20260430-safe_splice-v1-1-d1d919ff2a3a@suse.com>","References":"<20260430-safe_splice-v1-0-d1d919ff2a3a@suse.com>","In-Reply-To":"<20260430-safe_splice-v1-0-d1d919ff2a3a@suse.com>","To":"Linux Test Project <ltp@lists.linux.it>","X-Mailer":"b4 0.14.2","X-Developer-Signature":"v=1; a=ed25519-sha256; t=1777569930; l=2390;\n i=andrea.cervesato@suse.com; s=20251210; h=from:subject:message-id;\n bh=OKqSZ6LXj6H7kjfhRSTFZV6P69iuPY1CYnybsY3NAK8=;\n b=b02Nioc1A28NB6wpZuFBaf6NjDpYvoIyo/zMiEUhlgH4suEO6vCE0/1mBQJs7lN0Cwr8Yu+kW\n HOGKR1ETishDa3nNwESIbngufEH16dj3Ae9FEtD+Q4qoIomdjOikUn+","X-Developer-Key":"i=andrea.cervesato@suse.com; a=ed25519;\n pk=zKY+6GCauOiuHNZ//d8PQ/UL4jFCTKbXrzXAOQSLevI=","X-Spam-Score":"-4.30","X-Spam-Level":"","X-Spamd-Result":"default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000];\n NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain];\n FUZZY_RATELIMITED(0.00)[rspamd.com];\n RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[];\n RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n TO_DN_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+];\n FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n RCVD_COUNT_TWO(0.00)[2];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid, suse.com:email,\n imap1.dmz-prg2.suse.org:helo]","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-7.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-7.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"[LTP] [PATCH 1/2] lib: Add SAFE_SPLICE() macro","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"},"content":"From: Andrea Cervesato <andrea.cervesato@suse.com>\n\nsplice() is used as utility plumbing in several tests (tee01,\nvmsplice01, af_alg08) but lacks a SAFE_* wrapper, forcing each\ncaller to manually check the return value. Add SAFE_SPLICE()\nfollowing the existing safe_pipe2() pattern.\n\nSigned-off-by: Andrea Cervesato <andrea.cervesato@suse.com>\n---\n include/tst_safe_macros.h |  8 ++++++++\n lib/tst_safe_macros.c     | 17 +++++++++++++++++\n 2 files changed, 25 insertions(+)","diff":"diff --git a/include/tst_safe_macros.h b/include/tst_safe_macros.h\nindex c73c1acb1cbd671d4d22b740647d3e7491f7baf2..53caf845d1172cccf23d631d97e1f5086f98f547 100644\n--- a/include/tst_safe_macros.h\n+++ b/include/tst_safe_macros.h\n@@ -114,6 +114,14 @@ int safe_pipe2(const char *file, const int lineno, int fildes[2], int flags);\n #define SAFE_PIPE2(fildes, flags) \\\n \tsafe_pipe2(__FILE__, __LINE__, (fildes), (flags))\n \n+ssize_t safe_splice(const char *file, const int lineno,\n+\t\t    int fd_in, loff_t *off_in, int fd_out, loff_t *off_out,\n+\t\t    size_t len, unsigned int flags);\n+\n+#define SAFE_SPLICE(fd_in, off_in, fd_out, off_out, len, flags) \\\n+\tsafe_splice(__FILE__, __LINE__, (fd_in), (off_in), (fd_out), \\\n+\t\t    (off_out), (len), (flags))\n+\n #define SAFE_READ(len_strict, fildes, buf, nbyte) \\\n \tsafe_read(__FILE__, __LINE__, NULL, (len_strict), (fildes), (buf), (nbyte))\n \ndiff --git a/lib/tst_safe_macros.c b/lib/tst_safe_macros.c\nindex cdc8c7dd33cb0f805d40095b732d723497b2adeb..8f3dbbd1d2f371f2986356187c41007993f1589e 100644\n--- a/lib/tst_safe_macros.c\n+++ b/lib/tst_safe_macros.c\n@@ -21,6 +21,7 @@\n #include \"tst_safe_macros.h\"\n #include \"lapi/personality.h\"\n #include \"lapi/pidfd.h\"\n+#include \"lapi/splice.h\"\n \n int safe_access(const char *file, const int lineno,\n \t    const char *pathname, int mode)\n@@ -512,6 +513,22 @@ int safe_pipe2(const char *file, const int lineno, int fildes[2], int flags)\n \treturn ret;\n }\n \n+ssize_t safe_splice(const char *file, const int lineno,\n+\t\t    int fd_in, loff_t *off_in, int fd_out, loff_t *off_out,\n+\t\t    size_t len, unsigned int flags)\n+{\n+\tssize_t ret;\n+\n+\tret = splice(fd_in, off_in, fd_out, off_out, len, flags);\n+\n+\tif (ret < 0) {\n+\t\ttst_brk_(file, lineno, TBROK | TERRNO,\n+\t\t\t\"splice(%d, %d, %zu) failed\", fd_in, fd_out, len);\n+\t}\n+\n+\treturn ret;\n+}\n+\n int safe_dup(const char *file, const int lineno, int oldfd)\n {\n \tint rval;\n","prefixes":["1/2"]}