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

Bug#794962: marked as done (wheezy-pu: package openafs/1.6.1-3+deb7u3)



Your message dated Sat, 05 Sep 2015 14:33:54 +0100
with message-id <1441460034.2151.33.camel@adam-barratt.org.uk>
and subject line Closing bugs for 7.9
has caused the Debian Bug report #794962,
regarding wheezy-pu: package openafs/1.6.1-3+deb7u3
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
794962: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794962
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: wheezy
User: release.debian.org@packages.debian.org
Usertags: pu

The security update to the linux kernel (3.2.65-1+deb7u2) changed the
KPI by moving d_alias into the d_u union, which causes subsequent
(re)build attempts of the openafs kernel module to fail.  (Existing
openafs kernel modules continued to work due to clever work by
the kernel maintainer.)  This situation was maintained without great
incident until the upload of openafs 1.6.1-3+deb7u3 to the security
repo, which cause most people to attempt to build a new openafs kernel
module and fail.  Two grave bugs (780865 and 794224) reflect that situation.

We had to deal with this problem for jessie back in February, but I
didn't have enough time to fix it for wheezy then.  The jessie updates
also included a fix for a bug causing potential data corruption in
mmapped files; I included the fix for that (778851) in this w-p-u as well.

A debdiff between deb7u3 (from the security repo) and my proposed deb7u4
is attached.

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru openafs-1.6.1/debian/changelog openafs-1.6.1/debian/changelog
--- openafs-1.6.1/debian/changelog	2015-07-30 06:27:51.000000000 -0400
+++ openafs-1.6.1/debian/changelog	2015-08-08 14:23:47.000000000 -0400
@@ -1,3 +1,12 @@
+openafs (1.6.1-3+deb7u4) wheezy-proposed-updates; urgency=medium
+
+  * Fix the kernel module build when d_alias is in the d_u union
+    (Closes: #780865, Closes: #794224)
+    to d_alias being a member of the d_u union.
+  * Fix potential file corruption of mmapped files (Closes: #778851)
+
+ -- Benjamin Kaduk <kaduk@mit.edu>  Sat, 08 Aug 2015 14:19:04 -0400
+
 openafs (1.6.1-3+deb7u3) wheezy-security; urgency=high
 
   * Apply upstream security patches from the 1.6.13 release (thanks to
diff -Nru openafs-1.6.1/debian/patches/debian-changes openafs-1.6.1/debian/patches/debian-changes
--- openafs-1.6.1/debian/patches/debian-changes	2015-07-30 06:34:05.000000000 -0400
+++ openafs-1.6.1/debian/patches/debian-changes	2015-08-08 14:27:33.000000000 -0400
@@ -8,6 +8,16 @@
 
 For full commit history and separated commits, see the packaging Git
 repository.
+--- openafs-1.6.1.orig/acinclude.m4
++++ openafs-1.6.1/acinclude.m4
+@@ -793,6 +793,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinu
+ 		 AC_CHECK_LINUX_STRUCT([backing_dev_info], [name],
+ 				       [backing-dev.h])
+ 		 AC_CHECK_LINUX_STRUCT([ctl_table], [ctl_name], [sysctl.h])
++		 AC_CHECK_LINUX_STRUCT([dentry], [d_u.d_alias], [dcache.h])
+ 		 AC_CHECK_LINUX_STRUCT([inode], [i_alloc_sem], [fs.h])
+ 		 AC_CHECK_LINUX_STRUCT([inode], [i_blkbits], [fs.h])
+ 		 AC_CHECK_LINUX_STRUCT([inode], [i_blksize], [fs.h])
 --- openafs-1.6.1.orig/configure.ac
 +++ openafs-1.6.1/configure.ac
 @@ -50,14 +50,20 @@ MAKE_KRB5="#"
@@ -47,6 +57,301 @@
       RRA_LIB_KRB5_RESTORE])
  AC_SUBST([BUILD_KRB5])
  AC_SUBST([MAKE_KRB5])
+--- openafs-1.6.1.orig/src/afs/LINUX/osi_compat.h
++++ openafs-1.6.1/src/afs/LINUX/osi_compat.h
+@@ -27,6 +27,10 @@
+ # endif
+ #endif
+ 
++#if defined(STRUCT_DENTRY_HAS_D_U_D_ALIAS)
++# define d_alias d_u.d_alias
++#endif
++
+ #ifndef HAVE_LINUX_DO_SYNC_READ
+ static inline int
+ do_sync_read(struct file *fp, char *buf, size_t count, loff_t *offp) {
+--- openafs-1.6.1.orig/src/afs/LINUX/osi_prototypes.h
++++ openafs-1.6.1/src/afs/LINUX/osi_prototypes.h
+@@ -79,6 +79,9 @@ extern void osi_VM_FlushPages(struct vca
+ extern void osi_VM_Truncate(struct vcache *avc, int alen,
+ 			    afs_ucred_t *acred);
+ 
++/* osi_vcache.c */
++extern void osi_ResetRootVCache(afs_uint32 volid);
++
+ /* osi_vfsops.c */
+ extern void vattr2inode(struct inode *ip, struct vattr *vp);
+ extern int afs_init_inodecache(void);
+--- openafs-1.6.1.orig/src/afs/LINUX/osi_vcache.c
++++ openafs-1.6.1/src/afs/LINUX/osi_vcache.c
+@@ -13,6 +13,8 @@
+ #include "afs/sysincludes.h"    /*Standard vendor system headers */
+ #include "afsincludes.h"        /*AFS-based standard headers */
+ 
++#include "osi_compat.h"
++
+ int
+ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
+     int code;
+@@ -139,3 +141,64 @@ osi_PostPopulateVCache(struct vcache *av
+     vSetType(avc, VREG);
+ }
+ 
++/**
++ * osi_ResetRootVCache - Reset the root vcache
++ * Reset the dentry associated with the afs root.
++ * Called from afs_CheckRootVolume when we notice that
++ * the root volume ID has changed.
++ *
++ * @volid: volume ID for the afs root
++ */
++void
++osi_ResetRootVCache(afs_uint32 volid)
++{
++    struct vrequest *treq = NULL;
++    struct vattr vattr;
++    cred_t *credp;
++    struct dentry *dp;
++    struct vcache *vcp;
++    struct inode *root = AFSTOV(afs_globalVp);
++
++    afs_rootFid.Fid.Volume = volid;
++    afs_rootFid.Fid.Vnode = 1;
++    afs_rootFid.Fid.Unique = 1;
++
++    credp = crref();
++    if (afs_CreateReq(&treq, credp))
++	goto out;
++    vcp = afs_GetVCache(&afs_rootFid, treq, NULL, NULL);
++    if (!vcp)
++	goto out;
++    afs_getattr(vcp, &vattr, credp);
++    afs_fill_inode(AFSTOV(vcp), &vattr);
++
++    dp = d_find_alias(root);
++
++#if defined(HAVE_DCACHE_LOCK)
++    spin_lock(&dcache_lock);
++#else
++    spin_lock(&AFSTOV(vcp)->i_lock);
++#endif
++    spin_lock(&dp->d_lock);
++#if defined(D_ALIAS_IS_HLIST)
++    hlist_del_init(&dp->d_alias);
++    hlist_add_head(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
++#else
++    list_del_init(&dp->d_alias);
++    list_add(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
++#endif
++    dp->d_inode = AFSTOV(vcp);
++    spin_unlock(&dp->d_lock);
++#if defined(HAVE_DCACHE_LOCK)
++    spin_unlock(&dcache_lock);
++#else
++    spin_unlock(&AFSTOV(vcp)->i_lock);
++#endif
++    dput(dp);
++
++    AFS_RELE(root);
++    afs_globalVp = vcp;
++out:
++    crfree(credp);
++    afs_DestroyReq(treq);
++}
+--- openafs-1.6.1.orig/src/afs/LINUX24/osi_prototypes.h
++++ openafs-1.6.1/src/afs/LINUX24/osi_prototypes.h
+@@ -69,6 +69,9 @@ extern void osi_syscall_clean(void);
+ extern int osi_sysctl_init(void);
+ extern void osi_sysctl_clean(void);
+ 
++/* osi_vcache.c */
++extern void osi_ResetRootVCache(afs_uint32 volid);
++
+ /* osi_vm.c */
+ extern int osi_VM_FlushVCache(struct vcache *avc, int *slept);
+ extern void osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred,
+--- openafs-1.6.1.orig/src/afs/LINUX24/osi_vcache.c
++++ openafs-1.6.1/src/afs/LINUX24/osi_vcache.c
+@@ -118,3 +118,39 @@ osi_PostPopulateVCache(struct vcache *av
+     vSetType(avc, VREG);
+ }
+ 
++void
++osi_ResetRootVCache(afs_uint32 volid)
++{
++    struct vrequest *treq = NULL;
++    struct vattr vattr;
++    cred_t *credp;
++    struct dentry *dp;
++    struct vcache *vcp;
++
++    afs_rootFid.Fid.Volume = volid;
++    afs_rootFid.Fid.Vnode = 1;
++    afs_rootFid.Fid.Unique = 1;
++
++    credp = crref();
++    if (afs_CreateReq(&treq, credp))
++	goto out;
++    vcp = afs_GetVCache(&afs_rootFid, treq, NULL, NULL);
++    if (!vcp)
++	goto out;
++    afs_getattr(vcp, &vattr, credp);
++    afs_fill_inode(AFSTOV(vcp), &vattr);
++
++    dp = d_find_alias(AFSTOV(afs_globalVp));
++    spin_lock(&dcache_lock);
++    list_del_init(&dp->d_alias);
++    list_add(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
++    dp->d_inode = AFSTOV(vcp);
++    spin_unlock(&dcache_lock);
++    dput(dp);
++
++    AFS_FAST_RELE(afs_globalVp);
++    afs_globalVp = vcp;
++out:
++    crfree(credp);
++    afs_DestroyReq(treq);
++}
+--- openafs-1.6.1.orig/src/afs/afs_daemons.c
++++ openafs-1.6.1/src/afs/afs_daemons.c
+@@ -363,65 +363,14 @@ afs_CheckRootVolume(void)
+ 		 * count to zero and fs checkv is executed when the current
+ 		 * directory is /afs.
+ 		 */
+-#ifdef AFS_LINUX20_ENV
+-		{
+-		    struct vrequest treq;
+-		    struct vattr vattr;
+-		    cred_t *credp;
+-		    struct dentry *dp;
+-		    struct vcache *vcp;
+-
+-		    afs_rootFid.Fid.Volume = volid;
+-		    afs_rootFid.Fid.Vnode = 1;
+-		    afs_rootFid.Fid.Unique = 1;
+-
+-		    credp = crref();
+-		    if (afs_InitReq(&treq, credp))
+-			goto out;
+-		    vcp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL);
+-		    if (!vcp)
+-			goto out;
+-		    afs_getattr(vcp, &vattr, credp);
+-		    afs_fill_inode(AFSTOV(vcp), &vattr);
+-
+-		    dp = d_find_alias(AFSTOV(afs_globalVp));
+-
+-#if defined(AFS_LINUX24_ENV)
+-#if defined(HAVE_DCACHE_LOCK)
+-		    spin_lock(&dcache_lock);
++#ifdef AFS_LINUX22_ENV
++		osi_ResetRootVCache(volid);
+ #else
+-		    spin_lock(&AFSTOV(vcp)->i_lock);
+-#endif
+-#if defined(AFS_LINUX26_ENV)
+-		    spin_lock(&dp->d_lock);
+-#endif
+-#endif
+-		    list_del_init(&dp->d_alias);
+-		    list_add(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
+-		    dp->d_inode = AFSTOV(vcp);
+-#if defined(AFS_LINUX24_ENV)
+-#if defined(AFS_LINUX26_ENV)
+-		    spin_unlock(&dp->d_lock);
+-#endif
+-#if defined(HAVE_DCACHE_LOCK)
+-		    spin_unlock(&dcache_lock);
+-#else
+-		    spin_unlock(&AFSTOV(vcp)->i_lock);
+-#endif
+-#endif
+-		    dput(dp);
+-
+-		    AFS_FAST_RELE(afs_globalVp);
+-		    afs_globalVp = vcp;
+-		out:
+-		    crfree(credp);
+-		}
+-#else
+-#ifdef AFS_DARWIN80_ENV
++# ifdef AFS_DARWIN80_ENV
+ 		afs_PutVCache(afs_globalVp);
+-#else
++# else
+ 		AFS_FAST_RELE(afs_globalVp);
+-#endif
++# endif
+ 		afs_globalVp = 0;
+ #endif
+ 	    }
+--- openafs-1.6.1.orig/src/afs/afs_osi_pag.c
++++ openafs-1.6.1/src/afs/afs_osi_pag.c
+@@ -487,6 +487,64 @@ afs_InitReq(struct vrequest *av, afs_ucr
+     return 0;
+ }
+ 
++/*!
++ * Allocate and setup a vrequest.
++ *
++ * \note The caller must free the allocated vrequest with
++ *       afs_DestroyReq() if this function returns successfully (zero).
++ *
++ * \note The GLOCK must be held on platforms which require the GLOCK
++ *       for osi_AllocSmallSpace() and osi_FreeSmallSpace().
++ *
++ * \param[out] avpp   address of the vrequest pointer
++ * \param[in]  acred  user credentials to setup the vrequest; may be NULL
++ * \return     0 on success
++ */
++int
++afs_CreateReq(struct vrequest **avpp, afs_ucred_t *acred)
++{
++    int code;
++    struct vrequest *treq = NULL;
++
++    if (afs_shuttingdown) {
++	return EIO;
++    }
++    if (!avpp) {
++	return EINVAL;
++    }
++    treq = osi_AllocSmallSpace(sizeof(struct vrequest));
++    if (!treq) {
++	return ENOMEM;
++    }
++    if (!acred) {
++	memset(treq, 0, sizeof(struct vrequest));
++    } else {
++	code = afs_InitReq(treq, acred);
++	if (code != 0) {
++	    osi_FreeSmallSpace(treq);
++	    return code;
++	}
++    }
++    *avpp = treq;
++    return 0;
++}
++
++/*!
++ * Deallocate a vrequest.
++ *
++ * \note The GLOCK must be held on platforms which require the GLOCK
++ *       for osi_FreeSmallSpace().
++ *
++ * \param[in]  av  pointer to the vrequest to free; may be NULL
++ */
++void
++afs_DestroyReq(struct vrequest *av)
++{
++    if (av) {
++	osi_FreeSmallSpace(av);
++    }
++}
++
+ #ifndef AFS_LINUX26_ONEGROUP_ENV
+ afs_uint32
+ afs_get_pag_from_groups(gid_t g0a, gid_t g1a)
 --- openafs-1.6.1.orig/src/afs/afs_pioctl.c
 +++ openafs-1.6.1/src/afs/afs_pioctl.c
 @@ -62,6 +62,11 @@ afs_pd_alloc(struct afs_pdata *apd, size
@@ -71,6 +376,43 @@
  		RX_AFS_GLOCK();
  	    } else
  		code = -1;
+--- openafs-1.6.1.orig/src/afs/afs_prototypes.h
++++ openafs-1.6.1/src/afs/afs_prototypes.h
+@@ -601,6 +601,8 @@ extern int AddPag(afs_proc_t *p, afs_int
+ extern int AddPag(afs_int32 aval, afs_ucred_t **credpp);
+ #endif
+ extern int afs_InitReq(struct vrequest *av, afs_ucred_t *acred);
++extern int afs_CreateReq(struct vrequest **avpp, afs_ucred_t *acred);
++extern void afs_DestroyReq(struct vrequest *av);
+ extern afs_uint32 afs_get_pag_from_groups(gid_t g0a, gid_t g1a);
+ extern void afs_get_groups_from_pag(afs_uint32 pag, gid_t * g0p, gid_t * g1p);
+ extern afs_int32 PagInCred(afs_ucred_t *cred);
+--- openafs-1.6.1.orig/src/afs/afs_segments.c
++++ openafs-1.6.1/src/afs/afs_segments.c
+@@ -175,8 +175,6 @@ afs_StoreAllSegments(struct vcache *avc,
+ 
+     AFS_STATCNT(afs_StoreAllSegments);
+ 
+-    hset(oldDV, avc->f.m.DataVersion);
+-    hset(newDV, avc->f.m.DataVersion);
+     hash = DVHash(&avc->f.fid);
+     foreign = (avc->f.states & CForeign);
+     dcList = (struct dcache **)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+@@ -214,6 +212,14 @@ afs_StoreAllSegments(struct vcache *avc,
+ 	/*printf("Net down in afs_StoreSegments\n");*/
+ 	return ENETDOWN;
+     }
++
++    /*
++     * Can't do this earlier because osi_VM_StoreAllSegments drops locks
++     * and can indirectly do some stores that increase the DV.
++     */
++    hset(oldDV, avc->f.m.DataVersion);
++    hset(newDV, avc->f.m.DataVersion);
++
+     ConvertWToSLock(&avc->lock);
+ 
+     /*
 --- openafs-1.6.1.orig/src/aklog/aklog.c
 +++ openafs-1.6.1/src/aklog/aklog.c
 @@ -91,6 +91,7 @@

--- End Message ---
--- Begin Message ---
Version: 7.9

Hi,

These bugs relate to updates which were included in the 7.9 point
release.

Regards,

Adam

--- End Message ---

Reply to: