linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the sysctl tree with the mm-nonmm-unstable tree
@ 2025-07-08  9:00 Stephen Rothwell
  2025-07-22  9:58 ` Joel Granados
  2025-07-31  1:05 ` Stephen Rothwell
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Rothwell @ 2025-07-08  9:00 UTC (permalink / raw)
  To: Luis Chamberlain, Kees Cook, Joel Granados, Andrew Morton
  Cc: Feng Tang, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 3377 bytes --]

Hi all,

Today's linux-next merge of the sysctl tree got a conflict in:

  kernel/panic.c

between commits:

  f8dbd6138e05 ("panic: add 'panic_sys_info' sysctl to take human readable string parameter")
  3699d83ae18b ("panic: add note that panic_print sysctl interface is deprecated")

from the mm-nonmm-unstable tree and commits:

  48f1dc94d25e ("sysctl: Move tainted ctl_table into kernel/panic.c")
  9aa4e27ef60c ("sysctl: Move sysctl_panic_on_stackoverflow to kernel/panic.c")

from the sysctl tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc kernel/panic.c
index df92b763f857,64e58835086d..000000000000
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@@ -78,13 -84,50 +78,56 @@@ ATOMIC_NOTIFIER_HEAD(panic_notifier_lis
  EXPORT_SYMBOL(panic_notifier_list);
  
  #ifdef CONFIG_SYSCTL
 +static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
 +			   void *buffer, size_t *lenp, loff_t *ppos)
 +{
 +	pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
 +	return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
 +}
  
+ /*
+  * Taint values can only be increased
+  * This means we can safely use a temporary.
+  */
+ static int proc_taint(const struct ctl_table *table, int write,
+ 			       void *buffer, size_t *lenp, loff_t *ppos)
+ {
+ 	struct ctl_table t;
+ 	unsigned long tmptaint = get_taint();
+ 	int err;
+ 
+ 	if (write && !capable(CAP_SYS_ADMIN))
+ 		return -EPERM;
+ 
+ 	t = *table;
+ 	t.data = &tmptaint;
+ 	err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos);
+ 	if (err < 0)
+ 		return err;
+ 
+ 	if (write) {
+ 		int i;
+ 
+ 		/*
+ 		 * If we are relying on panic_on_taint not producing
+ 		 * false positives due to userspace input, bail out
+ 		 * before setting the requested taint flags.
+ 		 */
+ 		if (panic_on_taint_nousertaint && (tmptaint & panic_on_taint))
+ 			return -EINVAL;
+ 
+ 		/*
+ 		 * Poor man's atomic or. Not worth adding a primitive
+ 		 * to everyone's atomic.h for this
+ 		 */
+ 		for (i = 0; i < TAINT_FLAGS_COUNT; i++)
+ 			if ((1UL << i) & tmptaint)
+ 				add_taint(i, LOCKDEP_STILL_OK);
+ 	}
+ 
+ 	return err;
+ }
+ 
  static const struct ctl_table kern_panic_table[] = {
  #ifdef CONFIG_SMP
  	{
@@@ -134,13 -183,16 +183,23 @@@
  		.mode           = 0644,
  		.proc_handler   = proc_douintvec,
  	},
 +	{
 +		.procname	= "panic_sys_info",
 +		.data		= &panic_print,
 +		.maxlen         = sizeof(panic_print),
 +		.mode		= 0644,
 +		.proc_handler	= sysctl_sys_info_handler,
 +	},
+ #if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
+ 	defined(CONFIG_DEBUG_STACKOVERFLOW)
+ 	{
+ 		.procname	= "panic_on_stackoverflow",
+ 		.data		= &sysctl_panic_on_stackoverflow,
+ 		.maxlen		= sizeof(int),
+ 		.mode		= 0644,
+ 		.proc_handler	= proc_dointvec,
+ 	},
+ #endif
  };
  
  static __init int kernel_panic_sysctls_init(void)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the sysctl tree with the mm-nonmm-unstable tree
  2025-07-08  9:00 linux-next: manual merge of the sysctl tree with the mm-nonmm-unstable tree Stephen Rothwell
