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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0819CC3DA7A for ; Fri, 6 Jan 2023 19:20:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231376AbjAFTUD (ORCPT ); Fri, 6 Jan 2023 14:20:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjAFTUA (ORCPT ); Fri, 6 Jan 2023 14:20:00 -0500 Received: from domac.alu.hr (domac.alu.unizg.hr [IPv6:2001:b68:2:2800::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58DF373E26; Fri, 6 Jan 2023 11:19:58 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id CFD22604F1; Fri, 6 Jan 2023 20:19:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1673032795; bh=aw5exVyI+B1u4awEJxlKl0A6jA33w5svmejfQDbjXXU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fsS0PTItehDbTzAuBqsAJGEQ4ebd82LRT0cnz8rr4jpF5twqDAxZ6zhM2NPSTsNs8 jNKsK9t4CIwqXprmYJOGb4zyzDPYtGTBLTFimvag8kYBT+hIRbQBu2Eo8vDm8MwSNR RukvZWAIazPM0Zj/PB2+BiRy3bvziAYB9tGP+ZM4SUERLWc5GTnQ/cr3IFj7xOjXh9 IakgNvAwV39fwpf4Tw5CIt76X2Y/L9gQUO+d6pdJRqv421ZfXk71/5qasNROnKyrAJ NkKvFrRuuAO+AzldI7NlIKUPBrAADf4N31E8VNbrdjV8XMr5YLLyNUq9sevlnoTgn9 QT7uOo3nXf4Rw== X-Virus-Scanned: Debian amavisd-new at domac.alu.hr Received: from domac.alu.hr ([127.0.0.1]) by localhost (domac.alu.hr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ea3YROiPfPs6; Fri, 6 Jan 2023 20:19:53 +0100 (CET) Received: from [192.168.0.12] (unknown [188.252.196.35]) by domac.alu.hr (Postfix) with ESMTPSA id 301E2604F0; Fri, 6 Jan 2023 20:19:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1673032793; bh=aw5exVyI+B1u4awEJxlKl0A6jA33w5svmejfQDbjXXU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IZbQNO3oYDirik5HMt0cBpp+qDMKUT8+zZCWbupoFsHb3zMbrS9hniLGTloNWdwEB VeVUrFWTlltr9Af2uD18ZMUbh/7mb8NFsWRTEjAhoSqeUPiUi6PkJ8GD3j4Z/X7QDc +BZajV0blBzJWO44rbWoex2rNuYUxP79VO47dLUFIUFNVKGwzysMu8sbdIMjuW6dFd CGlnT1n8ZF8S0wgIefrUzNCdQz8wBpiOrlW6lJ7kzqqzVdWWDXIJ8rqmy4hfB3rAub b/7YzqSD+E1471nh9MVmQ9gYXRJKIzrRjyXQSc3LdxKOn8z5fN/Y/mkcU0Ed03Qzzo K+9K2OqIeTRXA== Message-ID: <1b8abfbb-d589-0b2b-c7a1-6e92d628fbdf@alu.unizg.hr> Date: Fri, 6 Jan 2023 20:19:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH selftest/net/af_unix 1/1] Fix size of parameter to connect() Content-Language: en-US, hr To: Kuniyuki Iwashima Cc: davem@davemloft.net, edumazet@google.com, fw@strlen.de, kuba@kernel.org, kuniyu@amazon.co.jp, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, shuah@kernel.org References: <20230106175828.13333-1-kuniyu@amazon.com> From: Mirsad Goran Todorovac In-Reply-To: <20230106175828.13333-1-kuniyu@amazon.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 06. 01. 2023. 18:58, Kuniyuki Iwashima wrote: > Hi, > > Thanks for the patch. Thank you for your quick review. I had to do the homework before replying. > 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 complete result according to the guidelines will be in the followup email. >> 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. I have tested the patch against net.git, and it is a verbatim copy (tested by diff). > 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() Got it. Will do in the followup email. > 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. Sure. >> 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 OK. >> 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