mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* bug in kernel/sysctl.c (SYSIPC) ?
@ 2003-03-18  7:51 Der Herr Hofrat
  2003-03-18 18:40 ` Randy.Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Der Herr Hofrat @ 2003-03-18  7:51 UTC (permalink / raw)
  To: linux-kernel


HI !

 atleast in kernel 2.4.19 and 2.4.20 in kernel/sysctl.c shmmax and shmall use
 the proc_dointvec_minmax callback without passing a min/max value - is there
 a reson for this or is this a simple bug ?

linux/kenrel/sysctl.c (line 221 for 2.4.19/20)

#ifdef CONFIG_SYSVIPC
	{KERN_SHMMAX, "shmmax", &shm_ctlmax, sizeof (size_t),
	 0644, NULL, &proc_doulongvec_minmax},
	{KERN_SHMALL, "shmall", &shm_ctlall, sizeof (size_t),
	 0644, NULL, &proc_doulongvec_minmax},
	...
#endif

hofrat

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

* Re: bug in kernel/sysctl.c (SYSIPC) ?
  2003-03-18  7:51 bug in kernel/sysctl.c (SYSIPC) ? Der Herr Hofrat
@ 2003-03-18 18:40 ` Randy.Dunlap
  2003-03-18 18:55   ` Der Herr Hofrat
  0 siblings, 1 reply; 4+ messages in thread
From: Randy.Dunlap @ 2003-03-18 18:40 UTC (permalink / raw)
  To: Der Herr Hofrat; +Cc: linux-kernel

On Tue, 18 Mar 2003 08:51:17 +0100 (CET) Der Herr Hofrat <der.herr@hofr.at> wrote:

|  atleast in kernel 2.4.19 and 2.4.20 in kernel/sysctl.c shmmax and shmall use
|  the proc_dointvec_minmax callback without passing a min/max value - is there
|  a reson for this or is this a simple bug ?
| 
| linux/kenrel/sysctl.c (line 221 for 2.4.19/20)
| 
| #ifdef CONFIG_SYSVIPC
| 	{KERN_SHMMAX, "shmmax", &shm_ctlmax, sizeof (size_t),
| 	 0644, NULL, &proc_doulongvec_minmax},
| 	{KERN_SHMALL, "shmall", &shm_ctlall, sizeof (size_t),
| 	 0644, NULL, &proc_doulongvec_minmax},
| 	...
| #endif

The min and max values default to 0 if not specified (initialized),
and the _minmax functions have code to handle those cases.

so as long as the intended min/max values were 0, I don't see a
problem.  Are you seeing a problem?

--
~Randy

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

* Re: bug in kernel/sysctl.c (SYSIPC) ?
  2003-03-18 18:40 ` Randy.Dunlap
@ 2003-03-18 18:55   ` Der Herr Hofrat
  2003-03-18 22:00     ` Randy.Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Der Herr Hofrat @ 2003-03-18 18:55 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: Der Herr Hofrat, linux-kernel

> On Tue, 18 Mar 2003 08:51:17 +0100 (CET) Der Herr Hofrat <der.herr@hofr.at> wrote:
> 
> |  atleast in kernel 2.4.19 and 2.4.20 in kernel/sysctl.c shmmax and shmall use
> |  the proc_dointvec_minmax callback without passing a min/max value - is there
> |  a reson for this or is this a simple bug ?
> | 
> | linux/kenrel/sysctl.c (line 221 for 2.4.19/20)
> | 
> | #ifdef CONFIG_SYSVIPC
> | 	{KERN_SHMMAX, "shmmax", &shm_ctlmax, sizeof (size_t),
> | 	 0644, NULL, &proc_doulongvec_minmax},
> | 	{KERN_SHMALL, "shmall", &shm_ctlall, sizeof (size_t),
> | 	 0644, NULL, &proc_doulongvec_minmax},
> | 	...
> | #endif
> 
> The min and max values default to 0 if not specified (initialized),
> and the _minmax functions have code to handle those cases.
> 
> so as long as the intended min/max values were 0, I don't see a
> problem.  Are you seeing a problem?
>

not directly a problem - my assumption was that shmmax would be bounded in some
way - currently you can write any value into /proc/sys/kernel/shmmax - and I
don't think that the inteded behavior of this is to permit any value - or if 
it is - what is the point of using the _minimax and not simple proc_doulongvec ?

hofrat 

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

* Re: bug in kernel/sysctl.c (SYSIPC) ?
  2003-03-18 18:55   ` Der Herr Hofrat
@ 2003-03-18 22:00     ` Randy.Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy.Dunlap @ 2003-03-18 22:00 UTC (permalink / raw)
  To: Der Herr Hofrat; +Cc: der.herr, linux-kernel

On Tue, 18 Mar 2003 19:55:36 +0100 (CET) Der Herr Hofrat <der.herr@hofr.at> wrote:

| > On Tue, 18 Mar 2003 08:51:17 +0100 (CET) Der Herr Hofrat <der.herr@hofr.at> wrote:
| > 
| > |  atleast in kernel 2.4.19 and 2.4.20 in kernel/sysctl.c shmmax and shmall use
| > |  the proc_dointvec_minmax callback without passing a min/max value - is there
| > |  a reson for this or is this a simple bug ?
| > | 
| > | linux/kenrel/sysctl.c (line 221 for 2.4.19/20)
| > | 
| > | #ifdef CONFIG_SYSVIPC
| > | 	{KERN_SHMMAX, "shmmax", &shm_ctlmax, sizeof (size_t),
| > | 	 0644, NULL, &proc_doulongvec_minmax},
| > | 	{KERN_SHMALL, "shmall", &shm_ctlall, sizeof (size_t),
| > | 	 0644, NULL, &proc_doulongvec_minmax},
| > | 	...
| > | #endif
| > 
| > The min and max values default to 0 if not specified (initialized),
| > and the _minmax functions have code to handle those cases.
| > 
| > so as long as the intended min/max values were 0, I don't see a
| > problem.  Are you seeing a problem?
| >
| 
| not directly a problem - my assumption was that shmmax would be bounded in some
| way - currently you can write any value into /proc/sys/kernel/shmmax - and I
| don't think that the inteded behavior of this is to permit any value - or if 
| it is - what is the point of using the _minimax and not simple proc_doulongvec ?

Good observation.  Yes, shmmax is unbounded, root can write any value to it.
I don't know why proc_doulongvec_minmax is used there, except that I don't
see a proc_doulongvec() without _minmax on it.

--
~Randy

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

end of thread, other threads:[~2003-03-18 21:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-18  7:51 bug in kernel/sysctl.c (SYSIPC) ? Der Herr Hofrat
2003-03-18 18:40 ` Randy.Dunlap
2003-03-18 18:55   ` Der Herr Hofrat
2003-03-18 22:00     ` Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®