@ 2025-07-22  9:58 ` Joel Granados
  2025-07-22 23:10   ` Stephen Rothwell
  2025-07-31  1:05 ` Stephen Rothwell
  1 sibling, 1 reply; 5+ messages in thread
From: Joel Granados @ 2025-07-22  9:58 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Luis Chamberlain, Kees Cook, Andrew Morton, Feng Tang,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 4039 bytes --]

On Tue, Jul 08, 2025 at 07:00:03PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the sysctl tree got a conflict in:
> 
>   kernel/panic.c
> 
> between commits:
> 
>   f8dbd6138e05 ("panic: add 'panic_sys_info' sysctl to take human readable string parameter")
>   3699d83ae18b ("panic: add note that panic_print sysctl interface is deprecated")
> 
> from the mm-nonmm-unstable tree and commits:
> 
>   48f1dc94d25e ("sysctl: Move tainted ctl_table into kernel/panic.c")
>   9aa4e27ef60c ("sysctl: Move sysctl_panic_on_stackoverflow to kernel/panic.c")
> 
> from the sysctl tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

I double checked these, and they seem ok from the sysctl side.

@Stephen: Do you prefer an actual acknowledgement that everything is
good? Or would you prefer no answer to these merge conflict advisories?
I personally, always make sure that things look sane, but always feel
that sending out the ACK is a bit of a waste.

Best

> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc kernel/panic.c
> index df92b763f857,64e58835086d..000000000000
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@@ -78,13 -84,50 +78,56 @@@ ATOMIC_NOTIFIER_HEAD(panic_notifier_lis
>   EXPORT_SYMBOL(panic_notifier_list);
>   
>   #ifdef CONFIG_SYSCTL
>  +static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
>  +			   void *buffer, size_t *lenp, loff_t *ppos)
>  +{
>  +	pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
>  +	return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
>  +}
>   
> + /*
> +  * Taint values can only be increased
> +  * This means we can safely use a temporary.
> +  */
> + static int proc_taint(const struct ctl_table *table, int write,
> + 			       void *buffer, size_t *lenp, loff_t *ppos)
> + {
> + 	struct ctl_table t;
> + 	unsigned long tmptaint = get_taint();
> + 	int err;
> + 
> + 	if (write && !capable(CAP_SYS_ADMIN))
> + 		return -EPERM;
> + 
> + 	t = *table;
> + 	t.data = &tmptaint;
> + 	err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos);
> + 	if (err < 0)
> + 		return err;
> + 
> + 	if (write) {
> + 		int i;
> + 
> + 		/*
> + 		 * If we are relying on panic_on_taint not producing
> + 		 * false positives due to userspace input, bail out
> + 		 * before setting the requested taint flags.
> + 		 */
> + 		if (panic_on_taint_nousertaint && (tmptaint & panic_on_taint))
> + 			return -EINVAL;
> + 
> + 		/*
> + 		 * Poor man's atomic or. Not worth adding a primitive
> + 		 * to everyone's atomic.h for this
> + 		 */
> + 		for (i = 0; i < TAINT_FLAGS_COUNT; i++)
> + 			if ((1UL << i) & tmptaint)
> + 				add_taint(i, LOCKDEP_STILL_OK);
> + 	}
> + 
> + 	return err;
> + }
> + 
>   static const struct ctl_table kern_panic_table[] = {
>   #ifdef CONFIG_SMP
>   	{
> @@@ -134,13 -183,16 +183,23 @@@
>   		.mode           = 0644,
>   		.proc_handler   = proc_douintvec,
>   	},
>  +	{
>  +		.procname	= "panic_sys_info",
>  +		.data		= &panic_print,
>  +		.maxlen         = sizeof(panic_print),
>  +		.mode		= 0644,
>  +		.proc_handler	= sysctl_sys_info_handler,
>  +	},
> + #if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
> + 	defined(CONFIG_DEBUG_STACKOVERFLOW)
> + 	{
> + 		.procname	= "panic_on_stackoverflow",
> + 		.data		= &sysctl_panic_on_stackoverflow,
> + 		.maxlen		= sizeof(int),
> + 		.mode		= 0644,
> + 		.proc_handler	= proc_dointvec,
> + 	},
> + #endif
>   };
>   
>   static __init int kernel_panic_sysctls_init(void)



-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the sysctl tree with the mm-nonmm-unstable tree
  2025-07-22  9:58 ` Joel Granados
