Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2799199rwl; Fri, 6 Jan 2023 10:58:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXtxvXaTZO0lo7DlW1wCVeXQdBjgk12pWaDt6ppv8iPcu/8hkZtLDotSQiEPKKg4+loj9p5I X-Received: by 2002:a05:6a20:9391:b0:ad:2f8b:ed7c with SMTP id x17-20020a056a20939100b000ad2f8bed7cmr88434261pzh.56.1673031526487; Fri, 06 Jan 2023 10:58:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673031526; cv=none; d=google.com; s=arc-20160816; b=NY4FhrxYWwAGjHuG9XWHg0hHre5V+qcOPHIfX30+8QT0bl7NCRDlPOgpRwWp/D+FDW wp3xfOiPyFLivwgTEaESg8oCYwpjyO9gS6pX2xWnFfJliqW1ZgSPn7h4fhT0CsHSO1DN wPqV7Kj5tkdvqAyhbuKhASjpJIX0DAyuRgzcvAn9GP+HbpyZS+AYCTi+rhol1nV2qp7T tpA8q/A6k7KchhPvshc7blXZMbkSKVRojRmnqBPC2RKrq1qqms8pXBZdyoiihcOVZXGg US2PeHj1rneNlqM5Uh8mue9f81AEvppo7Ap1tyP594gZq232fphAHY/hosN7KvtzFNQQ ThGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=v0c5rS0g/FP0JyphM1OQziPGtUPHcAvofBABcEmtwE4=; b=iuIGFq/LamRuZchiB+YHK05S/mEAfUlUAg7QnrVgsoWrG8LA4pCl/u6G7kWeITe+jE UPNvVfc3cGUZEdJmzBYt3nnhqD/5zaCfCLR2Po8hRmEP7S133emRVrbW2i6Nyj5/whX5 j//Enzf0dCKMhhn7TbsWcMFk0DilZIt1AMaOigQAGljAP3TRYK4RP6GRLqmfzkJF6pQZ OuOR8RoE00u+RQtyUcMG/B82Dq3+H0USNDDL78dxTLi4GTMrD2tm1paGOEDKu0e8zQXS GwosuWeCOnagr9RA3texud7GewliI3AZrub9Lo4ec+UIGzNjuuMjPGmkLWkfgNoFvw3+ T+XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=AdE1c8Qj; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a63104a000000b0046f71a7292dsi1802241pgq.384.2023.01.06.10.58.39; Fri, 06 Jan 2023 10:58:46 -0800 (PST) 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; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=AdE1c8Qj; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233616AbjAFR7R (ORCPT + 54 others); Fri, 6 Jan 2023 12:59:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231450AbjAFR6u (ORCPT ); Fri, 6 Jan 2023 12:58:50 -0500 Received: from smtp-fw-6002.amazon.com (smtp-fw-6002.amazon.com [52.95.49.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEA277D9FE; Fri, 6 Jan 2023 09:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1673027929; x=1704563929; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v0c5rS0g/FP0JyphM1OQziPGtUPHcAvofBABcEmtwE4=; b=AdE1c8QjeXq8igaxbbsmupelOOVfZn1yKZRkgXp3HwYHJ+UPMwYpF3dv wMl1IDZi2hIfv9UlhNxjvJa650tPMhaM0O4HBA1qBVqz4UKjpiA9F1p+x 7HJIFJicvC/FqsiAjORuOqxjU2kZeVP9w0omjDoh3J4bCs5kFwLtuxYY4 4=; X-IronPort-AV: E=Sophos;i="5.96,306,1665446400"; d="scan'208";a="284118343" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-2b-m6i4x-0ec33b60.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2023 17:58:45 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2b-m6i4x-0ec33b60.us-west-2.amazon.com (Postfix) with ESMTPS id 1109AA2DC8; Fri, 6 Jan 2023 17:58:41 +0000 (UTC) Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 17:58:41 +0000 Received: from 88665a182662.ant.amazon.com (10.43.160.83) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.7; Fri, 6 Jan 2023 17:58:36 +0000 From: Kuniyuki Iwashima To: CC: , , , , , , , , , , Subject: [PATCH selftest/net/af_unix 1/1] Fix size of parameter to connect() Date: Sat, 7 Jan 2023 02:58:28 +0900 Message-ID: <20230106175828.13333-1-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.43.160.83] X-ClientProxiedBy: EX13D41UWB004.ant.amazon.com (10.43.161.135) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,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 Hi, Thanks for the patch. From: Mirsad Goran Todorovac Date: Fri, 6 Jan 2023 18:18:58 +0100 > From: Mirsad Goran Todorovac > > Adjust size parameter in connect() to match the type of the parameter, to fix "No such file or directory" > error in selftests/net/af_unix/test_oob_unix.c:127. Could you wrap the changelog to 75 chars except for log (strace below) ? checkpatch.pl will help. $ git show HEAD --format=email | ./scripts/checkpatch.pl > > The existing code happens to work provided that the autogenerated pathname is shorter than > sizeof (struct sockaddr), which is why it hasn't been noticed earlier. > > Visible from the trace excerpt: > > bind(3, {sa_family=AF_UNIX, sun_path="unix_oob_453059"}, 110) = 0 > clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fa6a6577a10) = 453060 > [pid ] connect(6, {sa_family=AF_UNIX, sun_path="unix_oob_45305"}, 16) = -1 ENOENT (No such file or directory) > > BUG: The filename is trimmed to sizeof (struct sockaddr). > > The patch is generated against the "vanilla" torvalds mainline tree 6.2-rc2. Every patch that fixes networking code has to be applied cleanly on net.git. https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/ But the patch can not be applied to net.git. Could you check this ? https://patchwork.kernel.org/project/netdevbpf/patch/bd7ff00a-6892-fd56-b3ca-4b3feb6121d8@alu.unizg.hr/ Also, the mail title should be [PATCH Tree Version Nth/Total] subsystem: Description. Next time, Tree is net and Version is v2, and we need not write 1/1, so the subject should be [PATCH net v2] af_unix: selftest: Fix size of parameter to connect() Please see here for details. https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/Documentation/process/maintainer-netdev.rst > > Thanks and regards, > Mirsad Todorovac You can remove these lines. > > Reported-by: Mirsad Goran Todorovac In this case, you are the reporter and the author of the patch, so the Reported-by tag is not needed. Instead, you have to add your SOB tag. Signed-off-by: Mirsad Goran Todorovac > Cc: "David S. Miller" > Cc: Eric Dumazet > Cc: Jakub Kicinski > Cc: Paolo Abeni > Cc: Shuah Khan > Cc: Kuniyuki Iwashima > Cc: Florian Westphal > Reviewed-by: Florian Westphal Please add Fixes tag as I said here. https://lore.kernel.org/netdev/20230103111335.81600-1-kuniyu@amazon.com/#r Thank you, Kuniyuki > > --- > tools/testing/selftests/net/af_unix/test_unix_oob.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/net/af_unix/test_unix_oob.c b/tools/testing/selftests/net/af_unix/test_unix_oob.c > index b57e91e1c3f2..532459a15067 100644 > --- a/tools/testing/selftests/net/af_unix/test_unix_oob.c > +++ b/tools/testing/selftests/net/af_unix/test_unix_oob.c > @@ -124,7 +124,7 @@ void producer(struct sockaddr_un *consumer_addr) > > wait_for_signal(pipefd[0]); > if (connect(cfd, (struct sockaddr *)consumer_addr, > - sizeof(struct sockaddr)) != 0) { > + sizeof(*consumer_addr)) != 0) { > perror("Connect failed"); > kill(0, SIGTERM); > exit(1); > > -- > Mirsad Goran Todorovac > Sistem inženjer > Grafički fakultet | Akademija likovnih umjetnosti > Sveučilište u Zagrebu > -- > System engineer > Faculty of Graphic Arts | Academy of Fine Arts > University of Zagreb, Republic of Croatia > The European Union