[bug report] iwlwifi: mei: add the driver to allow cooperation with CSME

2 messages, 2 authors, 2021-12-16 · open the first message on its own page

[bug report] iwlwifi: mei: add the driver to allow cooperation with CSME

From: Dan Carpenter <hidden>
Date: 2021-12-16 10:17:28

Hello Emmanuel Grumbach,

The patch 2da4366f9e2c: "iwlwifi: mei: add the driver to allow
cooperation with CSME" from Nov 12, 2021, leads to the following
Smatch static checker warning:

	drivers/net/wireless/intel/iwlwifi/mei/net.c:199 iwl_mei_rx_filter_ipv4()
	warn: taking sizeof binop

drivers/net/wireless/intel/iwlwifi/mei/net.c
    188 static bool iwl_mei_rx_filter_ipv4(struct sk_buff *skb,
    189                                    const struct iwl_sap_oob_filters *filters,
    190                                    rx_handler_result_t *rx_handler_res)
    191 {
    192         const struct iwl_sap_ipv4_filter *filt = &filters->ipv4_filter;
    193         const struct iphdr *iphdr;
    194         unsigned int iphdrlen;
    195         bool match;
    196 
    197         if (!pskb_may_pull(skb, skb_network_offset(skb) + sizeof(*iphdr)) ||
    198             !pskb_may_pull(skb, skb_network_offset(skb) +
--> 199                            sizeof(ip_hdrlen(skb) - sizeof(*iphdr))))

Probably this should be: ip_hdrlen(skb) - sizeof(*iphdr)?

    200                 return false;
    201 
    202         iphdrlen = ip_hdrlen(skb);

regards,
dan carpenter

RE: [bug report] iwlwifi: mei: add the driver to allow cooperation with CSME

From: Grumbach, Emmanuel <hidden>
Date: 2021-12-16 10:22:59

Hello Emmanuel Grumbach,

The patch 2da4366f9e2c: "iwlwifi: mei: add the driver to allow cooperation
with CSME" from Nov 12, 2021, leads to the following Smatch static checker
warning:

	drivers/net/wireless/intel/iwlwifi/mei/net.c:199
iwl_mei_rx_filter_ipv4()
	warn: taking sizeof binop

drivers/net/wireless/intel/iwlwifi/mei/net.c
    188 static bool iwl_mei_rx_filter_ipv4(struct sk_buff *skb,
    189                                    const struct iwl_sap_oob_filters *filters,
    190                                    rx_handler_result_t *rx_handler_res)
    191 {
    192         const struct iwl_sap_ipv4_filter *filt = &filters->ipv4_filter;
    193         const struct iphdr *iphdr;
    194         unsigned int iphdrlen;
    195         bool match;
    196
    197         if (!pskb_may_pull(skb, skb_network_offset(skb) + sizeof(*iphdr))
||
    198             !pskb_may_pull(skb, skb_network_offset(skb) +
--> 199                            sizeof(ip_hdrlen(skb) - sizeof(*iphdr))))

Probably this should be: ip_hdrlen(skb) - sizeof(*iphdr)?
Ouch....
Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help