+ proc-use-unsigned-int-in-proc_fill_cache.patch added to -mm tree

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

 



The patch titled
     Subject: proc: use "unsigned int" in proc_fill_cache()
has been added to the -mm tree.  Its filename is
     proc-use-unsigned-int-in-proc_fill_cache.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/proc-use-unsigned-int-in-proc_fill_cache.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/proc-use-unsigned-int-in-proc_fill_cache.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Subject: proc: use "unsigned int" in proc_fill_cache()

All those lengths are unsigned as they should be.

Link: http://lkml.kernel.org/r/20180423213751.GC9043@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/proc/base.c     |    6 +++---
 fs/proc/fd.c       |    2 +-
 fs/proc/internal.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff -puN fs/proc/base.c~proc-use-unsigned-int-in-proc_fill_cache fs/proc/base.c
--- a/fs/proc/base.c~proc-use-unsigned-int-in-proc_fill_cache
+++ a/fs/proc/base.c
@@ -1844,7 +1844,7 @@ const struct dentry_operations pid_dentr
  * by stat.
  */
 bool proc_fill_cache(struct file *file, struct dir_context *ctx,
-	const char *name, int len,
+	const char *name, unsigned int len,
 	instantiate_t instantiate, struct task_struct *task, const void *ptr)
 {
 	struct dentry *child, *dir = file->f_path.dentry;
@@ -3233,7 +3233,7 @@ int proc_pid_readdir(struct file *file,
 	     iter.task;
 	     iter.tgid += 1, iter = next_tgid(ns, iter)) {
 		char name[10 + 1];
-		int len;
+		unsigned int len;
 
 		cond_resched();
 		if (!has_pid_permissions(ns, iter.task, HIDEPID_INVISIBLE))
@@ -3565,7 +3565,7 @@ static int proc_task_readdir(struct file
 	     task;
 	     task = next_tid(task), ctx->pos++) {
 		char name[10 + 1];
-		int len;
+		unsigned int len;
 		tid = task_pid_nr_ns(task, ns);
 		len = snprintf(name, sizeof(name), "%u", tid);
 		if (!proc_fill_cache(file, ctx, name, len,
diff -puN fs/proc/fd.c~proc-use-unsigned-int-in-proc_fill_cache fs/proc/fd.c
--- a/fs/proc/fd.c~proc-use-unsigned-int-in-proc_fill_cache
+++ a/fs/proc/fd.c
@@ -237,7 +237,7 @@ static int proc_readfd_common(struct fil
 	     fd < files_fdtable(files)->max_fds;
 	     fd++, ctx->pos++) {
 		char name[10 + 1];
-		int len;
+		unsigned int len;
 
 		if (!fcheck_files(files, fd))
 			continue;
diff -puN fs/proc/internal.h~proc-use-unsigned-int-in-proc_fill_cache fs/proc/internal.h
--- a/fs/proc/internal.h~proc-use-unsigned-int-in-proc_fill_cache
+++ a/fs/proc/internal.h
@@ -156,7 +156,7 @@ extern loff_t mem_lseek(struct file *, l
 /* Lookups */
 typedef int instantiate_t(struct inode *, struct dentry *,
 				     struct task_struct *, const void *);
-extern bool proc_fill_cache(struct file *, struct dir_context *, const char *, int,
+bool proc_fill_cache(struct file *, struct dir_context *, const char *, unsigned int,
 			   instantiate_t, struct task_struct *, const void *);
 
 /*
_

Patches currently in -mm which might be from adobriyan@xxxxxxxxx are

proc-make-proc-cmdline-go-through-lsm.patch
proc-more-unsigned-int-in-proc-cmdline.patch
proc-somewhat-simpler-code-for-proc-cmdline.patch
proc-simpler-iterations-for-proc-cmdline.patch
proc-deduplicate-proc-cmdline-implementation.patch
proc-smaller-rcu-section-in-getattr.patch
proc-use-unsigned-int-in-proc_fill_cache.patch
proc-skip-branch-in-proc-lookup.patch
proc-use-unsigned-int-for-sigqueue-length.patch
proc-use-unsigned-int-for-proc-stack.patch
coredump-fix-spam-with-zero-vma-process.patch
seq_file-delete-small-value-optimization.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux