All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Michal Luczaj <mhal@rbox.co>
Cc: Eric Dumazet <edumazet@google.com>, netdev@vger.kernel.org
Subject: Re: [PATCH net] net: Make copy_safe_from_sockptr() match documentation
Date: Wed, 13 Nov 2024 19:29:24 -0800	[thread overview]
Message-ID: <20241113192924.4f931147@kernel.org> (raw)
In-Reply-To: <20241111-sockptr-copy-ret-fix-v1-1-a520083a93fb@rbox.co>

On Mon, 11 Nov 2024 00:17:34 +0100 Michal Luczaj wrote:
> copy_safe_from_sockptr()
>   return copy_from_sockptr()
>     return copy_from_sockptr_offset()
>       return copy_from_user()
> 
> copy_from_user() does not return an error on fault. Instead, it returns a
> number of bytes that were not copied. Have it handled.
> 
> Fixes: 6309863b31dd ("net: add copy_safe_from_sockptr() helper")
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
> ---
> Patch has a side effect: it un-breaks garbage input handling of
> nfc_llcp_setsockopt() and mISDN's data_sock_setsockopt().

I'll move this to the commit message, it's important.

Are you planning to scan callers of copy_from_sockptr() ?
I looked at 3 callers who save the return value, 2 of them are buggy :S

  reply	other threads:[~2024-11-14  3:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-10 23:17 [PATCH net] net: Make copy_safe_from_sockptr() match documentation Michal Luczaj
2024-11-14  3:29 ` Jakub Kicinski [this message]
2024-11-14 23:36   ` Michal Luczaj
2024-11-15  1:57     ` Jakub Kicinski
2024-11-14  4:00 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241113192924.4f931147@kernel.org \
    --to=kuba@kernel.org \
    --cc=edumazet@google.com \
    --cc=mhal@rbox.co \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.