netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH selftest/net/af_unix 1/1] Fix size of parameter to connect()
@ 2023-01-06 17:18 Mirsad Goran Todorovac
  2023-01-06 17:58 ` Kuniyuki Iwashima
  0 siblings, 1 reply; 14+ messages in thread
From: Mirsad Goran Todorovac @ 2023-01-06 17:18 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Shuah Khan, Kuniyuki Iwashima, linux-kselftest, linux-kernel,
	Florian Westphal


From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>

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.

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 <child>] 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.

Thanks and regards,
Mirsad Todorovac

Reported-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Cc: Florian Westphal <fw@strlen.de>
Reviewed-by: Florian Westphal <fw@strlen.de>

---
  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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH selftest/net/af_unix 1/1] Fix size of parameter to connect()
  2023-01-06 17:18 [PATCH selftest/net/af_unix 1/1] Fix size of parameter to connect() Mirsad Goran Todorovac
@ 2023-01-06 17:58 ` Kuniyuki Iwashima
  2023-01-06 19:19   ` Mirsad Goran Todorovac
  2023-01-06 19:28   ` [PATCH net v2] af_unix: selftest: Fix the size of the " Mirsad Goran Todorovac
  0 siblings, 2 replies; 14+ messages in thread
From: Kuniyuki Iwashima @ 2023-01-06 17:58 UTC (permalink / raw)
  To: mirsad.todorovac
  Cc: davem, edumazet, fw, kuba, kuniyu, linux-kernel, linux-kselftest,
	netdev, pabeni, shuah, kuniyu

Hi,

Thanks for the patch.

From:   Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Date:   Fri, 6 Jan 2023 18:18:58 +0100
> From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
> 
> 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 <child>] 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 <mirsad.todorovac@alu.unizg.hr>

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 <mirsad.todorovac@alu.unizg.hr>


> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Shuah Khan <shuah@kernel.org>
> Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
> Cc: Florian Westphal <fw@strlen.de>
> Reviewed-by: Florian Westphal <fw@strlen.de>

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH selftest/net/af_unix 1/1] Fix size of parameter to connect()
  2023-01-06 17:58 ` Kuniyuki Iwashima
@ 2023-01-06 19:19   ` Mirsad Goran Todorovac
  2023-01-06 19:28   ` [PATCH net v2] af_unix: selftest: Fix the size of the " Mirsad Goran Todorovac
  1 sibling, 0 replies; 14+ messages in thread
From: Mirsad Goran Todorovac @ 2023-01-06 19:19 UTC (permalink / raw)
  To: Kuniyuki Iwashima
  Cc: davem, edumazet, fw, kuba, kuniyu, linux-kernel, linux-kselftest,
	netdev, pabeni, shuah

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 <mirsad.todorovac@alu.unizg.hr>
> Date:   Fri, 6 Jan 2023 18:18:58 +0100
>> From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
>>
>> 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 <child>] 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 <mirsad.todorovac@alu.unizg.hr>
> 
> 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 <mirsad.todorovac@alu.unizg.hr>

OK.

>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Jakub Kicinski <kuba@kernel.org>
>> Cc: Paolo Abeni <pabeni@redhat.com>
>> Cc: Shuah Khan <shuah@kernel.org>
>> Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
>> Cc: Florian Westphal <fw@strlen.de>
>> Reviewed-by: Florian Westphal <fw@strlen.de>
> 
> 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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH net v2] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-06 17:58 ` Kuniyuki Iwashima
  2023-01-06 19:19   ` Mirsad Goran Todorovac
@ 2023-01-06 19:28   ` Mirsad Goran Todorovac
  2023-01-07  0:14     ` Jakub Kicinski
  1 sibling, 1 reply; 14+ messages in thread
From: Mirsad Goran Todorovac @ 2023-01-06 19:28 UTC (permalink / raw)
  To: Kuniyuki Iwashima
  Cc: davem, edumazet, fw, kuba, kuniyu, linux-kernel, linux-kselftest,
	netdev, pabeni, shuah


From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>

Adjust size parameter in connect() to match the type of the parameter, to
fix the "No such file or directory" error in selftests/net/af_unix/
test_oob_unix.c:127.

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 <child>] 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.
(Tested to apply against net.git tree.)

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Cc: Florian Westphal <fw@strlen.de>
Reviewed-by: Florian Westphal <fw@strlen.de>
Fixes: 314001f0bf92 ("af_unix: Add OOB support")
Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>

---
  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);


--
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


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH net v2] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-06 19:28   ` [PATCH net v2] af_unix: selftest: Fix the size of the " Mirsad Goran Todorovac
@ 2023-01-07  0:14     ` Jakub Kicinski
  2023-01-07  1:37       ` [PATCH net v3] " Mirsad Goran Todorovac
  2023-01-07  1:42       ` [PATCH net v2] " Mirsad Goran Todorovac
  0 siblings, 2 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-07  0:14 UTC (permalink / raw)
  To: Mirsad Goran Todorovac
  Cc: Kuniyuki Iwashima, davem, edumazet, fw, kuniyu, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

On Fri, 6 Jan 2023 20:28:33 +0100 Mirsad Goran Todorovac wrote:
> The patch is generated against the "vanilla" torvalds mainline tree 6.2-rc2.
> (Tested to apply against net.git tree.)

This kind of info belongs outside of the commit message (under the 
--- line).

> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Shuah Khan <shuah@kernel.org>
> Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
> Cc: Florian Westphal <fw@strlen.de>
> Reviewed-by: Florian Westphal <fw@strlen.de>
> Fixes: 314001f0bf92 ("af_unix: Add OOB support")
> Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
> 

no new line here

> ---

still doesn't apply, probably because there are two email footers

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH net v3] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-07  0:14     ` Jakub Kicinski
@ 2023-01-07  1:37       ` Mirsad Goran Todorovac
  2023-01-07  1:42       ` [PATCH net v2] " Mirsad Goran Todorovac
  1 sibling, 0 replies; 14+ messages in thread
