Skip to contentSkip to conversation

audit: less stack usage for /proc/*/loginuid

PATCH In review Alexey Dobriyan 3 participants 3 messages Oct 29, 2016 – Nov 3, 2016 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 audit: less stack usage for /proc/*/loginuid

%u requires 10 characters at most not 20.

---

 fs/proc/base.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/base.c +1 -1
@@ -1243,7 +1243,7 @@ static const struct file_operations proc_oom_score_adj_operations = {
 };
 
 #ifdef CONFIG_AUDITSYSCALL
-#define TMPBUFLEN 21
+#define TMPBUFLEN 11
 static ssize_t proc_loginuid_read(struct file * file, char __user * buf,
 				  size_t count, loff_t *ppos)
 {
#1 lore raw
Quoted 3 lines · Alexey Dobriyan

%u requires 10 characters at most not 20.

Ack, looks reasonable to me. This has been there from the original commit 1e2d1492e178 Serge Hallyn, Feb 2005.

Quoted 8 lines

---

 fs/proc/base.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

fs/proc/base.c static const struct file_operations proc_oom_score_adj_operations = { · line 1249

Quoted 8 lines
fs/proc/base.c +1 -1
@@ -1243,7 +1243,7 @@ static const struct file_operations proc_oom_score_adj_operations = {
 };
 
 #ifdef CONFIG_AUDITSYSCALL
-#define TMPBUFLEN 21
+#define TMPBUFLEN 11
 static ssize_t proc_loginuid_read(struct file * file, char __user * buf,
 				  size_t count, loff_t *ppos)
 {

- RGB

--
Richard Guy Briggs <[email protected]>
Kernel Security Engineering, Base Operating Systems, Red Hat Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635

#2 lore raw
In reply to Alexey Dobriyan
Quoted 7 lines · Alexey Dobriyan

%u requires 10 characters at most not 20.

---

 fs/proc/base.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Looks reasonable to me, merged. Thanks.

Quoted 11 lines
fs/proc/base.c +1 -1
@@ -1243,7 +1243,7 @@ static const struct file_operations proc_oom_score_adj_operations = {
 };
 
 #ifdef CONFIG_AUDITSYSCALL
-#define TMPBUFLEN 21
+#define TMPBUFLEN 11
 static ssize_t proc_loginuid_read(struct file * file, char __user * buf,
                                  size_t count, loff_t *ppos)
 {
Signature · 2 lines
paul moore
www.paul-moore.com