Skip to content

Commit 52826d3

Browse files
committed
kernel/utsname_sysctl.c: Fix hostname polling
Commit bfca3dd ("kernel/utsname_sysctl.c: print kernel arch") added a new entry to the uts_kern_table[] array, but didn't update the UTS_PROC_xyz enumerators of older entries, breaking anything that used them. Which is admittedly not many cases: it's really just the two uses of uts_proc_notify() in kernel/sys.c. But apparently journald-systemd actually uses this to detect hostname changes. Reported-by: Torsten Hilbrich <torsten.hilbrich@secunet.com> Fixes: bfca3dd ("kernel/utsname_sysctl.c: print kernel arch") Link: https://lore.kernel.org/lkml/0c2b92a6-0f25-9538-178f-eee3b06da23f@secunet.com/ Link: https://linux-regtracking.leemhuis.info/regzbot/regression/0c2b92a6-0f25-9538-178f-eee3b06da23f@secunet.com/ Cc: Petr Vorel <pvorel@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a703852 commit 52826d3

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

include/linux/utsname.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <uapi/linux/utsname.h>
1111

1212
enum uts_proc {
13+
UTS_PROC_ARCH,
1314
UTS_PROC_OSTYPE,
1415
UTS_PROC_OSRELEASE,
1516
UTS_PROC_VERSION,

kernel/utsname_sysctl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ static int proc_do_uts_string(struct ctl_table *table, int write,
7474
static DEFINE_CTL_TABLE_POLL(hostname_poll);
7575
static DEFINE_CTL_TABLE_POLL(domainname_poll);
7676

77+
// Note: update 'enum uts_proc' to match any changes to this table
7778
static struct ctl_table uts_kern_table[] = {
7879
{
7980
.procname = "arch",

0 commit comments

Comments
 (0)