Re: [PATCH] mm/mmap: Tighten up cmdline_parse_stack_guard_gap()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 28, 2023 at 10:52:12AM +0530, Anshuman Khandual wrote:
> -static int __init cmdline_parse_stack_guard_gap(char *p)
> +static int __init cmdline_parse_stack_guard_gap(char *str)
>  {
>  	unsigned long val;
> -	char *endptr;
>  
> -	val = simple_strtoul(p, &endptr, 10);
> -	if (!*endptr)
> -		stack_guard_gap = val << PAGE_SHIFT;
> +	if (!str)
> +		return 0;

Please explain how this function can be called with a NULL pointer.

> -	return 1;
> +	val = simple_strtoul(str, &str, 10);
> +	if (!*str && val) {
> +		stack_guard_gap = val << PAGE_SHIFT;
> +		return 1;
> +	}
> +	return 0;
>  }

Now you've removed the abillity for someone to say stack_guard_gap=0,
which seems potentially useful.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux