The patch titled Subject: memcg: use scnprintf instead of sprintf has been removed from the -mm tree. Its filename was hugetlbfs-add-memcg-control-files-for-hugetlbfs-use-scnprintf-instead-of-sprintf.patch This patch was dropped because an updated version will be merged The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ From: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx> Subject: memcg: use scnprintf instead of sprintf Make sure we don't overflow. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: Hillf Danton <dhillf@xxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff -puN mm/memcontrol.c~hugetlbfs-add-memcg-control-files-for-hugetlbfs-use-scnprintf-instead-of-sprintf mm/memcontrol.c --- a/mm/memcontrol.c~hugetlbfs-add-memcg-control-files-for-hugetlbfs-use-scnprintf-instead-of-sprintf +++ a/mm/memcontrol.c @@ -5110,14 +5110,14 @@ static void mem_cgroup_destroy(struct cg } #ifdef CONFIG_MEM_RES_CTLR_HUGETLB -static char *mem_fmt(char *buf, unsigned long n) +static char *mem_fmt(char *buf, int size, unsigned long hsize) { - if (n >= (1UL << 30)) - sprintf(buf, "%luGB", n >> 30); - else if (n >= (1UL << 20)) - sprintf(buf, "%luMB", n >> 20); + if (hsize >= (1UL << 30)) + scnprintf(buf, size, "%luGB", hsize >> 30); + else if (hsize >= (1UL << 20)) + scnprintf(buf, size, "%luMB", hsize >> 20); else - sprintf(buf, "%luKB", n >> 10); + scnprintf(buf, size, "%luKB", hsize >> 10); return buf; } @@ -5128,7 +5128,7 @@ int __init mem_cgroup_hugetlb_file_init( struct hstate *h = &hstates[idx]; /* format the size */ - mem_fmt(buf, huge_page_size(h)); + mem_fmt(buf, 32, huge_page_size(h)); /* Add the limit file */ cft = &h->mem_cgroup_files[0]; _ Patches currently in -mm which might be from aneesh.kumar@xxxxxxxxxxxxxxxxxx are linux-next.patch hugetlbfs-add-memcg-control-files-for-hugetlbfs-use-scnprintf-instead-of-sprintf-fix.patch hugetlbfs-add-memcg-control-files-for-hugetlbfs-add-failcnt-support-for-hugetlb-extension.patch hugetlbfs-add-a-list-for-tracking-in-use-hugetlb-pages.patch memcg-move-hugetlb-resource-count-to-parent-cgroup-on-memcg-removal.patch memcg-move-hugetlb-resource-count-to-parent-cgroup-on-memcg-removal-fix.patch memcg-move-hugetlb-resource-count-to-parent-cgroup-on-memcg-removal-fix-fix.patch hugetlb-migrate-memcg-info-from-oldpage-to-new-page-during-migration.patch hugetlb-migrate-memcg-info-from-oldpage-to-new-page-during-migration-fix.patch hugetlb-migrate-memcg-info-from-oldpage-to-new-page-during-migration-fix-2.patch memcg-add-memory-controller-documentation-for-hugetlb-management.patch memcg-fix-error-code-in-hugetlb_force_memcg_empty.patch memcg-fix-error-code-in-hugetlb_force_memcg_empty-v2.patch memcg-fix-error-code-in-hugetlb_force_memcg_empty-v2-checkpatch-fixes.patch memcg-use-res_counter_uncharge_until-in-mem_cgroup_move_hugetlb_parent.patch memcg-move-charges-to-root-cgroup-if-use_hierarchy=0-in-mem_cgroup_move_hugetlb_parent.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