@ 2025-07-22 23:10   ` Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2025-07-22 23:10 UTC (permalink / raw)
  To: Joel Granados
  Cc: Luis Chamberlain, Kees Cook, Andrew Morton, Feng Tang,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

Hi Joel,

On Tue, 22 Jul 2025 11:58:48 +0200 Joel Granados <joel.granados@kernel.org> wrote:
>
> I double checked these, and they seem ok from the sysctl side.
> 
> @Stephen: Do you prefer an actual acknowledgement that everything is
> good? Or would you prefer no answer to these merge conflict advisories?
> I personally, always make sure that things look sane, but always feel
> that sending out the ACK is a bit of a waste.

Yeah, I generally assume everything is OK unless told otherwise, so the
ACK is not necessary.  Though sometimes I express my doubt in my own
solution (I might say something like "I fixed it up (I hope/think ...")
and then it is nice to know either way.
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the sysctl tree with the mm-nonmm-unstable tree
  2025-07-08  9:00 linux-next: manual merge of the sysctl tree with the mm-nonmm-unstable tree Stephen Rothwell
  2025-07-22  9:58 ` Joel Granados
@ 2025-07-31  1:05 ` Stephen Rothwell
  2025-08-04  7:53   ` Joel Granados
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2025-07-31  1:05 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Luis Chamberlain, Kees Cook, Joel Granados, Feng Tang,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 3758 bytes --]

Hi all,

On Tue, 8 Jul 2025 19:00:03 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the sysctl tree got a conflict in:
> 
>   kernel/panic.c
> 
> between commits:
> 
>   f8dbd6138e05 ("panic: add 'panic_sys_info' sysctl to take human readable string parameter")
>   3699d83ae18b ("panic: add note that panic_print sysctl interface is deprecated")
> 
> from the mm-nonmm-unstable tree and commits:
> 
>   48f1dc94d25e ("sysctl: Move tainted ctl_table into kernel/panic.c")
>   9aa4e27ef60c ("sysctl: Move sysctl_panic_on_stackoverflow to kernel/panic.c")
> 
> from the sysctl tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> 
> diff --cc kernel/panic.c
> index df92b763f857,64e58835086d..000000000000
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@@ -78,13 -84,50 +78,56 @@@ ATOMIC_NOTIFIER_HEAD(panic_notifier_lis
>   EXPORT_SYMBOL(panic_notifier_list);
>   
>   #ifdef CONFIG_SYSCTL
>  +static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
>  +			   void *buffer, size_t *lenp, loff_t *ppos)
>  +{
>  +	pr_info_once("Kernel: 'panic_print' sysctl interface will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
>  +	return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
>  +}
>   
> + /*
> +  * Taint values can only be increased
> +  * This means we can safely use a temporary.
> +  */
> + static int proc_taint(const struct ctl_table *table, int write,
> + 			       void *buffer, size_t *lenp, loff_t *ppos)
> + {
> + 	struct ctl_table t;
> + 	unsigned long tmptaint = get_taint();
> + 	int err;
> + 
> + 	if (write && !capable(CAP_SYS_ADMIN))
> + 		return -EPERM;
> + 
> + 	t = *table;
> + 	t.data = &tmptaint;
> + 	err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos);
> + 	if (err < 0)
> + 		return err;
> + 
> + 	if (write) {
> + 		int i;
> + 
> + 		/*
> + 		 * If we are relying on panic_on_taint not producing
> + 		 * false positives due to userspace input, bail out
> + 		 * before setting the requested taint flags.
> + 		 */
> + 		if (panic_on_taint_nousertaint && (tmptaint & panic_on_taint))
> + 			return -EINVAL;
> + 
> + 		/*
> + 		 * Poor man's atomic or. Not worth adding a primitive
> + 		 * to everyone's atomic.h for this
> + 		 */
> + 		for (i = 0; i < TAINT_FLAGS_COUNT; i++)
> + 			if ((1UL << i) & tmptaint)
> + 				add_taint(i, LOCKDEP_STILL_OK);
> + 	}
> + 
> + 	return err;
> + }
> + 
>   static const struct ctl_table kern_panic_table[] = {
>   #ifdef CONFIG_SMP
>   	{
> @@@ -134,13 -183,16 +183,23 @@@
>   		.mode           = 0644,
>   		.proc_handler   = proc_douintvec,
>   	},
>  +	{
>  +		.procname	= "panic_sys_info",
>  +		.data		= &panic_print,
>  +		.maxlen         = sizeof(panic_print),
>  +		.mode		= 0644,
>  +		.proc_handler	= sysctl_sys_info_handler,
>  +	},
> + #if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
> + 	defined(CONFIG_DEBUG_STACKOVERFLOW)
> + 	{
> + 		.procname	= "panic_on_stackoverflow",
> + 		.data		= &sysctl_panic_on_stackoverflow,
> + 		.maxlen		= sizeof(int),
> + 		.mode		= 0644,
> + 		.proc_handler	= proc_dointvec,
> + 	},
> + #endif
>   };
>   
>   static __init int kernel_panic_sysctls_init(void)

