vimer linux kernel 爱好者

sparse warning from kernel summary

2019-01-07

命令

make C=2 CF=-D__CHECK_ENDIAN__

patch

有关sparse发现的问题,我自己的patch在下面,但是,目前来说没有理解其中的原理 只能先记录下来,后面再总结。

我的patch

rcu

在上面的补丁中,其中就是一个有关rcu的bug. 现在记录一个

li 其中的一个问题如何从KASAN的log中找到相关的代码线索?

__le16

嘿嘿,这是有关位操作的黑科技 资源:

stackoverflow

linus

待解决的问题

1. 下面这段代码是有问题的, 命令:

sudo make C=2 M=drivers/net/

相关的代码:3241行fromcode

static inline u32 bond_eth_hash(struct sk_buff *skb)
{
	struct ethhdr *ep, hdr_tmp;

	ep = skb_header_pointer(skb, 0, sizeof(hdr_tmp), &hdr_tmp);
	if (ep)
		return ep->h_dest[5] ^ ep->h_source[5] ^ ep->h_proto;
	return 0;
}

其中,ethhdr的定义在161

#if __UAPI_DEF_ETHHDR
struct ethhdr {
	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
	__be16		h_proto;		/* packet type ID field	*/
} __attribute__((packed));
#endif

看出问题来了吗?


Comments

Content