lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84o6roex2d.fsf@jogness.linutronix.de>
Date: Fri, 05 Sep 2025 17:36:34 +0206
From: John Ogness <john.ogness@...utronix.de>
To: Daniil Tatianin <d-tatianin@...dex-team.ru>, Petr Mladek <pmladek@...e.com>
Cc: Daniil Tatianin <d-tatianin@...dex-team.ru>,
 linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>, Sergey
 Senozhatsky <senozhatsky@...omium.org>
Subject: Re: [PATCH v2 1/2] printk_ringbuffer: don't needlessly wrap data
 blocks around

On 2025-09-05, John Ogness <john.ogness@...utronix.de> wrote:
>> diff --git a/kernel/printk/printk_ringbuffer.c b/kernel/printk/printk_ringbuffer.c
>> index d9fb053cff67..99989a9ce4b4 100644
>> --- a/kernel/printk/printk_ringbuffer.c
>> +++ b/kernel/printk/printk_ringbuffer.c
>> @@ -1234,14 +1245,14 @@ static const char *get_data(struct prb_data_ring *data_ring,
>>  	}
>>  
>>  	/* Regular data block: @begin less than @next and in same wrap. */
>> -	if (DATA_WRAPS(data_ring, blk_lpos->begin) == DATA_WRAPS(data_ring, blk_lpos->next) &&
>> +	if (!is_blk_wrapped(data_ring, blk_lpos->begin, blk_lpos->next) &&
>>  	    blk_lpos->begin < blk_lpos->next) {
>>  		db = to_block(data_ring, blk_lpos->begin);
>>  		*data_size = blk_lpos->next - blk_lpos->begin;
>>  
>>  	/* Wrapping data block: @begin is one wrap behind @next. */
>> -	} else if (DATA_WRAPS(data_ring, blk_lpos->begin + DATA_SIZE(data_ring)) ==
>> -		   DATA_WRAPS(data_ring, blk_lpos->next)) {
>> +	} else if (!is_blk_wrapped(data_ring,
>> +		   blk_lpos->begin + DATA_SIZE(data_ring), blk_lpos->next)) {
>
> It would look nicer if the arguments of the function were indented to
> the function parenthesis:
>
> 	} else if (!is_blk_wrapped(data_ring, blk_lpos->begin +
> 				   DATA_SIZE(data_ring), blk_lpos->next)) {

Ugh, my mail client messed that up. I meant to write:

	} else if (!is_blk_wrapped(data_ring,
				   blk_lpos->begin + DATA_SIZE(data_ring),
				   blk_lpos->next)) {

> Reviewed-by: John Ogness <john.ogness@...utronix.de>
> Tested-by: John Ogness <john.ogness@...utronix.de>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