This is now a conflict between the mm-nonmm-stable tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the sysctl tree with the mm-nonmm-unstable tree
  2025-07-31  1:05 ` Stephen Rothwell
@ 2025-08-04  7:53   ` Joel Granados
  0 siblings, 0 replies; 5+ messages in thread
From: Joel Granados @ 2025-08-04  7:53 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Andrew Morton, Luis Chamberlain, Kees Cook, Feng Tang,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1474 bytes --]

On Thu, Jul 31, 2025 at 11:05:21AM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> On Tue, 8 Jul 2025 19:00:03 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Today's linux-next merge of the sysctl tree got a conflict in:
> > 
> >   kernel/panic.c
...
> >   static const struct ctl_table kern_panic_table[] = {
> >   #ifdef CONFIG_SMP
> >   	{
> > @@@ -134,13 -183,16 +183,23 @@@
> >   		.mode           = 0644,
> >   		.proc_handler   = proc_douintvec,
> >   	},
> >  +	{
> >  +		.procname	= "panic_sys_info",
> >  +		.data		= &panic_print,
> >  +		.maxlen         = sizeof(panic_print),
> >  +		.mode		= 0644,
> >  +		.proc_handler	= sysctl_sys_info_handler,
> >  +	},
> > + #if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
> > + 	defined(CONFIG_DEBUG_STACKOVERFLOW)
> > + 	{
> > + 		.procname	= "panic_on_stackoverflow",
> > + 		.data		= &sysctl_panic_on_stackoverflow,
> > + 		.maxlen		= sizeof(int),
> > + 		.mode		= 0644,
> > + 		.proc_handler	= proc_dointvec,
> > + 	},
> > + #endif
> >   };
> >   
> >   static __init int kernel_panic_sysctls_init(void)
> 
> This is now a conflict between the mm-nonmm-stable tree and Linus' tree.
Makes sense, as the sysctl PR was merged at the end of July. From the
point of view of sysctl, it should be handled in the same way as
expressed in this thread. Feel free to e-mail me if you need further
sysctl input on how to handle it.

Best

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-04  7:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08  9:00 linux-next: manual merge of the sysctl tree with the mm-nonmm-unstable tree Stephen Rothwell
2025-07-22  9:58 ` Joel Granados
2025-07-22 23:10   ` Stephen Rothwell
2025-07-31  1:05 ` Stephen Rothwell
2025-08-04  7:53   ` Joel Granados

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).