public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork•no>
To: Johannes Berg <johannes@sipsolutions•net>
Cc: netdev@vger•kernel.org, Jeff Layton <jeff.layton@primarydata•com>,
	Sedat Dilek <sedat.dilek@gmail•com>,
	Johannes Berg <johannes.berg@intel•com>
Subject: Re: [PATCH v3 2/3] genetlink: disallow subscribing to unknown mcast groups
Date: Wed, 04 Feb 2015 12:55:36 +0100	[thread overview]
Message-ID: <87egq5uc07.fsf@nemi.mork.no> (raw)
In-Reply-To: <1421404634-8973-2-git-send-email-johannes@sipsolutions.net> (Johannes Berg's message of "Fri, 16 Jan 2015 11:37:13 +0100")

Johannes Berg <johannes@sipsolutions•net> writes:

> diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
> index 2e11061ef885..c18d3f5624b2 100644
> --- a/net/netlink/genetlink.c
> +++ b/net/netlink/genetlink.c
> @@ -985,7 +985,7 @@ static struct genl_multicast_group genl_ctrl_groups[] = {
>  
>  static int genl_bind(struct net *net, int group)
>  {
> -	int i, err = 0;
> +	int i, err = -ENOENT;
>  
>  	down_read(&cb_lock);
>  	for (i = 0; i < GENL_FAM_TAB_SIZE; i++) {

This change cause serious problems for acpid, as reported on
https://bugzilla.kernel.org/show_bug.cgi?id=92121

The end user visible result is that acpid fails to detect events like AC
power disconnect, battery alarms etc, which can be a bit of a problem if
you trust a battery alarm to trigger an emergency hibernation.  As I
happen to do...

Given the timing, I request that this patch is reverted for v3.19.
Thanks.

Sample acpid debug output, tracing the socket calls, running on a plain
v3.19-rc7:

nemi:/tmp# strace -s 128 -e trace=socket,bind,sendmsg,recvmsg -f acpid -l -d
socket(PF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 3
Deprecated /proc/acpi/event was not found.  Trying netlink and the input layer...
input layer /dev/input/event0 (AT Translated Set 2 keyboard) opened successfully, fd 4
input layer /dev/input/event1 (Lid Switch) opened successfully, fd 5
input layer /dev/input/event10 (HDA Intel Dock Headphone) opened successfully, fd 6
input layer /dev/input/event11 (HDA Intel Headphone) opened successfully, fd 7
input layer /dev/input/event2 (Sleep Button) opened successfully, fd 8
input layer /dev/input/event3 (Power Button) opened successfully, fd 9
input layer /dev/input/event4 (ThinkPad Extra Buttons) opened successfully, fd 10
input layer /dev/input/event6 (Video Bus) opened successfully, fd 11
input layer /dev/input/event8 (HDA Intel Mic) opened successfully, fd 12
input layer /dev/input/event9 (HDA Intel Dock Mic) opened successfully, fd 13
inotify fd: 14
inotify wd: 1
socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_GENERIC) = 15
bind(15, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
sendmsg(15, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"$\0\0\0\20\0\5\0\21\10\322T\0\0\0\0\3\0\0\0\17\0\2\0acpi_event\0\0", 36}], msg_controllen=0, msg_flags=0}, 0) = 36
recvmsg(15, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"h\0\0\0\20\0\0\0\21\10\322T\314l\0\0\1\2\0\0\17\0\2\0acpi_event\0\0\6\0\1\0\23\0\0\0\10\0\3\0\1\0\0\0\10\0\4\0\0\0\0\0\10\0\5\0\1\0\0\0$\0\7\0 \0\1\0\10\0\2\0\2\0\0\0\22\0\1\0acpi_mc_group\0\0\0", 16384}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 104
socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_GENERIC) = 15
bind(15, {sa_family=AF_NETLINK, pid=0, groups=00000002}, 12) = -1 ENOENT (No such file or directory)
Cannot bind netlink socket: No such file or directory
acpid: cannot open generic netlink socket
socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 16
bind(16, {sa_family=AF_LOCAL, sun_path="/var/run/acpid.socket"}, 110) = 0
acpid: starting up with netlink and the input layer
parsing conf file /etc/acpi/events/powerbtn-acpi-support
acpid: skipping non-file /etc/acpi/events/CVS
parsing conf file /etc/acpi/events/any
parsing conf file /etc/acpi/events/generic-hibernatebtn
parsing conf file /etc/acpi/events/low_battery
parsing conf file /etc/acpi/events/lidbtn
parsing conf file /etc/acpi/events/sleepbtn
acpid: 6 rules loaded
acpid: waiting for events: event logging is on



Bjørn

  parent reply	other threads:[~2015-02-04 11:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-16 10:37 [PATCH v3 1/3] genetlink: document parallel_ops Johannes Berg
2015-01-16 10:37 ` [PATCH v3 2/3] genetlink: disallow subscribing to unknown mcast groups Johannes Berg
2015-01-16 22:20   ` David Miller
2015-02-04 11:55   ` Bjørn Mork [this message]
2015-02-04 15:36     ` Bjørn Mork
2015-02-04 15:43       ` Johannes Berg
2015-02-04 15:55         ` Bjørn Mork
2015-02-04 16:15           ` Bjørn Mork
2015-02-04 16:16           ` Johannes Berg
2015-01-16 10:37 ` [PATCH v3 3/3] genetlink: synchronize socket closing and family removal Johannes Berg
2015-01-16 22:20   ` David Miller
2015-01-16 22:19 ` [PATCH v3 1/3] genetlink: document parallel_ops David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87egq5uc07.fsf@nemi.mork.no \
    --to=bjorn@mork$(echo .)no \
    --cc=jeff.layton@primarydata$(echo .)com \
    --cc=johannes.berg@intel$(echo .)com \
    --cc=johannes@sipsolutions$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sedat.dilek@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox