linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] proc_keys_next should increase position index
@ 2020-01-24  6:25 Vasily Averin
  2020-01-27 11:39 ` David Howells
  2020-01-30  8:38 ` Jarkko Sakkinen
  0 siblings, 2 replies; 8+ messages in thread
From: Vasily Averin @ 2020-01-24  6:25 UTC (permalink / raw)
  To: keyrings, linux-security-module
  Cc: David Howells, Jarkko Sakkinen, James Morris, Serge E. Hallyn

if seq_file .next fuction does not change position index,
read after some lseek can generate unexpected output.

https://bugzilla.kernel.org/show_bug.cgi?id=206283
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 security/keys/proc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/security/keys/proc.c b/security/keys/proc.c
index 415f3f1..d0cde66 100644
--- a/security/keys/proc.c
+++ b/security/keys/proc.c
@@ -139,6 +139,8 @@ static void *proc_keys_next(struct seq_file *p, void *v, loff_t *_pos)
 	n = key_serial_next(p, v);
 	if (n)
 		*_pos = key_node_serial(n);
+	else
+		(*_pos)++;
 	return n;
 }
 
-- 
1.8.3.1


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

end of thread, other threads:[~2020-02-01  7:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-24  6:25 [PATCH 1/1] proc_keys_next should increase position index Vasily Averin
2020-01-27 11:39 ` David Howells
2020-01-27 19:27   ` Vasily Averin
2020-01-30 10:16     ` [PATCH v2] keys: " Vasily Averin
2020-01-31 17:19     ` David Howells
2020-02-01  7:54       ` Vasily Averin
2020-01-30  8:42   ` [PATCH 1/1] " Jarkko Sakkinen
2020-01-30  8:38 ` Jarkko Sakkinen

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