From: Mirsad Goran Todorovac @ 2023-01-07  1:37 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Kuniyuki Iwashima, davem, edumazet, fw, kuniyu, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah


From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>

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.

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 <child>] 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).

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Cc: Florian Westphal <fw@strlen.de>
Reviewed-by: Florian Westphal <fw@strlen.de>
Fixes: 314001f0bf92 ("af_unix: Add OOB support")
Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
---

The patch is generated against the "vanilla" Torvalds mainline tree 6.2-rc2.
(Tested against the net.git tree.)

  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


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH net v2] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-07  0:14     ` Jakub Kicinski
  2023-01-07  1:37       ` [PATCH net v3] " Mirsad Goran Todorovac
@ 2023-01-07  1:42       ` Mirsad Goran Todorovac
  2023-01-07  2:08         ` Jakub Kicinski
  1 sibling, 1 reply; 14+ messages in thread
From: Mirsad Goran Todorovac @ 2023-01-07  1:42 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Kuniyuki Iwashima, davem, edumazet, fw, kuniyu, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

On 07. 01. 2023. 01:14, Jakub Kicinski wrote:
> On Fri, 6 Jan 2023 20:28:33 +0100 Mirsad Goran Todorovac wrote:
>> The patch is generated against the "vanilla" torvalds mainline tree 6.2-rc2.
>> (Tested to apply against net.git tree.)
> 
> This kind of info belongs outside of the commit message (under the
> --- line).
> 
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Jakub Kicinski <kuba@kernel.org>
>> Cc: Paolo Abeni <pabeni@redhat.com>
>> Cc: Shuah Khan <shuah@kernel.org>
>> Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
>> Cc: Florian Westphal <fw@strlen.de>
>> Reviewed-by: Florian Westphal <fw@strlen.de>
>> Fixes: 314001f0bf92 ("af_unix: Add OOB support")
>> Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
>>
> 
> no new line here
> 
>> ---
> 
> still doesn't apply, probably because there are two email footers

Thank you for the guidelines to make your robots happy :), the next
time I will assume all these from start, provided that I find and
patch another bug or issue.

Thanks,
Mirsad

