The patch titled Subject: nilfs2: avoid overflowing segment numbers in nilfs_ioctl_clean_segments() has been added to the -mm tree. Its filename is nilfs2-avoid-overflowing-segment-numbers-in-nilfs_ioctl_clean_segments.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/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Xi Wang <xi.wang@xxxxxxxxx> Subject: nilfs2: avoid overflowing segment numbers in nilfs_ioctl_clean_segments() nsegs is read from userspace. Limit its value and avoid overflowing nsegs * sizeof(__u64) in the subsequent call to memdup_user(). This patch complements 481fe17e973fb9 ("nilfs2: potential integer overflow in nilfs_ioctl_clean_segments()"). Signed-off-by: Xi Wang <xi.wang@xxxxxxxxx> Cc: Haogang Chen <haogangchen@xxxxxxxxx> Cc: KONISHI Ryusuke <konishi.ryusuke@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/nilfs2/ioctl.c | 2 ++ 1 file changed, 2 insertions(+) diff -puN fs/nilfs2/ioctl.c~nilfs2-avoid-overflowing-segment-numbers-in-nilfs_ioctl_clean_segments fs/nilfs2/ioctl.c --- a/fs/nilfs2/ioctl.c~nilfs2-avoid-overflowing-segment-numbers-in-nilfs_ioctl_clean_segments +++ a/fs/nilfs2/ioctl.c @@ -603,6 +603,8 @@ static int nilfs_ioctl_clean_segments(st nsegs = argv[4].v_nmembs; if (argv[4].v_size != argsz[4]) goto out; + if (nsegs > UINT_MAX / sizeof(__u64)) + goto out; /* * argv[4] points to segment numbers this ioctl cleans. We _ Subject: Subject: nilfs2: avoid overflowing segment numbers in nilfs_ioctl_clean_segments() Patches currently in -mm which might be from xi.wang@xxxxxxxxx are origin.patch linux-next.patch nilfs2-avoid-overflowing-segment-numbers-in-nilfs_ioctl_clean_segments.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