diff mbox series

[net-next,v2] net: fix signedness bug in skb_splice_from_iter()

Message ID 366861a7-87c8-4bbf-9101-69dd41021d07@kili.mountain (mailing list archive)
State Accepted
Commit ef1bc119ceb52d22a83f72b8dfce1dd64a3cca05
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] net: fix signedness bug in skb_splice_from_iter() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 10 this patch: 10
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 10 this patch: 10
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Dan Carpenter May 26, 2023, 1:39 p.m. UTC
The "len" variable needs to be signed for the error handling to work
correctly.

Fixes: 2e910b95329c ("net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
v2: tidy up a style mistake in v1.

 net/core/skbuff.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Howells May 26, 2023, 1:59 p.m. UTC | #1
Dan Carpenter <dan.carpenter@linaro.org> wrote:

> The "len" variable needs to be signed for the error handling to work
> correctly.
> 
> Fixes: 2e910b95329c ("net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: David Howells <dhowells@redhat.com>
Jiri Pirko May 26, 2023, 4:10 p.m. UTC | #2
Fri, May 26, 2023 at 03:39:15PM CEST, dan.carpenter@linaro.org wrote:
>The "len" variable needs to be signed for the error handling to work
>correctly.
>
>Fixes: 2e910b95329c ("net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES")
>Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
patchwork-bot+netdevbpf@kernel.org May 30, 2023, 5:10 a.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 26 May 2023 16:39:15 +0300 you wrote:
> The "len" variable needs to be signed for the error handling to work
> correctly.
> 
> Fixes: 2e910b95329c ("net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> v2: tidy up a style mistake in v1.
> 
> [...]

Here is the summary with links:
  - [net-next,v2] net: fix signedness bug in skb_splice_from_iter()
    https://git.kernel.org/netdev/net-next/c/ef1bc119ceb5

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 653abd8a6975..7c4338221b17 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -6931,8 +6931,8 @@  ssize_t skb_splice_from_iter(struct sk_buff *skb, struct iov_iter *iter,
 	unsigned int i;
 
 	while (iter->count > 0) {
-		ssize_t space, nr;
-		size_t off, len;
+		ssize_t space, nr, len;
+		size_t off;
 
 		ret = -EMSGSIZE;
 		space = frag_limit - skb_shinfo(skb)->nr_frags;