diff mbox series

[bpf-next,v3,2/3] net: change skb_ensure_writable()'s write_len param to unsigned int type

Message ID 20220414135902.100914-3-liujian56@huawei.com (mailing list archive)
State Superseded
Delegated to: BPF
Headers show
Series Enlarge offset check value in bpf_skb_load_bytes | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5843 this patch: 5843
netdev/cc_maintainers warning 3 maintainers not CCed: keescook@chromium.org edumazet@google.com imagedong@tencent.com
netdev/build_clang success Errors and warnings before: 1152 this patch: 1152
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 5981 this patch: 5981
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-VM_Test-1 success Logs for Kernel LATEST on ubuntu-latest + selftests
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-2 success Logs for Kernel LATEST on z15 + selftests

Commit Message

liujian (CE) April 14, 2022, 1:59 p.m. UTC
Both pskb_may_pull() and skb_clone_writable()'s length parameters are of
type unsigned int already.
Therefore, change this function's write_len param to unsigned int type.

Signed-off-by: Liu Jian <liujian56@huawei.com>
---
 include/linux/skbuff.h | 2 +-
 net/core/skbuff.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Song Liu April 14, 2022, 10:28 p.m. UTC | #1
> On Apr 14, 2022, at 6:59 AM, Liu Jian <liujian56@huawei.com> wrote:
> 
> Both pskb_may_pull() and skb_clone_writable()'s length parameters are of
> type unsigned int already.
> Therefore, change this function's write_len param to unsigned int type.
> 
> Signed-off-by: Liu Jian <liujian56@huawei.com>

Acked-by: Song Liu <songliubraving@fb.com>

> ---
> include/linux/skbuff.h | 2 +-
> net/core/skbuff.c      | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 3a30cae8b0a5..fe8990ce52a8 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -3886,7 +3886,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
> struct sk_buff *skb_segment_list(struct sk_buff *skb, netdev_features_t features,
> 				 unsigned int offset);
> struct sk_buff *skb_vlan_untag(struct sk_buff *skb);
> -int skb_ensure_writable(struct sk_buff *skb, int write_len);
> +int skb_ensure_writable(struct sk_buff *skb, unsigned int write_len);
> int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci);
> int skb_vlan_pop(struct sk_buff *skb);
> int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 30b523fa4ad2..a84e00e44ad2 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -5601,7 +5601,7 @@ struct sk_buff *skb_vlan_untag(struct sk_buff *skb)
> }
> EXPORT_SYMBOL(skb_vlan_untag);
> 
> -int skb_ensure_writable(struct sk_buff *skb, int write_len)
> +int skb_ensure_writable(struct sk_buff *skb, unsigned int write_len)
> {
> 	if (!pskb_may_pull(skb, write_len))
> 		return -ENOMEM;
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 3a30cae8b0a5..fe8990ce52a8 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3886,7 +3886,7 @@  struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
 struct sk_buff *skb_segment_list(struct sk_buff *skb, netdev_features_t features,
 				 unsigned int offset);
 struct sk_buff *skb_vlan_untag(struct sk_buff *skb);
-int skb_ensure_writable(struct sk_buff *skb, int write_len);
+int skb_ensure_writable(struct sk_buff *skb, unsigned int write_len);
 int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci);
 int skb_vlan_pop(struct sk_buff *skb);
 int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 30b523fa4ad2..a84e00e44ad2 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -5601,7 +5601,7 @@  struct sk_buff *skb_vlan_untag(struct sk_buff *skb)
 }
 EXPORT_SYMBOL(skb_vlan_untag);
 
-int skb_ensure_writable(struct sk_buff *skb, int write_len)
+int skb_ensure_writable(struct sk_buff *skb, unsigned int write_len)
 {
 	if (!pskb_may_pull(skb, write_len))
 		return -ENOMEM;