]> git.baikalelectronics.ru Git - kernel.git/commit
net/bpfilter: fix dprintf usage for /dev/kmsg
authorBruno Meneguele <bmeneg@redhat.com>
Thu, 12 Mar 2020 23:08:20 +0000 (20:08 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 09:01:33 +0000 (11:01 +0200)
commit1c3646f237c5179b016db895571bec4914a6bbe6
tree7bcf58b4b6e98a0173ca95b9087d66838c413eec
parent39ea2a16bb80f89be7473eff6c989dac80fdb68d
net/bpfilter: fix dprintf usage for /dev/kmsg

[ Upstream commit c741018fdd8db3bcd27f1cef381acb699df3dea9 ]

The bpfilter UMH code was recently changed to log its informative messages to
/dev/kmsg, however this interface doesn't support SEEK_CUR yet, used by
dprintf(). As result dprintf() returns -EINVAL and doesn't log anything.

However there already had some discussions about supporting SEEK_CUR into
/dev/kmsg interface in the past it wasn't concluded. Since the only user of
that from userspace perspective inside the kernel is the bpfilter UMH
(userspace) module it's better to correct it here instead waiting a conclusion
on the interface.

Fixes: f5bfcceb660a ("net: bpfilter: print umh messages to /dev/kmsg")
Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bpfilter/main.c