linux/drivers/net/ethernet/sun
Kees Cook 2dcfe9e2d3 niu: Silence randstruct warnings
Clang randstruct gets upset when it sees struct addresspace (which is
randomized) being assigned to a struct page (which is not randomized):

drivers/net/ethernet/sun/niu.c:3385:12: error: casting from randomized structure pointer type 'struct address_space *' to 'struct page *'
                        *link = (struct page *) page->mapping;
                                ^

It looks like niu.c is looking for an in-line place to chain its allocated
pages together and is overloading the "mapping" member, as it is unused.
This is very non-standard, and is expected to be cleaned up in the
future[1], but there is no "correct" way to handle it today.

No meaningful machine code changes result after this change, and source
readability is improved.

Drop the randstruct exception now that there is no "confusing" cross-type
assignment.

[1] https://lore.kernel.org/lkml/YnqgjVoMDu5v9PNG@casper.infradead.org/

Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Du Cheng <ducheng2@gmail.com>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: William Kucharski <william.kucharski@oracle.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: netdev@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: linux-hardening@vger.kernel.org
Acked-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/lkml/20220511151647.7290adbe@kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
2022-05-16 16:02:21 -07:00
..
cassini.c net: ethernet: sun: use min_t() to make code cleaner 2022-03-09 14:58:06 +00:00
cassini.h
Kconfig net: sun: SUNVNET_COMMON should depend on INET 2021-09-28 13:20:21 +01:00
ldmvsw.c ethernet: sun: add missing semicolon, fix build 2021-10-11 07:34:04 -07:00
Makefile
niu.c niu: Silence randstruct warnings 2022-05-16 16:02:21 -07:00
niu.h
sunbmac.c ethernet: replace netdev->dev_addr assignment loops 2021-10-14 09:22:25 -07:00
sunbmac.h
sungem.c ethernet: sun: remove direct netdev->dev_addr writes 2021-10-09 11:46:57 +01:00
sungem.h
sunhme.c ethernet: sun: Free the coherent when failing in probing 2022-03-07 11:32:22 +00:00
sunhme.h
sunqe.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
sunqe.h
sunvnet_common.c skb_copy_and_csum_bits(): don't bother with the last argument 2020-08-20 15:45:13 -04:00
sunvnet_common.h netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
sunvnet.c ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00