Do not pass NULL to XGETQSTAT quotactl()

This commit is contained in:
Petr Písař 2011-04-11 18:53:23 +02:00
parent ed16933595
commit 9fcb474bc3
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From 5b9c30f584a4f36aceade621341c084b840dfaff Mon Sep 17 00:00:00 2001
From: jkar8572 <jkar8572>
Date: Mon, 10 May 2010 07:10:57 +0000
Subject: [PATCH] We shouldn't pass NULL to XGETQSTAT quotactl since kernel either fails with
EFAULT or reads garbage from NULL address (which makes SELinux spit warnings).
(Jan Kara)
Petr Pisar: Changelog entry removed.
diff --git a/quotasys.c b/quotasys.c
index 307a359..5b6996c 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -754,7 +754,7 @@ void init_kernel_interface(void)
else {
fs_quota_stat_t dummy;
- if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, (void *)&dummy) || (errno != EINVAL && errno != ENOSYS))
+ if (!quotactl(QCMD(Q_XGETQSTAT, 0), "/dev/root", 0, (void *)&dummy) || (errno != EINVAL && errno != ENOSYS))
kernel_qfmt[kernel_qfmt_num++] = QF_XFS;
}
/* Detect new kernel interface; Assume generic interface unless we can prove there is not one... */
--
1.7.4.2

View File

@ -78,6 +78,8 @@ Patch29: quota-4.00_pre1-Fix-ddquot-buffer-leak.patch
Patch30: quota-4.00_pre1-fix-repquota-to-get-latest-quota-info-header.patch
# In upstream 4.00_pre2, bug #695409
Patch31: quota-4.00_pre1-Initialize-v2r1-ddquot-padding-in-dump.patch
# In upstream 4.00_pre2
Patch32: quota-4.00_pre1-We-shouldn-t-pass-NULL-to-XGETQSTAT-quotactl-since-k.patch
%description
@ -180,6 +182,7 @@ Linux/UNIX environment.
%patch29 -p1 -b .fix_ddquot_leak
%patch30 -p1 -b .repquota_latest_info.patch
%patch31 -p1 -b .initizalize_ddquot_paddding
%patch32 -p1 -b .do_not_pass_null_to_XGETQSTAT
# quotactl(2) moved into `man-pages' package (bug #640590)
rm -f quotactl.2
# remove VCS files
@ -304,6 +307,7 @@ rm -rf %{buildroot}
%changelog
* Mon Apr 11 2011 Petr Pisar <ppisar@redhat.com> - 1:4.00-0.14.pre1
- Initialize v2r1 ddquot padding in dump (bug #695409)
- Do not pass NULL to XGETQSTAT quotactl()
* Mon Mar 21 2011 Petr Pisar <ppisar@redhat.com> - 1:4.00-0.13.pre1
- Fix repquota to get latest quota info header (bug #689458)