-- 
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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net v2] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-07  1:42       ` [PATCH net v2] " Mirsad Goran Todorovac
@ 2023-01-07  2:08         ` Jakub Kicinski
  2023-01-07  3:36           ` Mirsad Goran Todorovac
                             ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-07  2:08 UTC (permalink / raw)
  To: Mirsad Goran Todorovac
  Cc: Kuniyuki Iwashima, davem, edumazet, fw, kuniyu, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

On Sat, 7 Jan 2023 02:42:43 +0100 Mirsad Goran Todorovac wrote:
> > still doesn't apply, probably because there are two email footers  
> 
> Thank you for the guidelines to make your robots happy :), the next
> time I will assume all these from start, provided that I find and
> patch another bug or issue.

Ah, sorry, wrong assumption :S

Your email client converts tabs to spaces, that's the problem.

Could you try get send-email ?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net v2] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-07  2:08         ` Jakub Kicinski
@ 2023-01-07  3:36           ` Mirsad Goran Todorovac
  2023-01-07  3:40           ` [PATCH net v4] " Mirsad Goran Todorovac
  2023-01-08 21:30           ` [PATCH net v2] " Mirsad Goran Todorovac
  2 siblings, 0 replies; 14+ messages in thread
From: Mirsad Goran Todorovac @ 2023-01-07  3:36 UTC (permalink / raw)
  To: Jakub Kicinski, Mirsad Goran Todorovac
  Cc: Kuniyuki Iwashima, davem, edumazet, fw, kuniyu, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]

On Fri, 6 Jan 2023, Jakub Kicinski wrote:

> On Sat, 7 Jan 2023 02:42:43 +0100 Mirsad Goran Todorovac wrote:
> > > still doesn't apply, probably because there are two email footers  
> > 
> > Thank you for the guidelines to make your robots happy :), the next
> > time I will assume all these from start, provided that I find and
> > patch another bug or issue.
> 
> Ah, sorry, wrong assumption :S
> 
> Your email client converts tabs to spaces, that's the problem.
> 
> Could you try get send-email ?

Sorry, couldn't make git send-email nor mutt IMAP running at such a short 
notice.

I've chosen Alpine due to advice in Documentation/process/email-clients.rst

Hope that will work.

Thank you for your patience with guidelines for this patch.

Thanks,
Mirsad

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH net v4] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-07  2:08         ` Jakub Kicinski
  2023-01-07  3:36           ` Mirsad Goran Todorovac
@ 2023-01-07  3:40           ` Mirsad Goran Todorovac
  2023-01-09  1:15             ` Kuniyuki Iwashima
  2023-01-09  8:20             ` patchwork-bot+netdevbpf
  2023-01-08 21:30           ` [PATCH net v2] " Mirsad Goran Todorovac
  2 siblings, 2 replies; 14+ messages in thread
From: Mirsad Goran Todorovac @ 2023-01-07  3:40 UTC (permalink / raw)
  To: Jakub Kicinski, Mirsad Goran Todorovac
  Cc: Kuniyuki Iwashima, davem, edumazet, fw, kuniyu, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]


From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>

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.

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 <child>] 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).

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Cc: Florian Westphal <fw@strlen.de>
Reviewed-by: Florian Westphal <fw@strlen.de>
Fixes: 314001f0bf92 ("af_unix: Add OOB support")
Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
---

The patch is generated against the "vanilla" Torvalds mainline tree 6.2-rc2.
(Tested and applies against the net.git tree.)


 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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH net v2] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-07  2:08         ` Jakub Kicinski
  2023-01-07  3:36           ` Mirsad Goran Todorovac
  2023-01-07  3:40           ` [PATCH net v4] " Mirsad Goran Todorovac
@ 2023-01-08 21:30           ` Mirsad Goran Todorovac
  2 siblings, 0 replies; 14+ messages in thread
From: Mirsad Goran Todorovac @ 2023-01-08 21:30 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Kuniyuki Iwashima, davem, edumazet, fw, kuniyu, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

On 07. 01. 2023. 03:08, Jakub Kicinski wrote:
> On Sat, 7 Jan 2023 02:42:43 +0100 Mirsad Goran Todorovac wrote:
>>> still doesn't apply, probably because there are two email footers  
>>
>> Thank you for the guidelines to make your robots happy :), the next
>> time I will assume all these from start, provided that I find and
>> patch another bug or issue.
> 
> Ah, sorry, wrong assumption :S
> 
> Your email client converts tabs to spaces, that's the problem.
> 
> Could you try get send-email ?

Sorry, Jakub, just to "remove this from stack", did the
[PATCH net v4] af_unix: selftest: Fix the size of the parameter to connect()
apply?

I can't seem to handle more than about half a dozen of bug reports at a time or
I started overlooking emails :(

Thanks,
Mirsad

-- 
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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net v4] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-07  3:40           ` [PATCH net v4] " Mirsad Goran Todorovac
@ 2023-01-09  1:15             ` Kuniyuki Iwashima
  2023-01-09  8:53               ` Mirsad Goran Todorovac
  2023-01-09  8:20             ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 14+ messages in thread
From: Kuniyuki Iwashima @ 2023-01-09  1:15 UTC (permalink / raw)
  To: mirsad.todorovac
  Cc: davem, edumazet, fw, kuba, kuniyu, kuniyu, linux-kernel,
	linux-kselftest, mirsad.todorovac, netdev, pabeni, shuah

From:   Mirsad Goran Todorovac <mirsad.todorovac@alu.hr>
Date:   Sat, 7 Jan 2023 04:40:20 +0100 (CET)
> From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
> 
> 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.
> 
> 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 <child>] 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).
> 
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Shuah Khan <shuah@kernel.org>
> Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
> Cc: Florian Westphal <fw@strlen.de>
> Reviewed-by: Florian Westphal <fw@strlen.de>
> Fixes: 314001f0bf92 ("af_unix: Add OOB support")
> Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>

Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>

