* [PATCH] fs: dlm: Protect IPV6 field access by CONFIG_IPV6
@ 2021-11-18 8:23 Geert Uytterhoeven
2021-11-18 14:52 ` Alexander Aring
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2021-11-18 8:23 UTC (permalink / raw)
To: Alexander Aring, Christine Caulfield, David Teigland
Cc: Reported-by : Randy Dunlap, cluster-devel, netdev, linux-kernel,
Geert Uytterhoeven
If CONFIG_IPV6=n:
In file included from fs/dlm/lowcomms.c:46:
fs/dlm/lowcomms.c: In function ‘lowcomms_error_report’:
./include/net/sock.h:386:34: error: ‘struct sock_common’ has no member named ‘skc_v6_daddr’; did you mean ‘skc_daddr’?
386 | #define sk_v6_daddr __sk_common.skc_v6_daddr
| ^~~~~~~~~~~~
./include/linux/printk.h:422:19: note: in expansion of macro ‘sk_v6_daddr’
422 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
./include/linux/printk.h:450:26: note: in expansion of macro ‘printk_index_wrap’
450 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~
./include/linux/printk.h:644:3: note: in expansion of macro ‘printk’
644 | printk(fmt, ##__VA_ARGS__); \
| ^~~~~~
fs/dlm/lowcomms.c:612:3: note: in expansion of macro ‘printk_ratelimited’
612 | printk_ratelimited(KERN_ERR "dlm: node %d: socket error "
| ^~~~~~~~~~~~~~~~~~
Fix this by protecting the code that accesses IPV6-only fields by a
check for CONFIG_IPV6.
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Fixes: 4c3d90570bcc2b33 ("fs: dlm: don't call kernel_getpeername() in error_report()")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
fs/dlm/lowcomms.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 203470189011102d..f7fc1ac76ce83a5f 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -608,6 +608,7 @@ static void lowcomms_error_report(struct sock *sk)
ntohs(inet->inet_dport), sk->sk_err,
sk->sk_err_soft);
break;
+#if IS_ENABLED(CONFIG_IPV6)
case AF_INET6:
printk_ratelimited(KERN_ERR "dlm: node %d: socket error "
"sending to node %d at %pI6c, "
@@ -616,6 +617,7 @@ static void lowcomms_error_report(struct sock *sk)
ntohs(inet->inet_dport), sk->sk_err,
sk->sk_err_soft);
break;
+#endif
default:
printk_ratelimited(KERN_ERR "dlm: node %d: socket error "
"invalid socket family %d set, "
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fs: dlm: Protect IPV6 field access by CONFIG_IPV6
2021-11-18 8:23 [PATCH] fs: dlm: Protect IPV6 field access by CONFIG_IPV6 Geert Uytterhoeven
@ 2021-11-18 14:52 ` Alexander Aring
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Aring @ 2021-11-18 14:52 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Christine Caulfield, David Teigland, Reported-by : Randy Dunlap,
cluster-devel, Network Development, linux-kernel
Hi,
On Thu, Nov 18, 2021 at 3:26 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> If CONFIG_IPV6=n:
>
> In file included from fs/dlm/lowcomms.c:46:
> fs/dlm/lowcomms.c: In function ‘lowcomms_error_report’:
> ./include/net/sock.h:386:34: error: ‘struct sock_common’ has no member named ‘skc_v6_daddr’; did you mean ‘skc_daddr’?
> 386 | #define sk_v6_daddr __sk_common.skc_v6_daddr
> | ^~~~~~~~~~~~
> ./include/linux/printk.h:422:19: note: in expansion of macro ‘sk_v6_daddr’
> 422 | _p_func(_fmt, ##__VA_ARGS__); \
> | ^~~~~~~~~~~
> ./include/linux/printk.h:450:26: note: in expansion of macro ‘printk_index_wrap’
> 450 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
> | ^~~~~~~~~~~~~~~~~
> ./include/linux/printk.h:644:3: note: in expansion of macro ‘printk’
> 644 | printk(fmt, ##__VA_ARGS__); \
> | ^~~~~~
> fs/dlm/lowcomms.c:612:3: note: in expansion of macro ‘printk_ratelimited’
> 612 | printk_ratelimited(KERN_ERR "dlm: node %d: socket error "
> | ^~~~~~~~~~~~~~~~~~
>
> Fix this by protecting the code that accesses IPV6-only fields by a
> check for CONFIG_IPV6.
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Fixes: 4c3d90570bcc2b33 ("fs: dlm: don't call kernel_getpeername() in error_report()")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
Thanks, but the issue has already been fixed in the same way [0].
- Alex
[0] https://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm.git/commit/?h=next&id=1b9beda83e27a0c2cd75d1cb743c297c7b36c844
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-18 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 8:23 [PATCH] fs: dlm: Protect IPV6 field access by CONFIG_IPV6 Geert Uytterhoeven
2021-11-18 14:52 ` Alexander Aring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).