You can check the current status here.
https://patchwork.kernel.org/project/netdevbpf/patch/alpine.DEB.2.21.2301070437400.26826@domac.alu.hr/

PS: you may want to check config not to send a mail as multipart next time.

Thank you,
Kuniyuki


> ---
> 
> The patch is generated against the "vanilla" Torvalds mainline tree 6.2-rc2.
> (Tested and applies against the net.git tree.)
> 
> 
>  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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net v4] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-07  3:40           ` [PATCH net v4] " Mirsad Goran Todorovac
  2023-01-09  1:15             ` Kuniyuki Iwashima
@ 2023-01-09  8:20             ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 14+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-09  8:20 UTC (permalink / raw)
  To: Mirsad Goran Todorovac
  Cc: kuba, mirsad.todorovac, kuniyu, davem, edumazet, fw, kuniyu,
	linux-kernel, linux-kselftest, netdev, pabeni, shuah

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Sat, 7 Jan 2023 04:40:20 +0100 (CET) you wrote:
> From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
> 
> 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.
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [net,v4] af_unix: selftest: Fix the size of the parameter to connect()
    https://git.kernel.org/netdev/net/c/7d6ceeb1875c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net v4] af_unix: selftest: Fix the size of the parameter to connect()
  2023-01-09  1:15             ` Kuniyuki Iwashima
@ 2023-01-09  8:53               ` Mirsad Goran Todorovac
  0 siblings, 0 replies; 14+ messages in thread
From: Mirsad Goran Todorovac @ 2023-01-09  8:53 UTC (permalink / raw)
  To: Kuniyuki Iwashima, mirsad.todorovac
  Cc: davem, edumazet, fw, kuba, kuniyu, linux-kernel, linux-kselftest,
	netdev, pabeni, shuah

On 9.1.2023. 2:15, Kuniyuki Iwashima wrote:
> From:   Mirsad Goran Todorovac <mirsad.todorovac@alu.hr>
> Date:   Sat, 7 Jan 2023 04:40:20 +0100 (CET)
>> From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
>>
>> 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.
>>
>> 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 <child>] 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).
>>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Jakub Kicinski <kuba@kernel.org>
>> Cc: Paolo Abeni <pabeni@redhat.com>
>> Cc: Shuah Khan <shuah@kernel.org>
>> Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
>> Cc: Florian Westphal <fw@strlen.de>
>> Reviewed-by: Florian Westphal <fw@strlen.de>
>> Fixes: 314001f0bf92 ("af_unix: Add OOB support")
>> Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
> 
> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> 
> You can check the current status here.
> https://patchwork.kernel.org/project/netdevbpf/patch/alpine.DEB.2.21.2301070437400.26826@domac.alu.hr/

Thank you very much for your time on this, Koniyuki, Jakub.

> PS: you may want to check config not to send a mail as multipart next time.

Done! Thanks for the hint. This should work:

   [ Sending Preferences ]
       [X]  Do Not Generate Sender Header
       [ ]  Use Sender Instead of X-X-Sender
       [X]  Do Not Send Flowed Text
       [X]  Downgrade Multipart to Text

Maybe add this to Documentation/process/email-clients.rst, section 
Alpine? It could save some round-trips ...

Thanks,
Mirsad

-- 
Mirsad Todorovac
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb
Republic of Croatia, the European Union
--
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-01-09  9:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06 17:18 [PATCH selftest/net/af_unix 1/1] Fix size of parameter to connect() Mirsad Goran Todorovac
2023-01-06 17:58 ` Kuniyuki Iwashima
2023-01-06 19:19   ` Mirsad Goran Todorovac
2023-01-06 19:28   ` [PATCH net v2] af_unix: selftest: Fix the size of the " Mirsad Goran Todorovac
2023-01-07  0:14     ` Jakub Kicinski
2023-01-07  1:37       ` [PATCH net v3] " Mirsad Goran Todorovac
2023-01-07  1:42       ` [PATCH net v2] " Mirsad Goran Todorovac
2023-01-07  2:08         ` Jakub Kicinski
2023-01-07  3:36           ` Mirsad Goran Todorovac
2023-01-07  3:40           ` [PATCH net v4] " Mirsad Goran Todorovac
2023-01-09  1:15             ` Kuniyuki Iwashima
2023-01-09  8:53               ` Mirsad Goran Todorovac
2023-01-09  8:20             ` patchwork-bot+netdevbpf
2023-01-08 21:30           ` [PATCH net v2] " Mirsad Goran Todorovac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).